Skip to content

Commit f90b43c

Browse files
atishp04palmer-dabbelt
authored andcommitted
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: Atish Patra <[email protected]> Reviewed-by: Anup Patel <[email protected]> Signed-off-by: Palmer Dabbelt <[email protected]>
1 parent 2875fe0 commit f90b43c

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

arch/riscv/include/asm/sbi.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,8 @@ static inline unsigned long sbi_minor_version(void)
130130
{
131131
return sbi_spec_version & SBI_SPEC_VERSION_MINOR_MASK;
132132
}
133+
134+
int sbi_err_map_linux_errno(int err);
133135
#else /* CONFIG_RISCV_SBI */
134136
/* stubs for code that is only reachable under IS_ENABLED(CONFIG_RISCV_SBI): */
135137
void sbi_set_timer(uint64_t stime_value);

arch/riscv/kernel/sbi.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ struct sbiret sbi_ecall(int ext, int fid, unsigned long arg0,
4646
}
4747
EXPORT_SYMBOL(sbi_ecall);
4848

49-
static int sbi_err_map_linux_errno(int err)
49+
int sbi_err_map_linux_errno(int err)
5050
{
5151
switch (err) {
5252
case SBI_SUCCESS:
@@ -63,6 +63,7 @@ static int sbi_err_map_linux_errno(int err)
6363
return -ENOTSUPP;
6464
};
6565
}
66+
EXPORT_SYMBOL(sbi_err_map_linux_errno);
6667

6768
#ifdef CONFIG_RISCV_SBI_V01
6869
/**

0 commit comments

Comments
 (0)