From ec9b5b3bca33cc6b396985315ce78254bad5097a Mon Sep 17 00:00:00 2001 From: Ville Juven Date: Fri, 11 Oct 2024 13:24:37 +0300 Subject: [PATCH] riscv_macros.S: Allow using riscv_set_inital_sp for hart > 0 In non-SMP mode there is only a single idlestack, so use that in all cases instead of offsetting by hart ID. --- arch/risc-v/src/common/riscv_macros.S | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/risc-v/src/common/riscv_macros.S b/arch/risc-v/src/common/riscv_macros.S index 03ddfe872d8ed..2e8bcb8f1387b 100644 --- a/arch/risc-v/src/common/riscv_macros.S +++ b/arch/risc-v/src/common/riscv_macros.S @@ -393,7 +393,9 @@ .macro riscv_set_inital_sp base, size, hartid la t0, \base li t1, \size +#ifdef CONFIG_SMP mul t1, \hartid, t1 +#endif add t0, t0, t1 /* ensure the last XCPTCONTEXT_SIZE is reserved for non boot CPU */