You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2020/12/14 22:57:31 UTC

[GitHub] [incubator-nuttx] masayuki2009 commented on a change in pull request #2077: Fix the stack color failure when the thread stack setup through up_use_stack

masayuki2009 commented on a change in pull request #2077:
URL: https://github.com/apache/incubator-nuttx/pull/2077#discussion_r542902265



##########
File path: arch/arm/src/arm/arm_initialstate.c
##########
@@ -75,8 +75,10 @@ void up_initial_state(struct tcb_s *tcb)
 
   if (tcb->pid == 0)
     {
-      up_use_stack(tcb, (void *)(g_idle_topstack -
-        CONFIG_IDLETHREAD_STACKSIZE), CONFIG_IDLETHREAD_STACKSIZE);
+      tcb->stack_alloc_ptr = (void *)(g_idle_topstack -
+                                      CONFIG_IDLETHREAD_STACKSIZE);
+      tcb->adj_stack_ptr   = (void *)g_idle_topstack;
+      tcb->adj_stack_size  = CONFIG_IDLETHREAD_STACKSIZE;
     }

Review comment:
       @xiaoxiang781216 
   
   I think we should add such special logic for pid=0 case to up_use_stack().
   It would reduce maintenance costs.
   
   What do you think?
   




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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org