From 1fc01a4393b3a863f459c2e643f5883cd431cb74 Mon Sep 17 00:00:00 2001 From: Gedare Bloom Date: Wed, 1 Apr 2026 11:39:16 -0600 Subject: [PATCH] bsps/riscv/start: relocate Lstart_on_secondary_processor Fixes #5542 --- bsps/riscv/shared/start/start.S | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/bsps/riscv/shared/start/start.S b/bsps/riscv/shared/start/start.S index 29a2d3a3af..912a4967bc 100644 --- a/bsps/riscv/shared/start/start.S +++ b/bsps/riscv/shared/start/start.S @@ -196,10 +196,11 @@ RISCV_Start_on_processor: #else csrw mscratch, t3 #endif + /* boot hartid returns to _start, others wait to be released */ + bnez a0, .Lstart_on_secondary_processor #else /* RTEMS_SMP */ LADDR sp, _ISR_Stack_area_end #endif - bnez a0, .Lstart_on_secondary_processor ret .Lwfi: @@ -209,7 +210,7 @@ RISCV_Start_on_processor: #ifdef RTEMS_SMP .Lstart_on_secondary_processor: - /* Wait for go issued by the boot processor (mhartid == 0) */ + /* Wait for boot processor (mhartid == RISCV_BOOT_HARTID) to go */ LADDR t0, .Lsecondary_processor_go .Lwait_for_go_again: