This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git


The following commit(s) were added to refs/heads/master by this push:
     new 6e6eeca  arch: adjust idle stack offset to reserve space of stack info
6e6eeca is described below

commit 6e6eecaa73a0dae359447add6671345365601549
Author: chao.an <[email protected]>
AuthorDate: Wed Jun 9 22:53:30 2021 +0800

    arch: adjust idle stack offset to reserve space of stack info
    
    Signed-off-by: chao.an <[email protected]>
---
 sched/init/nx_smpstart.c | 2 ++
 sched/init/nx_start.c    | 2 ++
 2 files changed, 4 insertions(+)

diff --git a/sched/init/nx_smpstart.c b/sched/init/nx_smpstart.c
index fc184e5..4bcb712 100644
--- a/sched/init/nx_smpstart.c
+++ b/sched/init/nx_smpstart.c
@@ -34,6 +34,7 @@
 #include <nuttx/kmalloc.h>
 #include <nuttx/sched.h>
 #include <nuttx/sched_note.h>
+#include <nuttx/tls.h>
 
 #include "group/group.h"
 #include "sched/sched.h"
@@ -131,6 +132,7 @@ int nx_smp_start(void)
       /* Initialize the processor-specific portion of the TCB */
 
       up_initial_state(tcb);
+      up_stack_frame(tcb, sizeof(struct task_info_s));
     }
 
   /* Then start all of the other CPUs after we have completed the memory
diff --git a/sched/init/nx_start.c b/sched/init/nx_start.c
index 74f0c06..aa6867a 100644
--- a/sched/init/nx_start.c
+++ b/sched/init/nx_start.c
@@ -44,6 +44,7 @@
 #include <nuttx/syslog/syslog.h>
 #include <nuttx/binfmt/binfmt.h>
 #include <nuttx/init.h>
+#include <nuttx/tls.h>
 
 #include "sched/sched.h"
 #include "signal/signal.h"
@@ -517,6 +518,7 @@ void nx_start(void)
       if (cpu == 0)
         {
           up_initial_state(&g_idletcb[cpu].cmn);
+          up_stack_frame(&g_idletcb[cpu].cmn, sizeof(struct task_info_s));
         }
     }
 

Reply via email to