lib: sbi_ecall: Remove mcause, scratch and hartid parameters

We remove mcause, scratch and hartid parameters from various
functions for ecall handling because we can always get current
HART id and current scratch pointer using just one CSR access.

Signed-off-by: Anup Patel <anup.patel@wdc.com>
Reviewed-by: Atish Patra <atish.patra@wdc.com>
This commit is contained in:
Anup Patel authored and Anup Patel committed 2020-03-28 13:32:20 +05:30
1 parent fe37d7da29
commit 7487116b41
9 files changed
+33 -39

No files matched your search

+4 -7
View File
@@ -14,9 +14,7 @@
#include <sbi/sbi_version.h>
#include <sbi/riscv_asm.h>
static int sbi_ecall_base_probe(struct sbi_scratch *scratch,
unsigned long extid,
unsigned long *out_val)
static int sbi_ecall_base_probe(unsigned long extid, unsigned long *out_val)
{
struct sbi_ecall_extension *ext;
@@ -27,14 +25,13 @@ static int sbi_ecall_base_probe(struct sbi_scratch *scratch,
}
if (ext->probe)
return ext->probe(scratch, extid, out_val);
return ext->probe(extid, out_val);
*out_val = 1;
return 0;
}
static int sbi_ecall_base_handler(struct sbi_scratch *scratch,
unsigned long extid, unsigned long funcid,
static int sbi_ecall_base_handler(unsigned long extid, unsigned long funcid,
unsigned long *args, unsigned long *out_val,
struct sbi_trap_info *out_trap)
{
@@ -64,7 +61,7 @@ static int sbi_ecall_base_handler(struct sbi_scratch *scratch,
*out_val = csr_read(CSR_MIMPID);
break;
case SBI_EXT_BASE_PROBE_EXT:
ret = sbi_ecall_base_probe(scratch, args[0], out_val);
ret = sbi_ecall_base_probe(args[0], out_val);
break;
default:
ret = SBI_ENOTSUPP;