xiaoxiang781216 commented on code in PR #19772:
URL: https://github.com/apache/nuttx/pull/19772#discussion_r3754914564
##########
arch/xtensa/src/common/xtensa_initialstate.c:
##########
@@ -107,9 +107,24 @@ void up_initial_state(struct tcb_s *tcb)
/* Initialize the context registers to stack top */
- xcp->regs = (void *)((uint32_t)tcb->stack_base_ptr +
- tcb->adj_stack_size -
- XCPTCONTEXT_SIZE);
+#ifdef CONFIG_ARCH_KERNEL_STACK
+ if (xcp->kstack != NULL)
+ {
+ /* Put the frame on the thread's kernel stack rather than its user
+ * stack. It is restored in kernel context, and leaving it in user
+ * memory means the thread can scribble on the register set it is
+ * about to be started with.
+ */
+
+ xcp->regs = (void *)((uint32_t)xcp->ktopstk - XCPTCONTEXT_SIZE);
Review Comment:
change ALL uint32_t cast to uintptr_t
--
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]