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

ligd pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git


The following commit(s) were added to refs/heads/master by this push:
     new f81c7dbc93 arch/x86_64:Use the checkstack function
f81c7dbc93 is described below

commit f81c7dbc931ddde13a98ebacce9467edf887aa8d
Author: liwenxiang1 <[email protected]>
AuthorDate: Thu Oct 10 10:13:34 2024 +0800

    arch/x86_64:Use the checkstack function
    
    Signed-off-by: liwenxiang1 <[email protected]>
---
 arch/x86_64/src/intel64/intel64_createstack.c | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/arch/x86_64/src/intel64/intel64_createstack.c 
b/arch/x86_64/src/intel64/intel64_createstack.c
index f1c05da1fd..e218d3bcde 100644
--- a/arch/x86_64/src/intel64/intel64_createstack.c
+++ b/arch/x86_64/src/intel64/intel64_createstack.c
@@ -173,15 +173,6 @@ int up_create_stack(struct tcb_s *tcb, size_t stack_size, 
uint8_t ttype)
       uintptr_t top_of_stack;
       size_t size_of_stack;
 
-      /* Yes.. If stack debug is enabled, then fill the stack with a
-       * recognizable value that we can use later to test for high
-       * water marks.
-       */
-
-#ifdef CONFIG_STACK_COLORATION
-      memset(tcb->stack_alloc_ptr, 0xaa, stack_size);
-#endif
-
       /* The x86_64 uses a push-down stack:  the stack grows toward lower
        * addresses in memory.  The stack pointer register, points to the
        * lowest, valid work address (the "top" of the stack).  Items on
@@ -206,6 +197,15 @@ int up_create_stack(struct tcb_s *tcb, size_t stack_size, 
uint8_t ttype)
       tcb->adj_stack_size = size_of_stack;
       tcb->flags |= TCB_FLAG_FREE_STACK;
 
+      /* Yes.. If stack debug is enabled, then fill the stack with a
+       * recognizable value that we can use later to test for high
+       * water marks.
+       */
+
+#ifdef CONFIG_STACK_COLORATION
+      x86_64_stack_color(tcb->stack_base_ptr, tcb->adj_stack_size);
+#endif
+
       board_autoled_on(LED_STACKCREATED);
       return OK;
     }

Reply via email to