mirror of
https://github.com/torvalds/linux.git
synced 2026-05-23 14:42:08 +02:00
riscv: sbi: add new SBI error mappings
A few new errors have been added with SBI V3.0, maps them as close as possible to errno values. Signed-off-by: Clément Léger <cleger@rivosinc.com> Reviewed-by: Andrew Jones <ajones@ventanamicro.com> Reviewed-by: Atish Patra <atishp@rivosinc.com> Link: https://lore.kernel.org/r/20250523101932.1594077-4-cleger@rivosinc.com Signed-off-by: Palmer Dabbelt <palmer@dabbelt.com>
This commit is contained in:
parent
a7cd450f0e
commit
99cf5b7c73
|
|
@ -536,11 +536,21 @@ static inline int sbi_err_map_linux_errno(int err)
|
|||
case SBI_SUCCESS:
|
||||
return 0;
|
||||
case SBI_ERR_DENIED:
|
||||
case SBI_ERR_DENIED_LOCKED:
|
||||
return -EPERM;
|
||||
case SBI_ERR_INVALID_PARAM:
|
||||
case SBI_ERR_INVALID_STATE:
|
||||
return -EINVAL;
|
||||
case SBI_ERR_BAD_RANGE:
|
||||
return -ERANGE;
|
||||
case SBI_ERR_INVALID_ADDRESS:
|
||||
return -EFAULT;
|
||||
case SBI_ERR_NO_SHMEM:
|
||||
return -ENOMEM;
|
||||
case SBI_ERR_TIMEOUT:
|
||||
return -ETIMEDOUT;
|
||||
case SBI_ERR_IO:
|
||||
return -EIO;
|
||||
case SBI_ERR_NOT_SUPPORTED:
|
||||
case SBI_ERR_FAILURE:
|
||||
default:
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user