summaryrefslogtreecommitdiff
path: root/include
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 /include
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 'include')
-rw-r--r--include/sbi/sbi_ecall.h3
-rw-r--r--include/sbi/sbi_platform.h9
2 files changed, 7 insertions, 5 deletions
diff --git a/include/sbi/sbi_ecall.h b/include/sbi/sbi_ecall.h
index 1ef86e2..d357085 100644
--- a/include/sbi/sbi_ecall.h
+++ b/include/sbi/sbi_ecall.h
@@ -26,7 +26,8 @@ struct sbi_ecall_extension {
unsigned long extid_end;
int (* probe)(unsigned long extid, unsigned long *out_val);
int (* handle)(unsigned long extid, unsigned long funcid,
- unsigned long *args, unsigned long *out_val,
+ const struct sbi_trap_regs *regs,
+ unsigned long *out_val,
struct sbi_trap_info *out_trap);
};
diff --git a/include/sbi/sbi_platform.h b/include/sbi/sbi_platform.h
index 58aba71..7b8fe89 100644
--- a/include/sbi/sbi_platform.h
+++ b/include/sbi/sbi_platform.h
@@ -47,6 +47,7 @@
struct sbi_domain;
struct sbi_trap_info;
+struct sbi_trap_regs;
/** Possible feature flags of a platform */
enum sbi_platform_features {
@@ -146,7 +147,7 @@ struct sbi_platform_operations {
int (*vendor_ext_check)(long extid);
/** platform specific SBI extension implementation provider */
int (*vendor_ext_provider)(long extid, long funcid,
- unsigned long *args,
+ const struct sbi_trap_regs *regs,
unsigned long *out_value,
struct sbi_trap_info *out_trap);
} __packed;
@@ -710,7 +711,7 @@ static inline int sbi_platform_vendor_ext_check(const struct sbi_platform *plat,
* @param plat pointer to struct sbi_platform
* @param extid vendor SBI extension id
* @param funcid SBI function id within the extension id
- * @param args pointer to arguments passed by the caller
+ * @param regs pointer to trap registers passed by the caller
* @param out_value output value that can be filled by the callee
* @param out_trap trap info that can be filled by the callee
*
@@ -719,13 +720,13 @@ static inline int sbi_platform_vendor_ext_check(const struct sbi_platform *plat,
static inline int sbi_platform_vendor_ext_provider(
const struct sbi_platform *plat,
long extid, long funcid,
- unsigned long *args,
+ const struct sbi_trap_regs *regs,
unsigned long *out_value,
struct sbi_trap_info *out_trap)
{
if (plat && sbi_platform_ops(plat)->vendor_ext_provider) {
return sbi_platform_ops(plat)->vendor_ext_provider(extid,
- funcid, args,
+ funcid, regs,
out_value,
out_trap);
}