Skip to content

Commit

Permalink
riscv: poison SBI calls for M-mode
Browse files Browse the repository at this point in the history
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 <hch@lst.de>
Reviewed-by: Anup Patel <anup@brainfault.org>
Signed-off-by: Paul Walmsley <paul.walmsley@sifive.com>
  • Loading branch information
Christoph Hellwig authored and Paul Walmsley committed Nov 13, 2019
1 parent eded8bc commit 3b03ac6
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions arch/riscv/include/asm/sbi.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

#include <linux/types.h>

#ifdef CONFIG_RISCV_SBI
#define SBI_SET_TIMER 0
#define SBI_CONSOLE_PUTCHAR 1
#define SBI_CONSOLE_GETCHAR 2
Expand Down Expand Up @@ -93,5 +94,5 @@ static inline void sbi_remote_sfence_vma_asid(const unsigned long *hart_mask,
{
SBI_CALL_4(SBI_REMOTE_SFENCE_VMA_ASID, hart_mask, start, size, asid);
}

#endif
#endif /* CONFIG_RISCV_SBI */
#endif /* _ASM_RISCV_SBI_H */

0 comments on commit 3b03ac6

Please sign in to comment.