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 <p-szafonimateusz@xiaomi.com>
This commit is contained in:
p-szafonimateusz 2024-08-30 11:38:08 +02:00 committed by Xiang Xiao
parent bbea8dcefe
commit a33528fa4a

View File

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