mirror of
https://github.com/riscv-software-src/opensbi.git
synced 2026-10-24 04:32:05 +01:00
lib: Add error detection for misa_extension
Add assertions for misa_extension to prevent incoming illegal characters. Signed-off-by: Xiang Wang <merle@hardenedlinux.org> Reviewed-by: Anup Patel <anup.patel@wdc.com>
This commit is contained in:
1 parent
ab14f94a8c
commit
813f7f4c25
2 files changed
+13
-4
No files matched your search
+2
-1
@@ -12,7 +12,8 @@
|
||||
#include <sbi/sbi_error.h>
|
||||
#include <sbi/sbi_platform.h>
|
||||
|
||||
int misa_extension(char ext)
|
||||
/* determine CPU extension, return non-zero support */
|
||||
int misa_extension_imp(char ext)
|
||||
{
|
||||
unsigned long misa = csr_read(CSR_MISA);
|
||||
|
||||
|
||||
Reference in new issue
Block a user