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/30 10:33:51 UTC

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

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



##########
File path: arch/risc-v/src/common/riscv_swint.c
##########
@@ -248,9 +264,21 @@ 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
+
+          tcb = this_task();
+
+          /* 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);

Review comment:
       Yes IRQ stack is in use currently, but @anchao reported similar patch can't fix all issues on arm , does this PR works on RISC-V ?




-- 
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