summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorAnup Patel <apatel@ventanamicro.com>2023-02-13 07:50:30 +0300
committerAnup Patel <anup@brainfault.org>2023-02-27 08:56:35 +0300
commit81adc62f45c0baf13112358164a327197e70a7af (patch)
tree37afd08b27918809a2e3ee7090ba3108b45adc54 /include
parent30ea8069f4c704e67017215f90f74b8588ee9bdf (diff)
downloadopensbi-81adc62f45c0baf13112358164a327197e70a7af.tar.xz
lib: sbi: Align SBI vendor extension id with mvendorid CSR
As-per the SBI specification, the lower 24bits of the SBI vendor extension id is same as lower 24bits of the mvendorid CSR. We update the SBI vendor extension id checking based on above. Signed-off-by: Anup Patel <apatel@ventanamicro.com>
Diffstat (limited to 'include')
-rw-r--r--include/sbi/sbi_platform.h17
1 files changed, 8 insertions, 9 deletions
diff --git a/include/sbi/sbi_platform.h b/include/sbi/sbi_platform.h
index 43d1c03..3a629a6 100644
--- a/include/sbi/sbi_platform.h
+++ b/include/sbi/sbi_platform.h
@@ -126,8 +126,8 @@ struct sbi_platform_operations {
/** Exit platform timer for current HART */
void (*timer_exit)(void);
- /** platform specific SBI extension implementation probe function */
- int (*vendor_ext_check)(long extid);
+ /** Check if SBI vendor extension is implemented or not */
+ bool (*vendor_ext_check)(void);
/** platform specific SBI extension implementation provider */
int (*vendor_ext_provider)(long extid, long funcid,
const struct sbi_trap_regs *regs,
@@ -636,20 +636,19 @@ static inline void sbi_platform_timer_exit(const struct sbi_platform *plat)
}
/**
- * Check if a vendor extension is implemented or not.
+ * Check if SBI vendor extension is implemented or not.
*
* @param plat pointer to struct sbi_platform
- * @param extid vendor SBI extension id
*
- * @return 0 if extid is not implemented and 1 if implemented
+ * @return false if not implemented and true if implemented
*/
-static inline int sbi_platform_vendor_ext_check(const struct sbi_platform *plat,
- long extid)
+static inline bool sbi_platform_vendor_ext_check(
+ const struct sbi_platform *plat)
{
if (plat && sbi_platform_ops(plat)->vendor_ext_check)
- return sbi_platform_ops(plat)->vendor_ext_check(extid);
+ return sbi_platform_ops(plat)->vendor_ext_check();
- return 0;
+ return false;
}
/**