xiaoxiang781216 commented on a change in pull request #5831: URL: https://github.com/apache/incubator-nuttx/pull/5831#discussion_r833325176
########## File path: arch/risc-v/src/common/riscv_swint.c ########## @@ -440,6 +472,22 @@ int riscv_swint(int irq, void *context, void *arg) regs[REG_INT_CTX] |= MSTATUS_MPPM; /* Machine mode */ rtcb->xcp.sigreturn = 0; + +#ifdef CONFIG_ARCH_KERNEL_STACK + /* We must enter here be using the user stack. We need to switch + * to back to the kernel user stack before returning to the kernel + * mode signal trampoline. + */ + + if (rtcb->xcp.kstack != NULL) + { + DEBUGASSERT(rtcb->xcp.kstkptr != NULL && + (uintptr_t)rtcb->xcp.ustkptr == regs[REG_SP]); Review comment: Ok, let keep until the assert trigger -- 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