summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorAnup Patel <anup.patel@wdc.com>2020-03-19 19:25:12 +0300
committerAnup Patel <anup@brainfault.org>2020-03-28 11:02:20 +0300
commit7487116b41e6c06d3903b600a2231d2a68d0c4a4 (patch)
tree1ed0174c5271e57a4554d8bdd6ffea16cbe60b2a /include
parentfe37d7da29f67ae8ccc31f06e0f3e6c9a6b58054 (diff)
downloadopensbi-7487116b41e6c06d3903b600a2231d2a68d0c4a4.tar.xz
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>
Diffstat (limited to 'include')
-rw-r--r--include/sbi/sbi_ecall.h10
-rw-r--r--include/sbi/sbi_hsm.h2
2 files changed, 5 insertions, 7 deletions
diff --git a/include/sbi/sbi_ecall.h b/include/sbi/sbi_ecall.h
index 1b56496..0b92e67 100644
--- a/include/sbi/sbi_ecall.h
+++ b/include/sbi/sbi_ecall.h
@@ -19,16 +19,13 @@
struct sbi_trap_regs;
struct sbi_trap_info;
-struct sbi_scratch;
struct sbi_ecall_extension {
struct sbi_dlist head;
unsigned long extid_start;
unsigned long extid_end;
- int (* probe)(struct sbi_scratch *scratch,
- unsigned long extid, unsigned long *out_val);
- int (* handle)(struct sbi_scratch *scratch,
- unsigned long extid, unsigned long funcid,
+ int (* probe)(unsigned long extid, unsigned long *out_val);
+ int (* handle)(unsigned long extid, unsigned long funcid,
unsigned long *args, unsigned long *out_val,
struct sbi_trap_info *out_trap);
};
@@ -51,8 +48,7 @@ int sbi_ecall_register_extension(struct sbi_ecall_extension *ext);
void sbi_ecall_unregister_extension(struct sbi_ecall_extension *ext);
-int sbi_ecall_handler(u32 hartid, ulong mcause, struct sbi_trap_regs *regs,
- struct sbi_scratch *scratch);
+int sbi_ecall_handler(struct sbi_trap_regs *regs);
int sbi_ecall_init(void);
diff --git a/include/sbi/sbi_hsm.h b/include/sbi/sbi_hsm.h
index f2f39ba..57d41ff 100644
--- a/include/sbi/sbi_hsm.h
+++ b/include/sbi/sbi_hsm.h
@@ -19,6 +19,8 @@
#define SBI_HART_STARTED 3
#define SBI_HART_UNKNOWN 4
+struct sbi_scratch;
+
int sbi_hsm_init(struct sbi_scratch *scratch, u32 hartid, bool cold_boot);
void __noreturn sbi_hsm_exit(struct sbi_scratch *scratch);