anchao commented on a change in pull request #5645: URL: https://github.com/apache/incubator-nuttx/pull/5645#discussion_r825631832
########## File path: arch/arm/src/armv7-m/arm_initialstate.c ########## @@ -76,16 +80,24 @@ void up_initial_state(struct tcb_s *tcb) arm_stack_color(tcb->stack_alloc_ptr, 0); #endif /* CONFIG_STACK_COLORATION */ + + return; } - /* Initialize the initial exception register context structure */ + /* Initialize the context registers to stack top */ - memset(xcp, 0, sizeof(struct xcptcontext)); + xcp->regs = (FAR void *)(STACK_ALIGN_DOWN( + (uint32_t)tcb->stack_base_ptr + + tcb->adj_stack_size - + XCPTCONTEXT_SIZE)); Review comment: Done ########## File path: arch/arm/src/armv7-r/arm_initialstate.c ########## @@ -73,16 +77,24 @@ void up_initial_state(struct tcb_s *tcb) arm_stack_color(tcb->stack_alloc_ptr, 0); #endif /* CONFIG_STACK_COLORATION */ + + return; } - /* Initialize the initial exception register context structure */ + /* Initialize the context registers to stack top */ - memset(xcp, 0, sizeof(struct xcptcontext)); + xcp->regs = (FAR void *)(STACK_ALIGN_DOWN( + (uint32_t)tcb->stack_base_ptr + + tcb->adj_stack_size - + XCPTCONTEXT_SIZE)); Review comment: Done ########## File path: arch/arm/src/armv8-m/arm_initialstate.c ########## @@ -76,16 +80,24 @@ void up_initial_state(struct tcb_s *tcb) arm_stack_color(tcb->stack_alloc_ptr, 0); #endif /* CONFIG_STACK_COLORATION */ + + return; } - /* Initialize the initial exception register context structure */ + /* Initialize the context registers to stack top */ - memset(xcp, 0, sizeof(struct xcptcontext)); + xcp->regs = (FAR void *)(STACK_ALIGN_DOWN( + (uint32_t)tcb->stack_base_ptr + + tcb->adj_stack_size - + XCPTCONTEXT_SIZE)); Review comment: Done -- 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