From 6e6eecaa73a0dae359447add6671345365601549 Mon Sep 17 00:00:00 2001 From: "chao.an" Date: Wed, 9 Jun 2021 22:53:30 +0800 Subject: [PATCH] arch: adjust idle stack offset to reserve space of stack info Signed-off-by: chao.an --- 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 fc184e5e0de..4bcb7125b00 100644 --- a/sched/init/nx_smpstart.c +++ b/sched/init/nx_smpstart.c @@ -34,6 +34,7 @@ #include #include #include +#include #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 74f0c06230f..aa6867a37c1 100644 --- a/sched/init/nx_start.c +++ b/sched/init/nx_start.c @@ -44,6 +44,7 @@ #include #include #include +#include #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)); } }