diff options
author | Anup Patel <anup.patel@wdc.com> | 2020-01-17 16:42:52 +0300 |
---|---|---|
committer | Anup Patel <anup@brainfault.org> | 2020-01-22 09:43:44 +0300 |
commit | 43ac621ecba8d472a5e697527143f9d3317df3e1 (patch) | |
tree | 1100619a411f0c0069f56ec423cdef38ce17edea /lib/sbi/sbi_ecall.c | |
parent | 161b348e7e8ae3f78e8523e67796d277288e3f7c (diff) | |
download | opensbi-43ac621ecba8d472a5e697527143f9d3317df3e1.tar.xz |
lib: Factor-out SBI vendor extension
This patch factor-out SBI vendor extension into its own source
for better modularity of SBI implementation.
Signed-off-by: Anup Patel <anup.patel@wdc.com>
Reviewed-by: Atish Patra <atish.patra@wdc.com>
Diffstat (limited to 'lib/sbi/sbi_ecall.c')
-rw-r--r-- | lib/sbi/sbi_ecall.c | 29 |
1 files changed, 2 insertions, 27 deletions
diff --git a/lib/sbi/sbi_ecall.c b/lib/sbi/sbi_ecall.c index d817fef..d34bc49 100644 --- a/lib/sbi/sbi_ecall.c +++ b/lib/sbi/sbi_ecall.c @@ -10,8 +10,9 @@ #include <sbi/sbi_ecall.h> #include <sbi/sbi_ecall_interface.h> #include <sbi/sbi_error.h> -#include <sbi/sbi_platform.h> +#include <sbi/sbi_trap.h> #include <sbi/sbi_version.h> +#include <sbi/riscv_asm.h> #define SBI_ECALL_VERSION_MAJOR 0 #define SBI_ECALL_VERSION_MINOR 2 @@ -92,32 +93,6 @@ static struct sbi_ecall_extension ecall_base = { .handle = sbi_ecall_base_handler, }; -static int sbi_ecall_vendor_probe(struct sbi_scratch *scratch, - unsigned long extid, - unsigned long *out_val) -{ - *out_val = sbi_platform_vendor_ext_check(sbi_platform_ptr(scratch), - extid); - return 0; -} - -static int sbi_ecall_vendor_handler(struct sbi_scratch *scratch, - unsigned long extid, unsigned long funcid, - unsigned long *args, unsigned long *out_val, - struct sbi_trap_info *out_trap) -{ - return sbi_platform_vendor_ext_provider(sbi_platform_ptr(scratch), - extid, funcid, args, - out_val, out_trap); -} - -static struct sbi_ecall_extension ecall_vendor = { - .extid_start = SBI_EXT_VENDOR_START, - .extid_end = SBI_EXT_VENDOR_END, - .probe = sbi_ecall_vendor_probe, - .handle = sbi_ecall_vendor_handler, -}; - static SBI_LIST_HEAD(ecall_exts_list); struct sbi_ecall_extension *sbi_ecall_find_extension(unsigned long extid) |