summaryrefslogtreecommitdiff
path: root/lib/sbi/sbi_ecall.c
diff options
context:
space:
mode:
authorAnup Patel <anup.patel@wdc.com>2020-12-28 15:55:18 +0300
committerAnup Patel <anup@brainfault.org>2021-01-07 07:23:14 +0300
commit80bc5065bb67f9d118b83f64cbe96f2e3e1bc0c6 (patch)
tree034b077172404c2a0b991bb63158af916f9cfea7 /lib/sbi/sbi_ecall.c
parent7dcb1e1753e9c5daec0580779ea8c31778bff152 (diff)
downloadopensbi-80bc5065bb67f9d118b83f64cbe96f2e3e1bc0c6.tar.xz
lib: sbi: Replace args with trap registers in ecall handler
We had added args pointer in ecall handler to ensure that ecall handler only implements functionality and does not deal with SBI calling convention. This also helped us to keep SBI calling convention related code in one place at sbi_ecall_handler(). The Keystone Enclavce project needs access to the trap regsiters in their ecall handler so that they can context switch enclaves in custom SBI calls. To help the Keystone Enclave project, we replace the args pointer in ecall handler parameter with a const pointer to trap registers. Signed-off-by: Anup Patel <anup.patel@wdc.com> Reviewed-by: Atish Patra <atish.patra@wdc.com>
Diffstat (limited to 'lib/sbi/sbi_ecall.c')
-rw-r--r--lib/sbi/sbi_ecall.c10
1 files changed, 1 insertions, 9 deletions
diff --git a/lib/sbi/sbi_ecall.c b/lib/sbi/sbi_ecall.c
index 6d41cff..e92a539 100644
--- a/lib/sbi/sbi_ecall.c
+++ b/lib/sbi/sbi_ecall.c
@@ -101,19 +101,11 @@ int sbi_ecall_handler(struct sbi_trap_regs *regs)
struct sbi_trap_info trap = {0};
unsigned long out_val = 0;
bool is_0_1_spec = 0;
- unsigned long args[6];
-
- args[0] = regs->a0;
- args[1] = regs->a1;
- args[2] = regs->a2;
- args[3] = regs->a3;
- args[4] = regs->a4;
- args[5] = regs->a5;
ext = sbi_ecall_find_extension(extension_id);
if (ext && ext->handle) {
ret = ext->handle(extension_id, func_id,
- args, &out_val, &trap);
+ regs, &out_val, &trap);
if (extension_id >= SBI_EXT_0_1_SET_TIMER &&
extension_id <= SBI_EXT_0_1_SHUTDOWN)
is_0_1_spec = 1;