lib: sbi: Allow ecall handlers to directly update register state

Some of the upcoming SBI extensions (such as SSE) will directly
update register state so improve the prototype of ecall handler
to accommodate this. Further, this flexibility allows us to
push the trap redirection from sbi_ecall_handler() to the
sbi_ecall_legacy_handler().

Signed-off-by: Anup Patel <apatel@ventanamicro.com>
This commit is contained in:
Anup Patel
2023-12-11 20:59:14 +05:30
committed by Anup Patel
parent cdebae2cc9
commit 3284bea833
19 changed files with 109 additions and 107 deletions

View File

@@ -6,9 +6,8 @@
#include <sbi/sbi_system.h>
static int sbi_ecall_susp_handler(unsigned long extid, unsigned long funcid,
const struct sbi_trap_regs *regs,
unsigned long *out_val,
struct sbi_trap_info *out_trap)
struct sbi_trap_regs *regs,
struct sbi_ecall_return *out)
{
int ret = SBI_ENOTSUPP;
@@ -16,7 +15,7 @@ static int sbi_ecall_susp_handler(unsigned long extid, unsigned long funcid,
ret = sbi_system_suspend(regs->a0, regs->a1, regs->a2);
if (ret >= 0) {
*out_val = ret;
out->value = ret;
ret = 0;
}