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



##########
File path: arch/risc-v/src/common/riscv_schedulesigaction.c
##########
@@ -293,8 +298,26 @@ void up_schedule_sigaction(struct tcb_s *tcb, 
sig_deliver_t sigdeliver)
                    */
 
                   tcb->xcp.sigdeliver       = (void *)sigdeliver;
-                  tcb->xcp.saved_epc        = CURRENT_REGS[REG_EPC];
-                  tcb->xcp.saved_int_ctx    = CURRENT_REGS[REG_INT_CTX];
+
+                  /* And make sure that the saved context in the TCB is the
+                   * same as the interrupt return context.
+                   */
+
+                  riscv_savestate(tcb->xcp.saved_regs);
+
+                  /* Duplicate the register context.  These will be
+                   * restored by the signal trampoline after the signal has
+                   * been delivered.
+                   */
+
+                  CURRENT_REGS = (uintptr_t *)STACK_ALIGN_DOWN(
+                                   (uintptr_t)CURRENT_REGS -
+                                   XCPTCONTEXT_SIZE);

Review comment:
       merge to previous line




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