From a7bca63b3b71edf8252ba45e99413c36d1c96c67 Mon Sep 17 00:00:00 2001 From: Masayuki Ishikawa Date: Wed, 5 Oct 2022 15:57:50 +0900 Subject: [PATCH] arch: qemu-rv: Fix build errors in chip.h for BUILD_KERNEL + SMP Summary: - This commit fixes build errors for BUILD_KERNEL + SMP Impact: - None Testing: - Tested with rv-virt:ksmp64 (will be added later) Signed-off-by: Masayuki Ishikawa --- arch/risc-v/src/qemu-rv/chip.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/arch/risc-v/src/qemu-rv/chip.h b/arch/risc-v/src/qemu-rv/chip.h index f8f78fbe516..7cf74cd6adf 100644 --- a/arch/risc-v/src/qemu-rv/chip.h +++ b/arch/risc-v/src/qemu-rv/chip.h @@ -66,7 +66,7 @@ extern void up_serialinit(void); #if defined(CONFIG_SMP) && CONFIG_ARCH_INTERRUPTSTACK > 15 .macro setintstack tmp0, tmp1 - csrr \tmp0, mhartid + riscv_mhartid \tmp0 li \tmp1, STACK_ALIGN_DOWN(CONFIG_ARCH_INTERRUPTSTACK) mul \tmp1, \tmp0, \tmp1 la \tmp0, g_intstacktop @@ -74,12 +74,14 @@ extern void up_serialinit(void); .endm #endif /* CONFIG_SMP && CONFIG_ARCH_INTERRUPTSTACK > 15 */ -#if defined(CONFIG_ARCH_USE_S_MODE) && CONFIG_ARCH_INTERRUPTSTACK > 15 +#if CONFIG_ARCH_INTERRUPTSTACK > 15 +#if !defined(CONFIG_SMP) && defined(CONFIG_ARCH_USE_S_MODE) .macro setintstack tmp0, tmp1 csrr \tmp0, CSR_SCRATCH REGLOAD sp, RISCV_PERCPU_IRQSTACK(\tmp0) .endm -#endif /* CONFIG_ARCH_USE_S_MODE && CONFIG_ARCH_INTERRUPTSTACK > 15 */ +#endif /* !defined(CONFIG_SMP) && defined(CONFIG_ARCH_USE_S_MODE) */ +#endif /* CONFIG_ARCH_INTERRUPTSTACK > 15 */ #endif /* __ASSEMBLY__ */ #endif /* __ARCH_RISCV_SRC_QEMU_RV_CHIP_H */