From 776770d2adbf3ae7d9d3b97f0756c7589003835f Mon Sep 17 00:00:00 2001 From: Yong-Xuan Wang Date: Tue, 12 Dec 2023 08:58:34 +0000 Subject: lib: sbi: Using one array to define the name of extensions Define an array sbi_hart_ext to map extension ID and name , and use it for ISA parsing and printing out the supported extensions. Signed-off-by: Yong-Xuan Wang Reviewed-by: Anup Patel --- include/sbi/sbi_hart.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'include') diff --git a/include/sbi/sbi_hart.h b/include/sbi/sbi_hart.h index 0aefc2be..77138232 100644 --- a/include/sbi/sbi_hart.h +++ b/include/sbi/sbi_hart.h @@ -52,6 +52,13 @@ enum sbi_hart_extensions { SBI_HART_EXT_MAX, }; +struct sbi_hart_ext_data { + const unsigned int id; + const char *name; +}; + +extern const struct sbi_hart_ext_data sbi_hart_ext[]; + /* * Smepmp enforces access boundaries between M-mode and * S/U-mode. When it is enabled, the PMPs are programmed -- cgit v1.3.1