From 7487116b41e6c06d3903b600a2231d2a68d0c4a4 Mon Sep 17 00:00:00 2001 From: Anup Patel Date: Thu, 19 Mar 2020 21:55:12 +0530 Subject: 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 Reviewed-by: Atish Patra --- lib/sbi/sbi_ecall_legacy.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'lib/sbi/sbi_ecall_legacy.c') diff --git a/lib/sbi/sbi_ecall_legacy.c b/lib/sbi/sbi_ecall_legacy.c index 70981e4..95f612a 100644 --- a/lib/sbi/sbi_ecall_legacy.c +++ b/lib/sbi/sbi_ecall_legacy.c @@ -15,6 +15,7 @@ #include #include #include +#include #include #include #include @@ -39,14 +40,14 @@ static int sbi_load_hart_mask_unpriv(ulong *pmask, ulong *hmask, return 0; } -static int sbi_ecall_legacy_handler(struct sbi_scratch *scratch, - unsigned long extid, unsigned long funcid, +static int sbi_ecall_legacy_handler(unsigned long extid, unsigned long funcid, unsigned long *args, unsigned long *out_val, struct sbi_trap_info *out_trap) { int ret = 0; struct sbi_tlb_info tlb_info; u32 source_hart = current_hartid(); + struct sbi_scratch *scratch = sbi_scratch_thishart_ptr(); ulong hmask = 0; switch (extid) { -- cgit v1.2.3