From 1b3c8d64020f835823aedc1c4d293e34a78bd1b8 Mon Sep 17 00:00:00 2001 From: Bin Meng Date: Mon, 9 Mar 2020 19:35:30 -0700 Subject: riscv: Introduce a new config for SBI v0.1 We now have SBI v0.2 which is more scalable and extendable to handle future needs for RISC-V supervisor interfaces. Introduce a new config and move all SBI v0.1 code under that config. This allows to implement the new replacement SBI extensions cleanly and remove v0.1 extensions easily in future. Currently, the config is enabled by default. Once all M-mode software, with v0.1, is no longer in use, this config option and all relevant code can be easily removed. This commit is inspired from Linux kernel patch: https://patchwork.kernel.org/patch/11407361/ Signed-off-by: Bin Meng Reviewed-by: Pragnesh Patel --- arch/riscv/lib/sbi.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'arch/riscv/lib/sbi.c') diff --git a/arch/riscv/lib/sbi.c b/arch/riscv/lib/sbi.c index 4b6a9e0..604a3a8 100644 --- a/arch/riscv/lib/sbi.c +++ b/arch/riscv/lib/sbi.c @@ -39,6 +39,8 @@ struct sbiret sbi_ecall(int ext, int fid, unsigned long arg0, return ret; } +#ifdef CONFIG_SBI_V01 + /** * sbi_console_putchar() - Writes given character to the console device. * @ch: The data to be written to the console. @@ -84,6 +86,8 @@ void sbi_shutdown(void) sbi_ecall(SBI_EXT_0_1_SHUTDOWN, 0, 0, 0, 0, 0, 0, 0); } +#endif /* CONFIG_SBI_V01 */ + /** * sbi_set_timer() - Program the timer for next timer event. * @stime_value: The value after which next timer event should fire. -- cgit v1.1