pussuw commented on code in PR #8227:
URL: https://github.com/apache/nuttx/pull/8227#discussion_r1086443989
##########
arch/risc-v/src/common/riscv_swint.c:
##########
@@ -497,8 +515,16 @@ int riscv_swint(int irq, void *context, void *arg)
if (index == 0 && rtcb->xcp.kstack != NULL)
{
rtcb->xcp.ustkptr = (uintptr_t *)regs[REG_SP];
- regs[REG_SP] = (uintptr_t)rtcb->xcp.kstack +
+ if (rtcb->xcp.kstkptr == NULL)
Review Comment:
I spent a bit of time on this and I think the new patch should now do what
this was originally intended to do:
- If rtcb->xcp.kstkptr is set, it means someone is already using the kernel
stack and regs[SP] should be set to this
- If rtcb->xcp.kstkptr is not set, it means no one is using it, and regs[SP]
should be set to the top of the kernel stack
Tested and verified the signal dispatch, and calling any system call from
the signal handler still works
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]