pussuw commented on a change in pull request #5782:
URL: https://github.com/apache/incubator-nuttx/pull/5782#discussion_r834620526



##########
File path: arch/risc-v/src/common/riscv_assert.c
##########
@@ -338,6 +338,10 @@ static void riscv_dumpstate(void)
   else
     {
       riscv_saveusercontext(rtcb->xcp.regs);
+
+      /* riscv_saveusercontext modifies the local context (a0), restore it */
+
+      rtcb = running_task();

Review comment:
       >Since the similar code exist in other arch too, it's better to fix all 
place if this is a real problem, but I don't think so.
   
   I looked at the code that was implemented for riscv with the irq handler and 
risvc_swint, it does not return anything.
   
   This is what the macro riscv_saveusercontext eventually does, notice how no 
return value is provided ?
   
   ```
          case SYS_save_context:
            {
              DEBUGASSERT(regs[REG_A1] != 0);
              riscv_copystate((uintptr_t *)regs[REG_A1], regs);
            }
            break;
   ```




-- 
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-unsubscr...@nuttx.apache.org

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


Reply via email to