Skip to content

Commit 99cf5b7

Browse files
clementlegerpalmer-dabbelt
authored andcommitted
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 <[email protected]> Reviewed-by: Andrew Jones <[email protected]> Reviewed-by: Atish Patra <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Palmer Dabbelt <[email protected]>
1 parent a7cd450 commit 99cf5b7

File tree

1 file changed

+10
-0
lines changed
  • arch/riscv/include/asm

1 file changed

+10
-0
lines changed

arch/riscv/include/asm/sbi.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -536,11 +536,21 @@ static inline int sbi_err_map_linux_errno(int err)
536536
case SBI_SUCCESS:
537537
return 0;
538538
case SBI_ERR_DENIED:
539+
case SBI_ERR_DENIED_LOCKED:
539540
return -EPERM;
540541
case SBI_ERR_INVALID_PARAM:
542+
case SBI_ERR_INVALID_STATE:
541543
return -EINVAL;
544+
case SBI_ERR_BAD_RANGE:
545+
return -ERANGE;
542546
case SBI_ERR_INVALID_ADDRESS:
543547
return -EFAULT;
548+
case SBI_ERR_NO_SHMEM:
549+
return -ENOMEM;
550+
case SBI_ERR_TIMEOUT:
551+
return -ETIMEDOUT;
552+
case SBI_ERR_IO:
553+
return -EIO;
544554
case SBI_ERR_NOT_SUPPORTED:
545555
case SBI_ERR_FAILURE:
546556
default:

0 commit comments

Comments
 (0)