summaryrefslogtreecommitdiff
path: root/include/sbi
diff options
context:
space:
mode:
authorAnup Patel <anup.patel@wdc.com>2020-05-05 09:16:25 +0300
committerAnup Patel <anup@brainfault.org>2020-05-07 06:38:26 +0300
commitdc38929dfb441cbecb4e31a299b463bac11d02cf (patch)
tree73b55b2c283c54634ef99a343ec5c745e6f82baf /include/sbi
parent5338679ff043d68f5c26265de144e5ec54109724 (diff)
downloadopensbi-dc38929dfb441cbecb4e31a299b463bac11d02cf.tar.xz
lib: sbi: Improve misa_string() implementation
The RISC-V ISA string does not follow alphabetical order. Instead, we have a RISC-V specific ordering of extensions in the RISC-V ISA string. This patch improves misa_string() implementation to return a valid RISC-V ISA string. Signed-off-by: Anup Patel <anup.patel@wdc.com> Reviewed-by: Atish Patra <atish.patra@wdc.com>
Diffstat (limited to 'include/sbi')
-rw-r--r--include/sbi/riscv_asm.h15
1 files changed, 2 insertions, 13 deletions
diff --git a/include/sbi/riscv_asm.h b/include/sbi/riscv_asm.h
index 6c5c729..6e093ca 100644
--- a/include/sbi/riscv_asm.h
+++ b/include/sbi/riscv_asm.h
@@ -173,19 +173,8 @@ int misa_extension_imp(char ext);
/* Get MXL field of misa, return -1 on error */
int misa_xlen(void);
-static inline void misa_string(char *out, unsigned int out_sz)
-{
- unsigned long i;
-
- for (i = 0; i < 26; i++) {
- if (misa_extension_imp('A' + i)) {
- *out = 'A' + i;
- out++;
- }
- }
- *out = '\0';
- out++;
-}
+/* Get RISC-V ISA string representation */
+void misa_string(int xlen, char *out, unsigned int out_sz);
int pmp_set(unsigned int n, unsigned long prot, unsigned long addr,
unsigned long log2len);