lib: Return ENOTSUPP incase of invalid SBI function ID
authorAtish Patra <atish.patra@wdc.com>
Wed, 13 Mar 2019 18:08:31 +0000 (11:08 -0700)
committerAnup Patel <anup@brainfault.org>
Thu, 14 Mar 2019 15:14:22 +0000 (20:44 +0530)
OpenSBI should show error trace only if any valid SBI function
does not perform as expected.

However, OpenSBI should show notify the caller with a negative
error if given SBI function ID is not valid.

Signed-off-by: Atish Patra <atish.patra@wdc.com>
lib/sbi_ecall.c

index 6312469..94c6e77 100644 (file)
@@ -86,6 +86,8 @@ int sbi_ecall_handler(u32 hartid, ulong mcause,
                ret = 0;
                break;
        default:
+               regs->a0 = SBI_ENOTSUPP;
+               ret = 0;
                break;
        };