From ed4acb20cc133be12dc6ab9baf390813521f29ef Mon Sep 17 00:00:00 2001 From: p-szafonimateusz Date: Fri, 30 Aug 2024 11:38:08 +0200 Subject: [PATCH] arch/x86_64/intel64/intel64_cpuidlestack.c: stack_alloc should point to stack base not stack top stack_alloc should point to stack base not stack top Signed-off-by: p-szafonimateusz --- arch/x86_64/src/intel64/intel64_cpuidlestack.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/x86_64/src/intel64/intel64_cpuidlestack.c b/arch/x86_64/src/intel64/intel64_cpuidlestack.c index 05d8771b43..e9aec20395 100644 --- a/arch/x86_64/src/intel64/intel64_cpuidlestack.c +++ b/arch/x86_64/src/intel64/intel64_cpuidlestack.c @@ -88,7 +88,8 @@ int up_cpu_idlestack(int cpu, struct tcb_s *tcb, size_t stack_size) /* Get the top of the stack */ - stack_alloc = (uintptr_t)g_idle_topstack[cpu]; + stack_alloc = (uintptr_t)g_idle_topstack[cpu] - + CONFIG_IDLETHREAD_STACKSIZE; tcb->adj_stack_size = stack_size - 8; tcb->stack_alloc_ptr = (void *)stack_alloc; tcb->stack_base_ptr = tcb->stack_alloc_ptr;