diff --git a/arch/risc-v/src/common/riscv_macros.S b/arch/risc-v/src/common/riscv_macros.S index 78068b482ffb8..2a166571567cd 100644 --- a/arch/risc-v/src/common/riscv_macros.S +++ b/arch/risc-v/src/common/riscv_macros.S @@ -390,7 +390,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 */