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;