From c1c7c3ee9eb70e5c25914621f0363bfe244ebc79 Mon Sep 17 00:00:00 2001 From: Anup Patel Date: Fri, 4 Sep 2020 16:39:49 +0530 Subject: [PATCH] lib: sbi_trap: Allow M-mode to M-mode ECALLs We should allow M-mode to M-mode ECALLs because: 1. No other mode can handle M-mode ECALLs 2. In future, we can allow M-mode baremetal application (not linked to OpenSBI) running independently and cooperatively without corrupting OpenSBI M-mode state (CSRs and memory). Signed-off-by: Anup Patel Reviewed-by: Atish Patra --- lib/sbi/sbi_trap.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/sbi/sbi_trap.c b/lib/sbi/sbi_trap.c index b8bb20cc..db5aa2fa 100644 --- a/lib/sbi/sbi_trap.c +++ b/lib/sbi/sbi_trap.c @@ -252,6 +252,7 @@ void sbi_trap_handler(struct sbi_trap_regs *regs) msg = "misaligned store handler failed"; break; case CAUSE_SUPERVISOR_ECALL: + case CAUSE_MACHINE_ECALL: rc = sbi_ecall_handler(regs); msg = "ecall handler failed"; break;