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:
Clément Léger 2025-05-23 12:19:20 +02:00 committed by Palmer Dabbelt
parent a7cd450f0e
commit 99cf5b7c73
No known key found for this signature in database
GPG Key ID: 2E1319F35FBB1889

View File

@ -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: