From 82cd9b0a4a158c88f2427e0b6bbcfde04323c5d2 Mon Sep 17 00:00:00 2001 From: Masayuki Ishikawa Date: Fri, 15 Jul 2022 13:16:04 +0900 Subject: [PATCH] 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 --- 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);