lib: sbi: Allow ecall handlers to directly update register state
authorAnup Patel <apatel@ventanamicro.com>
Mon, 11 Dec 2023 15:29:14 +0000 (20:59 +0530)
committerAnup Patel <anup@brainfault.org>
Tue, 19 Dec 2023 10:26:37 +0000 (15:56 +0530)
Some of the upcoming SBI extensions (such as SSE) will directly
update register state so improve the prototype of ecall handler
to accommodate this. Further, this flexibility allows us to
push the trap redirection from sbi_ecall_handler() to the
sbi_ecall_legacy_handler().

Signed-off-by: Anup Patel <apatel@ventanamicro.com>
19 files changed:
include/sbi/sbi_ecall.h
include/sbi/sbi_platform.h
lib/sbi/sbi_ecall.c
lib/sbi/sbi_ecall_base.c
lib/sbi/sbi_ecall_cppc.c
lib/sbi/sbi_ecall_dbcn.c
lib/sbi/sbi_ecall_hsm.c
lib/sbi/sbi_ecall_ipi.c
lib/sbi/sbi_ecall_legacy.c
lib/sbi/sbi_ecall_pmu.c
lib/sbi/sbi_ecall_rfence.c
lib/sbi/sbi_ecall_srst.c
lib/sbi/sbi_ecall_susp.c
lib/sbi/sbi_ecall_time.c
lib/sbi/sbi_ecall_vendor.c
platform/generic/andes/andes_sbi.c
platform/generic/include/andes/andes_sbi.h
platform/generic/include/platform_override.h
platform/generic/platform.c

index 027213cbb3a4e1c4b0c5c145a91adde22999168c..0bf42d16e272fdadf366ee5dd323118328ff729e 100644 (file)
 struct sbi_trap_regs;
 struct sbi_trap_info;
 
+struct sbi_ecall_return {
+       /* Return flag to skip register update */
+       bool skip_regs_update;
+       /* Return value */
+       unsigned long value;
+};
+
 struct sbi_ecall_extension {
        /* head is used by the extension list */
        struct sbi_dlist head;
@@ -62,9 +69,8 @@ struct sbi_ecall_extension {
         * never invoked with an invalid or unavailable extension ID.
         */
        int (* handle)(unsigned long extid, unsigned long funcid,
-                      const struct sbi_trap_regs *regs,
-                      unsigned long *out_val,
-                      struct sbi_trap_info *out_trap);
+                      struct sbi_trap_regs *regs,
+                      struct sbi_ecall_return *out);
 };
 
 u16 sbi_ecall_version_major(void);
index 58b9069d903c1f6e6c100ac6d35cac5d7825bdc5..2fb33e16e4ebb2416732c68f9b5aa8dbc2f8539f 100644 (file)
@@ -50,7 +50,7 @@
 #include <sbi/sbi_version.h>
 
 struct sbi_domain_memregion;
-struct sbi_trap_info;
+struct sbi_ecall_return;
 struct sbi_trap_regs;
 struct sbi_hart_features;
 
@@ -137,9 +137,8 @@ struct sbi_platform_operations {
        bool (*vendor_ext_check)(void);
        /** platform specific SBI extension implementation provider */
        int (*vendor_ext_provider)(long funcid,
-                                  const struct sbi_trap_regs *regs,
-                                  unsigned long *out_value,
-                                  struct sbi_trap_info *out_trap);
+                                  struct sbi_trap_regs *regs,
+                                  struct sbi_ecall_return *out);
 };
 
 /** Platform default per-HART stack size for exception/interrupt handling */
@@ -666,16 +665,12 @@ static inline bool sbi_platform_vendor_ext_check(
 static inline int sbi_platform_vendor_ext_provider(
                                        const struct sbi_platform *plat,
                                        long funcid,
-                                       const struct sbi_trap_regs *regs,
-                                       unsigned long *out_value,
-                                       struct sbi_trap_info *out_trap)
+                                       struct sbi_trap_regs *regs,
+                                       struct sbi_ecall_return *out)
 {
-       if (plat && sbi_platform_ops(plat)->vendor_ext_provider) {
+       if (plat && sbi_platform_ops(plat)->vendor_ext_provider)
                return sbi_platform_ops(plat)->vendor_ext_provider(funcid,
-                                                               regs,
-                                                               out_value,
-                                                               out_trap);
-       }
+                                                               regs, out);
 
        return SBI_ENOTSUPP;
 }
index 3eb4f0addb028cfb538cd58fcbf03cac7f22bc77..631c5dd168d5af9bb5f399e93105c4748691ebc0 100644 (file)
@@ -101,14 +101,12 @@ int sbi_ecall_handler(struct sbi_trap_regs *regs)
        struct sbi_ecall_extension *ext;
        unsigned long extension_id = regs->a7;
        unsigned long func_id = regs->a6;
-       struct sbi_trap_info trap = {0};
-       unsigned long out_val = 0;
+       struct sbi_ecall_return out = {0};
        bool is_0_1_spec = 0;
 
        ext = sbi_ecall_find_extension(extension_id);
        if (ext && ext->handle) {
-               ret = ext->handle(extension_id, func_id,
-                                 regs, &out_val, &trap);
+               ret = ext->handle(extension_id, func_id, regs, &out);
                if (extension_id >= SBI_EXT_0_1_SET_TIMER &&
                    extension_id <= SBI_EXT_0_1_SHUTDOWN)
                        is_0_1_spec = 1;
@@ -116,10 +114,7 @@ int sbi_ecall_handler(struct sbi_trap_regs *regs)
                ret = SBI_ENOTSUPP;
        }
 
-       if (ret == SBI_ETRAP) {
-               trap.epc = regs->mepc;
-               sbi_trap_redirect(regs, &trap);
-       } else {
+       if (!out.skip_regs_update) {
                if (ret < SBI_LAST_ERR ||
                    (extension_id != SBI_EXT_0_1_CONSOLE_GETCHAR &&
                     SBI_SUCCESS < ret)) {
@@ -140,7 +135,7 @@ int sbi_ecall_handler(struct sbi_trap_regs *regs)
                regs->mepc += 4;
                regs->a0 = ret;
                if (!is_0_1_spec)
-                       regs->a1 = out_val;
+                       regs->a1 = out.value;
        }
 
        return 0;
index 74f05eb26a35980e744e5758e743d8d6195fb864..b7178ea8acc1cbe0f1d79a085b0eb1922185b72a 100644 (file)
@@ -33,37 +33,36 @@ static int sbi_ecall_base_probe(unsigned long extid, unsigned long *out_val)
 }
 
 static int sbi_ecall_base_handler(unsigned long extid, unsigned long funcid,
-                                 const struct sbi_trap_regs *regs,
-                                 unsigned long *out_val,
-                                 struct sbi_trap_info *out_trap)
+                                 struct sbi_trap_regs *regs,
+                                 struct sbi_ecall_return *out)
 {
        int ret = 0;
 
        switch (funcid) {
        case SBI_EXT_BASE_GET_SPEC_VERSION:
-               *out_val = (SBI_ECALL_VERSION_MAJOR <<
-                          SBI_SPEC_VERSION_MAJOR_OFFSET) &
-                          (SBI_SPEC_VERSION_MAJOR_MASK <<
-                           SBI_SPEC_VERSION_MAJOR_OFFSET);
-               *out_val = *out_val | SBI_ECALL_VERSION_MINOR;
+               out->value = (SBI_ECALL_VERSION_MAJOR <<
+                             SBI_SPEC_VERSION_MAJOR_OFFSET) &
+                            (SBI_SPEC_VERSION_MAJOR_MASK <<
+                             SBI_SPEC_VERSION_MAJOR_OFFSET);
+               out->value = out->value | SBI_ECALL_VERSION_MINOR;
                break;
        case SBI_EXT_BASE_GET_IMP_ID:
-               *out_val = sbi_ecall_get_impid();
+               out->value = sbi_ecall_get_impid();
                break;
        case SBI_EXT_BASE_GET_IMP_VERSION:
-               *out_val = OPENSBI_VERSION;
+               out->value = OPENSBI_VERSION;
                break;
        case SBI_EXT_BASE_GET_MVENDORID:
-               *out_val = csr_read(CSR_MVENDORID);
+               out->value = csr_read(CSR_MVENDORID);
                break;
        case SBI_EXT_BASE_GET_MARCHID:
-               *out_val = csr_read(CSR_MARCHID);
+               out->value = csr_read(CSR_MARCHID);
                break;
        case SBI_EXT_BASE_GET_MIMPID:
-               *out_val = csr_read(CSR_MIMPID);
+               out->value = csr_read(CSR_MIMPID);
                break;
        case SBI_EXT_BASE_PROBE_EXT:
-               ret = sbi_ecall_base_probe(regs->a0, out_val);
+               ret = sbi_ecall_base_probe(regs->a0, &out->value);
                break;
        default:
                ret = SBI_ENOTSUPP;
index b54d54ec684cb5b32b166f5691c5f059db92403c..c26bb401796d9c7a157843d17b5c8f76c0366ef2 100644 (file)
@@ -12,9 +12,8 @@
 #include <sbi/sbi_cppc.h>
 
 static int sbi_ecall_cppc_handler(unsigned long extid, unsigned long funcid,
-                                 const struct sbi_trap_regs *regs,
-                                 unsigned long *out_val,
-                                 struct sbi_trap_info *out_trap)
+                                 struct sbi_trap_regs *regs,
+                                 struct sbi_ecall_return *out)
 {
        int ret = 0;
        uint64_t temp;
@@ -22,14 +21,14 @@ static int sbi_ecall_cppc_handler(unsigned long extid, unsigned long funcid,
        switch (funcid) {
        case SBI_EXT_CPPC_READ:
                ret = sbi_cppc_read(regs->a0, &temp);
-               *out_val = temp;
+               out->value = temp;
                break;
        case SBI_EXT_CPPC_READ_HI:
 #if __riscv_xlen == 32
                ret = sbi_cppc_read(regs->a0, &temp);
-               *out_val = temp >> 32;
+               out->value = temp >> 32;
 #else
-               *out_val = 0;
+               out->value = 0;
 #endif
                break;
        case SBI_EXT_CPPC_WRITE:
@@ -38,7 +37,7 @@ static int sbi_ecall_cppc_handler(unsigned long extid, unsigned long funcid,
        case SBI_EXT_CPPC_PROBE:
                ret = sbi_cppc_probe(regs->a0);
                if (ret >= 0) {
-                       *out_val = ret;
+                       out->value = ret;
                        ret = 0;
                }
                break;
index 18cd6c8b5ccf12a0aafd97104e74baf29beacd2e..49a7713f48bb9f6e6b8cbf478bab0ca2174fe474 100644 (file)
@@ -17,9 +17,8 @@
 #include <sbi/sbi_hart.h>
 
 static int sbi_ecall_dbcn_handler(unsigned long extid, unsigned long funcid,
-                                 const struct sbi_trap_regs *regs,
-                                 unsigned long *out_val,
-                                 struct sbi_trap_info *out_trap)
+                                 struct sbi_trap_regs *regs,
+                                 struct sbi_ecall_return *out)
 {
        ulong smode = (csr_read(CSR_MSTATUS) & MSTATUS_MPP) >>
                        MSTATUS_MPP_SHIFT;
@@ -49,9 +48,9 @@ static int sbi_ecall_dbcn_handler(unsigned long extid, unsigned long funcid,
                        return SBI_ERR_INVALID_PARAM;
                sbi_hart_map_saddr(regs->a1, regs->a0);
                if (funcid == SBI_EXT_DBCN_CONSOLE_WRITE)
-                       *out_val = sbi_nputs((const char *)regs->a1, regs->a0);
+                       out->value = sbi_nputs((const char *)regs->a1, regs->a0);
                else
-                       *out_val = sbi_ngets((char *)regs->a1, regs->a0);
+                       out->value = sbi_ngets((char *)regs->a1, regs->a0);
                sbi_hart_unmap_saddr();
                return 0;
        case SBI_EXT_DBCN_CONSOLE_WRITE_BYTE:
index 20705c39513128d431d5a303f51d9ad5d969ce8f..93170b09780508976f146397ea64981cd41e4ce9 100644 (file)
@@ -17,9 +17,8 @@
 #include <sbi/riscv_asm.h>
 
 static int sbi_ecall_hsm_handler(unsigned long extid, unsigned long funcid,
-                                const struct sbi_trap_regs *regs,
-                                unsigned long *out_val,
-                                struct sbi_trap_info *out_trap)
+                                struct sbi_trap_regs *regs,
+                                struct sbi_ecall_return *out)
 {
        int ret = 0;
        struct sbi_scratch *scratch = sbi_scratch_thishart_ptr();
@@ -47,7 +46,7 @@ static int sbi_ecall_hsm_handler(unsigned long extid, unsigned long funcid,
        }
 
        if (ret >= 0) {
-               *out_val = ret;
+               out->value = ret;
                ret = 0;
        }
 
index a40d6b8cc8a801e276a1d0b7dc94d8e6b171f23d..50ef41dcf049ecd108a19e6c24432f6cac778d88 100644 (file)
@@ -15,9 +15,8 @@
 #include <sbi/sbi_ipi.h>
 
 static int sbi_ecall_ipi_handler(unsigned long extid, unsigned long funcid,
-                                const struct sbi_trap_regs *regs,
-                                unsigned long *out_val,
-                                struct sbi_trap_info *out_trap)
+                                struct sbi_trap_regs *regs,
+                                struct sbi_ecall_return *out)
 {
        int ret = 0;
 
index 556f629b8c2292c4f5c78831051a16cef02df9fa..48bd2274d75190a4bf26415771e1cfc012416e42 100644 (file)
@@ -43,13 +43,13 @@ static int sbi_load_hart_mask_unpriv(ulong *pmask, ulong *hmask,
 }
 
 static int sbi_ecall_legacy_handler(unsigned long extid, unsigned long funcid,
-                                   const struct sbi_trap_regs *regs,
-                                   unsigned long *out_val,
-                                   struct sbi_trap_info *out_trap)
+                                   struct sbi_trap_regs *regs,
+                                   struct sbi_ecall_return *out)
 {
        int ret = 0;
        struct sbi_tlb_info tlb_info;
        u32 source_hart = current_hartid();
+       struct sbi_trap_info trap = {0};
        ulong hmask = 0;
 
        switch (extid) {
@@ -71,37 +71,58 @@ static int sbi_ecall_legacy_handler(unsigned long extid, unsigned long funcid,
                break;
        case SBI_EXT_0_1_SEND_IPI:
                ret = sbi_load_hart_mask_unpriv((ulong *)regs->a0,
-                                               &hmask, out_trap);
-               if (ret != SBI_ETRAP)
+                                               &hmask, &trap);
+               if (ret != SBI_ETRAP) {
                        ret = sbi_ipi_send_smode(hmask, 0);
+               } else {
+                       ret = 0;
+                       trap.epc = regs->mepc;
+                       sbi_trap_redirect(regs, &trap);
+                       out->skip_regs_update = true;
+               }
                break;
        case SBI_EXT_0_1_REMOTE_FENCE_I:
                ret = sbi_load_hart_mask_unpriv((ulong *)regs->a0,
-                                               &hmask, out_trap);
+                                               &hmask, &trap);
                if (ret != SBI_ETRAP) {
                        SBI_TLB_INFO_INIT(&tlb_info, 0, 0, 0, 0,
                                          SBI_TLB_FENCE_I, source_hart);
                        ret = sbi_tlb_request(hmask, 0, &tlb_info);
+               } else {
+                       ret = 0;
+                       trap.epc = regs->mepc;
+                       sbi_trap_redirect(regs, &trap);
+                       out->skip_regs_update = true;
                }
                break;
        case SBI_EXT_0_1_REMOTE_SFENCE_VMA:
                ret = sbi_load_hart_mask_unpriv((ulong *)regs->a0,
-                                               &hmask, out_trap);
+                                               &hmask, &trap);
                if (ret != SBI_ETRAP) {
                        SBI_TLB_INFO_INIT(&tlb_info, regs->a1, regs->a2, 0, 0,
                                          SBI_TLB_SFENCE_VMA, source_hart);
                        ret = sbi_tlb_request(hmask, 0, &tlb_info);
+               } else {
+                       ret = 0;
+                       trap.epc = regs->mepc;
+                       sbi_trap_redirect(regs, &trap);
+                       out->skip_regs_update = true;
                }
                break;
        case SBI_EXT_0_1_REMOTE_SFENCE_VMA_ASID:
                ret = sbi_load_hart_mask_unpriv((ulong *)regs->a0,
-                                               &hmask, out_trap);
+                                               &hmask, &trap);
                if (ret != SBI_ETRAP) {
                        SBI_TLB_INFO_INIT(&tlb_info, regs->a1,
                                          regs->a2, regs->a3, 0,
                                          SBI_TLB_SFENCE_VMA_ASID,
                                          source_hart);
                        ret = sbi_tlb_request(hmask, 0, &tlb_info);
+               } else {
+                       ret = 0;
+                       trap.epc = regs->mepc;
+                       sbi_trap_redirect(regs, &trap);
+                       out->skip_regs_update = true;
                }
                break;
        case SBI_EXT_0_1_SHUTDOWN:
index c58591106d09a1940bcca8ceae60e436cf962995..40a63a626f6b8e9b42fdbd66b3680844f7900c23 100644 (file)
@@ -18,9 +18,8 @@
 #include <sbi/riscv_asm.h>
 
 static int sbi_ecall_pmu_handler(unsigned long extid, unsigned long funcid,
-                                const struct sbi_trap_regs *regs,
-                                unsigned long *out_val,
-                                struct sbi_trap_info *out_trap)
+                                struct sbi_trap_regs *regs,
+                                struct sbi_ecall_return *out)
 {
        int ret = 0;
        uint64_t temp;
@@ -29,12 +28,12 @@ static int sbi_ecall_pmu_handler(unsigned long extid, unsigned long funcid,
        case SBI_EXT_PMU_NUM_COUNTERS:
                ret = sbi_pmu_num_ctr();
                if (ret >= 0) {
-                       *out_val = ret;
+                       out->value = ret;
                        ret = 0;
                }
                break;
        case SBI_EXT_PMU_COUNTER_GET_INFO:
-               ret = sbi_pmu_ctr_get_info(regs->a0, out_val);
+               ret = sbi_pmu_ctr_get_info(regs->a0, &out->value);
                break;
        case SBI_EXT_PMU_COUNTER_CFG_MATCH:
 #if __riscv_xlen == 32
@@ -45,21 +44,21 @@ static int sbi_ecall_pmu_handler(unsigned long extid, unsigned long funcid,
                ret = sbi_pmu_ctr_cfg_match(regs->a0, regs->a1, regs->a2,
                                            regs->a3, temp);
                if (ret >= 0) {
-                       *out_val = ret;
+                       out->value = ret;
                        ret = 0;
                }
 
                break;
        case SBI_EXT_PMU_COUNTER_FW_READ:
                ret = sbi_pmu_ctr_fw_read(regs->a0, &temp);
-               *out_val = temp;
+               out->value = temp;
                break;
        case SBI_EXT_PMU_COUNTER_FW_READ_HI:
 #if __riscv_xlen == 32
                ret = sbi_pmu_ctr_fw_read(regs->a0, &temp);
-               *out_val = temp >> 32;
+               out->value = temp >> 32;
 #else
-               *out_val = 0;
+               out->value = 0;
 #endif
                break;
        case SBI_EXT_PMU_COUNTER_START:
index 4b74d4125407506c42ec382508d1f7f1f87d3de6..ded16c26efbbfa5318d766dec6bd3d01c1b9fe77 100644 (file)
@@ -16,9 +16,8 @@
 #include <sbi/sbi_tlb.h>
 
 static int sbi_ecall_rfence_handler(unsigned long extid, unsigned long funcid,
-                                   const struct sbi_trap_regs *regs,
-                                   unsigned long *out_val,
-                                   struct sbi_trap_info *out_trap)
+                                   struct sbi_trap_regs *regs,
+                                   struct sbi_ecall_return *out)
 {
        int ret = 0;
        unsigned long vmid;
index dcd560d22f9d741cfb6ea37e338ef62db184632a..46cfaca49b4dd1188fae80a96f9edadf338015fa 100644 (file)
@@ -15,9 +15,8 @@
 #include <sbi/sbi_system.h>
 
 static int sbi_ecall_srst_handler(unsigned long extid, unsigned long funcid,
-                                 const struct sbi_trap_regs *regs,
-                                 unsigned long *out_val,
-                                 struct sbi_trap_info *out_trap)
+                                 struct sbi_trap_regs *regs,
+                                 struct sbi_ecall_return *out)
 {
        if (funcid == SBI_EXT_SRST_RESET) {
                if ((((u32)-1U) <= ((u64)regs->a0)) ||
index 2bfd99ae87208ba9eee0cbf18b0d45735afd6644..7b66bfcd8dab10683f47763176f14109b9e4ed8a 100644 (file)
@@ -6,9 +6,8 @@
 #include <sbi/sbi_system.h>
 
 static int sbi_ecall_susp_handler(unsigned long extid, unsigned long funcid,
-                                 const struct sbi_trap_regs *regs,
-                                 unsigned long *out_val,
-                                 struct sbi_trap_info *out_trap)
+                                 struct sbi_trap_regs *regs,
+                                 struct sbi_ecall_return *out)
 {
        int ret = SBI_ENOTSUPP;
 
@@ -16,7 +15,7 @@ static int sbi_ecall_susp_handler(unsigned long extid, unsigned long funcid,
                ret = sbi_system_suspend(regs->a0, regs->a1, regs->a2);
 
        if (ret >= 0) {
-               *out_val = ret;
+               out->value = ret;
                ret = 0;
        }
 
index e79196f77adc1260c259d69e1b9019d3083d5d2e..5a2316eb3c6040e9bcadc3682dcfa8da2c271393 100644 (file)
@@ -15,9 +15,8 @@
 #include <sbi/sbi_timer.h>
 
 static int sbi_ecall_time_handler(unsigned long extid, unsigned long funcid,
-                                 const struct sbi_trap_regs *regs,
-                                 unsigned long *out_val,
-                                 struct sbi_trap_info *out_trap)
+                                 struct sbi_trap_regs *regs,
+                                 struct sbi_ecall_return *out)
 {
        int ret = 0;
 
index 700f475f0a867949ffb96c2c8ecbca5d15c83697..ebebc5861292c64c9b20af9f8e653ee93eb35050 100644 (file)
@@ -23,13 +23,11 @@ static inline unsigned long sbi_ecall_vendor_id(void)
 }
 
 static int sbi_ecall_vendor_handler(unsigned long extid, unsigned long funcid,
-                                   const struct sbi_trap_regs *regs,
-                                   unsigned long *out_val,
-                                   struct sbi_trap_info *out_trap)
+                                   struct sbi_trap_regs *regs,
+                                   struct sbi_ecall_return *out)
 {
        return sbi_platform_vendor_ext_provider(sbi_platform_thishart_ptr(),
-                                               funcid, regs,
-                                               out_val, out_trap);
+                                               funcid, regs, out);
 }
 
 struct sbi_ecall_extension ecall_vendor;
index 3e89fb9c696093c287345ae4a4281b57be887a8a..267c663899ddc306f6dc51b33860b97469dab81f 100644 (file)
@@ -33,14 +33,13 @@ static bool andes45_apply_iocp_sw_workaround(void)
 }
 
 int andes_sbi_vendor_ext_provider(long funcid,
-                                 const struct sbi_trap_regs *regs,
-                                 unsigned long *out_value,
-                                 struct sbi_trap_info *out_trap,
+                                 struct sbi_trap_regs *regs,
+                                 struct sbi_ecall_return *out,
                                  const struct fdt_match *match)
 {
        switch (funcid) {
        case SBI_EXT_ANDES_IOCP_SW_WORKAROUND:
-               *out_value = andes45_apply_iocp_sw_workaround();
+               out->value = andes45_apply_iocp_sw_workaround();
                break;
 
        default:
index e5dc250707bf55dc2028f5b97536b52bea960c02..1288af81dd662c97a7cf3daebf5c0e521bc4d25f 100644 (file)
@@ -3,13 +3,13 @@
 #ifndef _RISCV_ANDES_SBI_H
 #define _RISCV_ANDES_SBI_H
 
+#include <sbi/sbi_ecall.h>
 #include <sbi/sbi_trap.h>
 #include <sbi_utils/fdt/fdt_helper.h>
 
 int andes_sbi_vendor_ext_provider(long funcid,
-                                 const struct sbi_trap_regs *regs,
-                                 unsigned long *out_value,
-                                 struct sbi_trap_info *out_trap,
+                                 struct sbi_trap_regs *regs,
+                                 struct sbi_ecall_return *out,
                                  const struct fdt_match *match);
 
 #endif /* _RISCV_ANDES_SBI_H */
index f2a4327ec2714eb5569acda3277ccc7572e5af12..b0585c2101c36221acc0c2aed0a821f1aa00dbae 100644 (file)
@@ -10,6 +10,7 @@
 #ifndef __PLATFORM_OVERRIDE_H__
 #define __PLATFORM_OVERRIDE_H__
 
+#include <sbi/sbi_ecall.h>
 #include <sbi/sbi_hart.h>
 #include <sbi/sbi_types.h>
 #include <sbi/sbi_trap.h>
@@ -30,9 +31,8 @@ struct platform_override {
        int (*pmu_init)(const struct fdt_match *match);
        void (*fw_init)(void *fdt, const struct fdt_match *match);
        int (*vendor_ext_provider)(long funcid,
-                                  const struct sbi_trap_regs *regs,
-                                  unsigned long *out_value,
-                                  struct sbi_trap_info *out_trap,
+                                  struct sbi_trap_regs *regs,
+                                  struct sbi_ecall_return *out,
                                   const struct fdt_match *match);
 };
 
index 850722751576345b2ab6c267680cec46fa45b0a9..bfd7d318fe66a10d0db4ccdfbe0aed3753a0d9af 100644 (file)
@@ -203,12 +203,10 @@ static bool generic_vendor_ext_check(void)
 }
 
 static int generic_vendor_ext_provider(long funcid,
-                                      const struct sbi_trap_regs *regs,
-                                      unsigned long *out_value,
-                                      struct sbi_trap_info *out_trap)
+                                      struct sbi_trap_regs *regs,
+                                      struct sbi_ecall_return *out)
 {
-       return generic_plat->vendor_ext_provider(funcid, regs,
-                                                out_value, out_trap,
+       return generic_plat->vendor_ext_provider(funcid, regs, out,
                                                 generic_plat_match);
 }