summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorAnup Patel <[email protected]>2019-11-17 15:25:41 +0530
committerAnup Patel <[email protected]>2019-11-21 13:58:14 +0530
commit75f903dd78e2419057d04e14d6720fde764cbf78 (patch)
tree3ae317bcddddadb84843a562455802c4a7fb10a5 /include
parent0e1322bacbaccb34f167ebe243ab04836b99105c (diff)
lib: Simplify trap parameters in sbi_ecall functions
The out_tcause and out_tval parameters are not sufficient for most sbi_ecall functions because this will grow in-future when we support RISC-V hypervisor v0.5 draft. We replace these parameters with out_trap which is a pointer to struct sbi_trap_info. Signed-off-by: Anup Patel <[email protected]> Reviewed-by: Atish Patra <[email protected]>
Diffstat (limited to 'include')
-rw-r--r--include/sbi/sbi_platform.h35
1 files changed, 17 insertions, 18 deletions
diff --git a/include/sbi/sbi_platform.h b/include/sbi/sbi_platform.h
index fdf30b96..01d4a854 100644
--- a/include/sbi/sbi_platform.h
+++ b/include/sbi/sbi_platform.h
@@ -41,10 +41,11 @@
#ifndef __ASSEMBLY__
-#include <sbi/sbi_version.h>
-#include <sbi/sbi_scratch.h>
#include <sbi/sbi_ecall.h>
#include <sbi/sbi_error.h>
+#include <sbi/sbi_scratch.h>
+#include <sbi/sbi_trap.h>
+#include <sbi/sbi_version.h>
/** Possible feature flags of a platform */
enum sbi_platform_features {
@@ -119,9 +120,9 @@ 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, unsigned long *out_value,
- unsigned long *out_trap_cause,
- unsigned long *out_trap_val);
+ unsigned long *args,
+ unsigned long *out_value,
+ struct sbi_trap_info *out_trap);
} __packed;
/** Representation of a platform */
@@ -540,25 +541,23 @@ static inline int sbi_platform_vendor_ext_check(const struct sbi_platform *plat,
* @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 out_value output value that can be filled the callee
- * @param out_tcause trap cause that can be filled the callee
- * @param out_tvalue possible trap value that can be filled the callee
+ * @param out_value output value that can be filled by the callee
+ * @param out_trap trap info that can be filled by the callee
*
* @return 0 on success and negative error code on failure
*/
-static inline int sbi_platform_vendor_ext_provider(const struct sbi_platform *plat,
- long extid, long funcid,
- unsigned long *args,
- unsigned long *out_value,
- unsigned long *out_tcause,
- unsigned long *out_tval)
+static inline int sbi_platform_vendor_ext_provider(
+ const struct sbi_platform *plat,
+ long extid, long funcid,
+ unsigned long *args,
+ 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,
- out_value,
- out_tcause,
- out_tval);
+ funcid, args,
+ out_value,
+ out_trap);
}
return SBI_ENOTSUPP;