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 2021/06/08 17:22:43 UTC

[GitHub] [incubator-nuttx] patacongo commented on a change in pull request #3871: arch: adjust idle stack offset to reserve space of stack info

patacongo commented on a change in pull request #3871:
URL: https://github.com/apache/incubator-nuttx/pull/3871#discussion_r647645024



##########
File path: arch/arm/src/armv7-m/arm_initialstate.c
##########
@@ -65,8 +66,9 @@ void up_initial_state(struct tcb_s *tcb)
     {
       tcb->stack_alloc_ptr = (void *)(g_idle_topstack -
                                       CONFIG_IDLETHREAD_STACKSIZE);
-      tcb->stack_base_ptr   = tcb->stack_alloc_ptr;
-      tcb->adj_stack_size  = CONFIG_IDLETHREAD_STACKSIZE;
+      tcb->stack_base_ptr  = tcb->stack_alloc_ptr;
+      tcb->adj_stack_size  = CONFIG_IDLETHREAD_STACKSIZE -
+                             sizeof(struct task_info_s);

Review comment:
       1. Shouldn't the task info be initialized to zero?
   
       memset(tcb->stack_alloc_ptr, 0, sizeof(sizeof(struct task_info_s));
   
   2. This does not work in SMP mode.  There are multiple IDLE tasks and they do not all have pid == 0
   
   Same comments on all similar changes.




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