You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2022/03/31 03:48:20 UTC

[GitHub] [incubator-nuttx] xiaoxiang781216 commented on a change in pull request #5913: arch/risc-v: Move group_addrenv to correct place

xiaoxiang781216 commented on a change in pull request #5913:
URL: https://github.com/apache/incubator-nuttx/pull/5913#discussion_r839144432



##########
File path: arch/risc-v/src/common/riscv_swint.c
##########
@@ -248,9 +258,19 @@ int riscv_swint(int irq, void *context, void *arg)
         {
           DEBUGASSERT(regs[REG_A1] != 0 && regs[REG_A2] != 0);
           riscv_savefpu(regs);
-          riscv_restorefpu((uintptr_t *)regs[REG_A2]);
           *(uintptr_t **)regs[REG_A1] = (uintptr_t *)regs;
           CURRENT_REGS = (uintptr_t *)regs[REG_A2];
+#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);

Review comment:
       ditto

##########
File path: arch/risc-v/src/common/riscv_swint.c
##########
@@ -223,6 +223,16 @@ int riscv_swint(int irq, void *context, void *arg)
         {
           DEBUGASSERT(regs[REG_A1] != 0);
           CURRENT_REGS = (uintptr_t *)regs[REG_A1];
+#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);

Review comment:
       don't need? done in up_doirq.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org