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 6b8d0c6a16
commit ed4acb20cc
1 changed files with 2 additions and 1 deletions

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 */ /* 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->adj_stack_size = stack_size - 8;
tcb->stack_alloc_ptr = (void *)stack_alloc; tcb->stack_alloc_ptr = (void *)stack_alloc;
tcb->stack_base_ptr = tcb->stack_alloc_ptr; tcb->stack_base_ptr = tcb->stack_alloc_ptr;