Commit f90b43ce authored by Atish Patra's avatar Atish Patra Committed by Palmer Dabbelt

RISC-V: Export SBI error to linux error mapping function

All SBI related extensions will not be implemented in sbi.c to avoid
bloating. Thus, sbi_err_map_linux_errno() will be used in other files
implementing that specific extension.

Export the function so that it can be used later.
Signed-off-by: default avatarAtish Patra <atish.patra@wdc.com>
Reviewed-by: default avatarAnup Patel <anup.patel@wdc.com>
Signed-off-by: default avatarPalmer Dabbelt <palmerdabbelt@google.com>
parent 2875fe05
...@@ -130,6 +130,8 @@ static inline unsigned long sbi_minor_version(void) ...@@ -130,6 +130,8 @@ static inline unsigned long sbi_minor_version(void)
{ {
return sbi_spec_version & SBI_SPEC_VERSION_MINOR_MASK; return sbi_spec_version & SBI_SPEC_VERSION_MINOR_MASK;
} }
int sbi_err_map_linux_errno(int err);
#else /* CONFIG_RISCV_SBI */ #else /* CONFIG_RISCV_SBI */
/* stubs for code that is only reachable under IS_ENABLED(CONFIG_RISCV_SBI): */ /* stubs for code that is only reachable under IS_ENABLED(CONFIG_RISCV_SBI): */
void sbi_set_timer(uint64_t stime_value); void sbi_set_timer(uint64_t stime_value);
......
...@@ -46,7 +46,7 @@ struct sbiret sbi_ecall(int ext, int fid, unsigned long arg0, ...@@ -46,7 +46,7 @@ struct sbiret sbi_ecall(int ext, int fid, unsigned long arg0,
} }
EXPORT_SYMBOL(sbi_ecall); EXPORT_SYMBOL(sbi_ecall);
static int sbi_err_map_linux_errno(int err) int sbi_err_map_linux_errno(int err)
{ {
switch (err) { switch (err) {
case SBI_SUCCESS: case SBI_SUCCESS:
...@@ -63,6 +63,7 @@ static int sbi_err_map_linux_errno(int err) ...@@ -63,6 +63,7 @@ static int sbi_err_map_linux_errno(int err)
return -ENOTSUPP; return -ENOTSUPP;
}; };
} }
EXPORT_SYMBOL(sbi_err_map_linux_errno);
#ifdef CONFIG_RISCV_SBI_V01 #ifdef CONFIG_RISCV_SBI_V01
/** /**
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment