This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch releases/12.7
in repository https://gitbox.apache.org/repos/asf/nuttx.git

commit a33528fa4a5130a832c90f267ddba7363d9a3183
Author: p-szafonimateusz <[email protected]>
AuthorDate: Fri Aug 30 11:38:08 2024 +0200

    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 <[email protected]>
---
 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;

Reply via email to