pussuw edited a comment on pull request #5731: URL: https://github.com/apache/incubator-nuttx/pull/5731#issuecomment-1080751884
> Yes, xcp.regs[] is in the kernel space, but the thread stack pointed by SP isn't. Exactly, and now the memory for the task context is taken from the stack. ``` xcp->regs = (uintptr_t *)( (uintptr_t)tcb->stack_base_ptr + tcb->adj_stack_size - XCPTCONTEXT_SIZE); ``` Previously the memory was in tcb, as xcp.regs was a buffer, not a pointer: `uintptr_t regs[XCPTCONTEXT_REGS];`. This is why the old code works, because the buffer is in tcb which is kernel memory, for both tasks. -- 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