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

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

commit 82cd9b0a4a158c88f2427e0b6bbcfde04323c5d2
Author: Masayuki Ishikawa <[email protected]>
AuthorDate: Fri Jul 15 13:16:04 2022 +0900

    arch: arm64: Add stack coloration for SMP
    
    Summary:
    - This commit adds stack coloration for SMP
    
    Impact:
    - None
    
    Testing:
    - Tested with qemu-a53:nsh_smp
    
    Signed-off-by: Masayuki Ishikawa <[email protected]>
---
 arch/arm64/src/common/arm64_cpustart.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/arch/arm64/src/common/arm64_cpustart.c 
b/arch/arm64/src/common/arm64_cpustart.c
index 12b2b73492..0748813f8f 100644
--- a/arch/arm64/src/common/arm64_cpustart.c
+++ b/arch/arm64/src/common/arm64_cpustart.c
@@ -212,6 +212,15 @@ int up_cpu_start(int cpu)
   sched_note_cpu_start(this_task(), cpu);
 #endif
 
+#ifdef CONFIG_STACK_COLORATION
+  /* If stack debug is enabled, then fill the stack with a
+   * recognizable value that we can use later to test for high
+   * water marks.
+   */
+
+  arm64_stack_color(g_cpu_idlestackalloc[cpu], SMP_STACK_SIZE);
+#endif
+
   cpu_ready_flag = 0;
   arm64_start_cpu(cpu, (char *)g_cpu_idlestackalloc[cpu], SMP_STACK_SIZE,
                   arm64_smp_init_top);

Reply via email to