pussuw commented on a change in pull request #5782: URL: https://github.com/apache/incubator-nuttx/pull/5782#discussion_r834653649
########## 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: The content of a0 is set as arg0 by the caller. Of course the caller saves the original a0 into its stack so it is preserved. In this case, since the function takes 1 argument, and returns 1 value, the argument is given in a0 (as per the ABI) and the return value is in a0 (as per the ABI). Stack is not involved here. -- 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