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 <yongxuan.wang@sifive.com>
Reviewed-by: Anup Patel <anup@brainfault.org>
This commit is contained in:
Yong-Xuan Wang
2023-12-12 08:58:34 +00:00
committed by Anup Patel
parent 056fe6f85d
commit 776770d2ad
3 changed files with 31 additions and 50 deletions

View File

@@ -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