Skip to content

Commit 3b03ac6

Browse files
Christoph Hellwigpaul-walmsley-sifive
authored andcommitted
riscv: poison SBI calls for M-mode
There is no SBI when we run in M-mode, so fail the compile for any code trying to use SBI calls. Signed-off-by: Christoph Hellwig <[email protected]> Reviewed-by: Anup Patel <[email protected]> Signed-off-by: Paul Walmsley <[email protected]>
1 parent eded8bc commit 3b03ac6

File tree

1 file changed

+3
-2
lines changed
  • arch/riscv/include/asm

1 file changed

+3
-2
lines changed

arch/riscv/include/asm/sbi.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
#include <linux/types.h>
1010

11+
#ifdef CONFIG_RISCV_SBI
1112
#define SBI_SET_TIMER 0
1213
#define SBI_CONSOLE_PUTCHAR 1
1314
#define SBI_CONSOLE_GETCHAR 2
@@ -93,5 +94,5 @@ static inline void sbi_remote_sfence_vma_asid(const unsigned long *hart_mask,
9394
{
9495
SBI_CALL_4(SBI_REMOTE_SFENCE_VMA_ASID, hart_mask, start, size, asid);
9596
}
96-
97-
#endif
97+
#endif /* CONFIG_RISCV_SBI */
98+
#endif /* _ASM_RISCV_SBI_H */

0 commit comments

Comments
 (0)