You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by pk...@apache.org on 2022/04/18 15:34:20 UTC

[incubator-nuttx] 02/04: arch/misoc: Remove unneeded group_addrenv call which handled by [lm32|minerva]_doirq

This is an automated email from the ASF dual-hosted git repository.

pkarashchenko pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git

commit ef62e1c970e265bd5d58679ef91bed00d8e8f26e
Author: Xiang Xiao <xi...@xiaomi.com>
AuthorDate: Sun Apr 17 22:46:22 2022 +0800

    arch/misoc: Remove unneeded group_addrenv call which handled by [lm32|minerva]_doirq
    
    Signed-off-by: Xiang Xiao <xi...@xiaomi.com>
---
 arch/misoc/src/lm32/lm32_blocktask.c             |  9 --------
 arch/misoc/src/lm32/lm32_exit.c                  | 10 ---------
 arch/misoc/src/lm32/lm32_releasepending.c        |  9 --------
 arch/misoc/src/lm32/lm32_reprioritizertr.c       |  9 --------
 arch/misoc/src/lm32/lm32_swint.c                 | 28 ------------------------
 arch/misoc/src/lm32/lm32_unblocktask.c           |  9 --------
 arch/misoc/src/minerva/minerva_blocktask.c       |  9 --------
 arch/misoc/src/minerva/minerva_exit.c            | 10 ---------
 arch/misoc/src/minerva/minerva_releasepending.c  |  9 --------
 arch/misoc/src/minerva/minerva_reprioritizertr.c |  9 --------
 arch/misoc/src/minerva/minerva_swint.c           | 28 ------------------------
 arch/misoc/src/minerva/minerva_unblocktask.c     |  9 --------
 12 files changed, 148 deletions(-)

diff --git a/arch/misoc/src/lm32/lm32_blocktask.c b/arch/misoc/src/lm32/lm32_blocktask.c
index 97f3d5a4ff..9bed1c0201 100644
--- a/arch/misoc/src/lm32/lm32_blocktask.c
+++ b/arch/misoc/src/lm32/lm32_blocktask.c
@@ -136,15 +136,6 @@ void up_block_task(struct tcb_s *tcb, tstate_t task_state)
 
           struct tcb_s *nexttcb = this_task();
 
-#ifdef CONFIG_ARCH_ADDRENV
-          /* Make sure that the address environment for the previously
-           * running task is closed down gracefully (data caches dump,
-           * MMU flushed) and set up the address environment for the new
-           * thread at the head of the ready-to-run list.
-           */
-
-          group_addrenv(nexttcb);
-#endif
           /* Reset scheduler parameters */
 
           nxsched_resume_scheduler(nexttcb);
diff --git a/arch/misoc/src/lm32/lm32_exit.c b/arch/misoc/src/lm32/lm32_exit.c
index 8bbcb4addb..08ff71cfb5 100644
--- a/arch/misoc/src/lm32/lm32_exit.c
+++ b/arch/misoc/src/lm32/lm32_exit.c
@@ -127,16 +127,6 @@ void up_exit(int status)
 
   nxsched_resume_scheduler(tcb);
 
-#ifdef CONFIG_ARCH_ADDRENV
-  /* Make sure that the address environment for the previously running
-   * task is closed down gracefully (data caches dump, MMU flushed) and
-   * set up the address environment for the new thread at the head of
-   * the ready-to-run list.
-   */
-
-  group_addrenv(tcb);
-#endif
-
   /* Then switch contexts */
 
   up_fullcontextrestore(tcb->xcp.regs);
diff --git a/arch/misoc/src/lm32/lm32_releasepending.c b/arch/misoc/src/lm32/lm32_releasepending.c
index f36f46ab58..75f88a0bfe 100644
--- a/arch/misoc/src/lm32/lm32_releasepending.c
+++ b/arch/misoc/src/lm32/lm32_releasepending.c
@@ -105,15 +105,6 @@ void up_release_pending(void)
 
           struct tcb_s *nexttcb = this_task();
 
-#ifdef CONFIG_ARCH_ADDRENV
-          /* Make sure that the address environment for the previously
-           * running task is closed down gracefully (data caches dump,
-           * MMU flushed) and set up the address environment for the new
-           * thread at the head of the ready-to-run list.
-           */
-
-          group_addrenv(nexttcb);
-#endif
           /* Update scheduler parameters */
 
           nxsched_resume_scheduler(nexttcb);
diff --git a/arch/misoc/src/lm32/lm32_reprioritizertr.c b/arch/misoc/src/lm32/lm32_reprioritizertr.c
index 5203abe962..97a2568b8a 100644
--- a/arch/misoc/src/lm32/lm32_reprioritizertr.c
+++ b/arch/misoc/src/lm32/lm32_reprioritizertr.c
@@ -159,15 +159,6 @@ void up_reprioritize_rtr(struct tcb_s *tcb, uint8_t priority)
 
               struct tcb_s *nexttcb = this_task();
 
-#ifdef CONFIG_ARCH_ADDRENV
-              /* Make sure that the address environment for the previously
-               * running task is closed down gracefully (data caches dump,
-               * MMU flushed) and set up the address environment for the new
-               * thread at the head of the ready-to-run list.
-               */
-
-              group_addrenv(nexttcb);
-#endif
               /* Update scheduler parameters */
 
               nxsched_resume_scheduler(nexttcb);
diff --git a/arch/misoc/src/lm32/lm32_swint.c b/arch/misoc/src/lm32/lm32_swint.c
index 3c0b403048..b54336eb00 100644
--- a/arch/misoc/src/lm32/lm32_swint.c
+++ b/arch/misoc/src/lm32/lm32_swint.c
@@ -296,33 +296,5 @@ int lm32_swint(int irq, void *context, void *arg)
     }
 #endif
 
-#if defined(CONFIG_ARCH_FPU) || defined(CONFIG_ARCH_ADDRENV)
-  /* Check for a context switch.  If a context switch occurred, then
-   * g_current_regs will have a different value than it did on entry.  If an
-   * interrupt level context switch has occurred, then restore the floating
-   * point state and the establish the correct address environment before
-   * returning from the interrupt.
-   */
-
-  if (regs != g_current_regs)
-    {
-#ifdef CONFIG_ARCH_FPU
-      /* Restore floating point registers */
-
-      up_restorefpu((uint32_t *)g_current_regs);
-#endif
-
-#ifdef CONFIG_ARCH_ADDRENV
-      /* Make sure that the address environment for the previously
-       * running task is closed down gracefully (data caches dump,
-       * MMU flushed) and set up the address environment for the new
-       * thread at the head of the ready-to-run list.
-       */
-
-      group_addrenv(NULL);
-#endif
-    }
-#endif
-
   return OK;
 }
diff --git a/arch/misoc/src/lm32/lm32_unblocktask.c b/arch/misoc/src/lm32/lm32_unblocktask.c
index bdd6ade3bd..4a6e69decb 100644
--- a/arch/misoc/src/lm32/lm32_unblocktask.c
+++ b/arch/misoc/src/lm32/lm32_unblocktask.c
@@ -122,15 +122,6 @@ void up_unblock_task(struct tcb_s *tcb)
 
           struct tcb_s *nexttcb = this_task();
 
-#ifdef CONFIG_ARCH_ADDRENV
-          /* Make sure that the address environment for the previously
-           * running task is closed down gracefully (data caches dump,
-           * MMU flushed) and set up the address environment for the new
-           * thread at the head of the ready-to-run list.
-           */
-
-          group_addrenv(nexttcb);
-#endif
           /* Update scheduler parameters */
 
           nxsched_resume_scheduler(nexttcb);
diff --git a/arch/misoc/src/minerva/minerva_blocktask.c b/arch/misoc/src/minerva/minerva_blocktask.c
index 8390b00c2b..6c6349af40 100644
--- a/arch/misoc/src/minerva/minerva_blocktask.c
+++ b/arch/misoc/src/minerva/minerva_blocktask.c
@@ -136,15 +136,6 @@ void up_block_task(struct tcb_s *tcb, tstate_t task_state)
 
           struct tcb_s *nexttcb = this_task();
 
-#ifdef CONFIG_ARCH_ADDRENV
-          /* Make sure that the address environment for the previously
-           * running task is closed down gracefully (data caches dump, MMU
-           * flushed) and set up the address environment for the new thread
-           * at the head of the ready-to-run list.
-           */
-
-          group_addrenv(nexttcb);
-#endif
           /* Reset scheduler parameters */
 
           nxsched_resume_scheduler(nexttcb);
diff --git a/arch/misoc/src/minerva/minerva_exit.c b/arch/misoc/src/minerva/minerva_exit.c
index 4e8b1f3ad7..90fd7c61c4 100644
--- a/arch/misoc/src/minerva/minerva_exit.c
+++ b/arch/misoc/src/minerva/minerva_exit.c
@@ -127,16 +127,6 @@ void up_exit(int status)
 
   nxsched_resume_scheduler(tcb);
 
-#ifdef CONFIG_ARCH_ADDRENV
-  /* Make sure that the address environment for the previously running task
-   * is closed down gracefully (data caches dump, MMU flushed) and set up the
-   * address environment for the new thread at the head of the ready-to-run
-   * list.
-   */
-
-  group_addrenv(tcb);
-#endif
-
   /* Then switch contexts */
 
   up_fullcontextrestore(tcb->xcp.regs);
diff --git a/arch/misoc/src/minerva/minerva_releasepending.c b/arch/misoc/src/minerva/minerva_releasepending.c
index 5623831c91..56c1441a80 100644
--- a/arch/misoc/src/minerva/minerva_releasepending.c
+++ b/arch/misoc/src/minerva/minerva_releasepending.c
@@ -105,15 +105,6 @@ void up_release_pending(void)
 
           struct tcb_s *nexttcb = this_task();
 
-#ifdef CONFIG_ARCH_ADDRENV
-          /* Make sure that the address environment for the previously
-           * running task is closed down gracefully (data caches dump, MMU
-           * flushed) and set up the address environment for the new thread
-           * at the head of the ready-to-run list.
-           */
-
-          group_addrenv(nexttcb);
-#endif
           /* Update scheduler parameters */
 
           nxsched_resume_scheduler(nexttcb);
diff --git a/arch/misoc/src/minerva/minerva_reprioritizertr.c b/arch/misoc/src/minerva/minerva_reprioritizertr.c
index fcd1b0d3ab..00edf65419 100644
--- a/arch/misoc/src/minerva/minerva_reprioritizertr.c
+++ b/arch/misoc/src/minerva/minerva_reprioritizertr.c
@@ -158,15 +158,6 @@ void up_reprioritize_rtr(struct tcb_s *tcb, uint8_t priority)
 
               struct tcb_s *nexttcb = this_task();
 
-#ifdef CONFIG_ARCH_ADDRENV
-              /* Make sure that the address environment for the previously
-               * running task is closed down gracefully (data caches dump,
-               * MMU flushed) and set up the address environment for the
-               * new thread at the head of the ready-to-run list.
-               */
-
-              group_addrenv(nexttcb);
-#endif
               /* Update scheduler parameters */
 
               nxsched_resume_scheduler(nexttcb);
diff --git a/arch/misoc/src/minerva/minerva_swint.c b/arch/misoc/src/minerva/minerva_swint.c
index af82f30d60..4b4b2f0711 100644
--- a/arch/misoc/src/minerva/minerva_swint.c
+++ b/arch/misoc/src/minerva/minerva_swint.c
@@ -273,33 +273,5 @@ int minerva_swint(int irq, void *context, void *arg)
     }
 #endif
 
-#if defined(CONFIG_ARCH_FPU) || defined(CONFIG_ARCH_ADDRENV)
-  /* Check for a context switch.  If a context switch occurred, then
-   * g_current_regs will have a different value than it did on entry.  If an
-   * interrupt level context switch has occurred, then restore the floating
-   * point state and the establish the correct address environment before
-   * returning from the interrupt.
-   */
-
-  if (regs != g_current_regs)
-    {
-#ifdef CONFIG_ARCH_FPU
-      /* Restore floating point registers */
-
-      up_restorefpu((uint32_t *) g_current_regs);
-#endif
-
-#ifdef CONFIG_ARCH_ADDRENV
-      /* Make sure that the address environment for the previously running
-       * task is closed down gracefully (data caches dump, MMU flushed) and
-       * set up the address environment for the new thread at the head of
-       * the ready-to-run list.
-       */
-
-      group_addrenv(NULL);
-#endif
-    }
-#endif
-
   return OK;
 }
diff --git a/arch/misoc/src/minerva/minerva_unblocktask.c b/arch/misoc/src/minerva/minerva_unblocktask.c
index 44916489c6..69c4e0a340 100644
--- a/arch/misoc/src/minerva/minerva_unblocktask.c
+++ b/arch/misoc/src/minerva/minerva_unblocktask.c
@@ -122,15 +122,6 @@ void up_unblock_task(struct tcb_s *tcb)
 
           struct tcb_s *nexttcb = this_task();
 
-#ifdef CONFIG_ARCH_ADDRENV
-          /* Make sure that the address environment for the previously
-           * running task is closed down gracefully (data caches dump, MMU
-           * flushed) and set up the address environment for the new thread
-           * at the head of the ready-to-run list.
-           */
-
-          group_addrenv(nexttcb);
-#endif
           /* Update scheduler parameters */
 
           nxsched_resume_scheduler(nexttcb);