diff options
author | Anup Patel <anup.patel@wdc.com> | 2020-05-05 11:46:25 +0530 |
---|---|---|
committer | Anup Patel <anup@brainfault.org> | 2020-05-07 09:08:26 +0530 |
commit | dc38929dfb441cbecb4e31a299b463bac11d02cf (patch) | |
tree | 73b55b2c283c54634ef99a343ec5c745e6f82baf /include | |
parent | 5338679ff043d68f5c26265de144e5ec54109724 (diff) |
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')
-rw-r--r-- | include/sbi/riscv_asm.h | 15 |
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); |