aboutsummaryrefslogtreecommitdiff
path: root/platform
diff options
context:
space:
mode:
authorAnup Patel <anup.patel@wdc.com>2020-12-28 18:25:18 +0530
committerAnup Patel <anup@brainfault.org>2021-01-07 09:53:14 +0530
commit80bc5065bb67f9d118b83f64cbe96f2e3e1bc0c6 (patch)
tree034b077172404c2a0b991bb63158af916f9cfea7 /platform
parent7dcb1e1753e9c5daec0580779ea8c31778bff152 (diff)
downloadopensbi-80bc5065bb67f9d118b83f64cbe96f2e3e1bc0c6.zip
opensbi-80bc5065bb67f9d118b83f64cbe96f2e3e1bc0c6.tar.gz
opensbi-80bc5065bb67f9d118b83f64cbe96f2e3e1bc0c6.tar.bz2
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 'platform')
-rw-r--r--platform/andes/ae350/platform.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/platform/andes/ae350/platform.c b/platform/andes/ae350/platform.c
index 6d6ce4e..aec91cd 100644
--- a/platform/andes/ae350/platform.c
+++ b/platform/andes/ae350/platform.c
@@ -13,6 +13,7 @@
#include <sbi/sbi_console.h>
#include <sbi/sbi_const.h>
#include <sbi/sbi_platform.h>
+#include <sbi/sbi_trap.h>
#include <sbi_utils/fdt/fdt_fixup.h>
#include <sbi_utils/irqchip/plic.h>
#include <sbi_utils/serial/uart8250.h>
@@ -116,7 +117,7 @@ static int ae350_timer_init(bool cold_boot)
/* Vendor-Specific SBI handler */
static int ae350_vendor_ext_provider(long extid, long funcid,
- unsigned long *args, unsigned long *out_value,
+ const struct sbi_trap_regs *regs, unsigned long *out_value,
struct sbi_trap_info *out_trap)
{
int ret = 0;
@@ -128,28 +129,28 @@ static int ae350_vendor_ext_provider(long extid, long funcid,
*out_value = csr_read(CSR_MMISCCTL);
break;
case SBI_EXT_ANDES_SET_MCACHE_CTL:
- ret = mcall_set_mcache_ctl(args[0]);
+ ret = mcall_set_mcache_ctl(regs->a0);
break;
case SBI_EXT_ANDES_SET_MMISC_CTL:
- ret = mcall_set_mmisc_ctl(args[0]);
+ ret = mcall_set_mmisc_ctl(regs->a0);
break;
case SBI_EXT_ANDES_ICACHE_OP:
- ret = mcall_icache_op(args[0]);
+ ret = mcall_icache_op(regs->a0);
break;
case SBI_EXT_ANDES_DCACHE_OP:
- ret = mcall_dcache_op(args[0]);
+ ret = mcall_dcache_op(regs->a0);
break;
case SBI_EXT_ANDES_L1CACHE_I_PREFETCH:
- ret = mcall_l1_cache_i_prefetch_op(args[0]);
+ ret = mcall_l1_cache_i_prefetch_op(regs->a0);
break;
case SBI_EXT_ANDES_L1CACHE_D_PREFETCH:
- ret = mcall_l1_cache_d_prefetch_op(args[0]);
+ ret = mcall_l1_cache_d_prefetch_op(regs->a0);
break;
case SBI_EXT_ANDES_NON_BLOCKING_LOAD_STORE:
- ret = mcall_non_blocking_load_store(args[0]);
+ ret = mcall_non_blocking_load_store(regs->a0);
break;
case SBI_EXT_ANDES_WRITE_AROUND:
- ret = mcall_write_around(args[0]);
+ ret = mcall_write_around(regs->a0);
break;
default:
sbi_printf("Unsupported vendor sbi call : %ld\n", funcid);