pkarashchenko commented on a change in pull request #5645:
URL: https://github.com/apache/incubator-nuttx/pull/5645#discussion_r825472321



##########
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:
       ```suggestion
     xcp->regs = (FAR void *)STACK_ALIGN_DOWN(
                              (uint32_t)tcb->stack_base_ptr +
                                        tcb->adj_stack_size -
                                        XCPTCONTEXT_SIZE);
   ```




-- 
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


Reply via email to