risc-v: Add a new option to control exception reason
The number of exception for risc-v is 16 (0 ~ 15) for the machine ISA version 1.12 or earlier, the number of exception is 20 (0 ~ 19) from the ISA version 1.13. And maybe changed in the future. Using a dedicated option to control the exception number to allow the earlier version chip with customized exception number (e.g. 16 ~ 19 used) to define the exception reason string correctly. Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
This commit is contained in:
parent
175fcb799e
commit
6695affe87
@ -403,6 +403,14 @@ config ARCH_RV_VECTOR_BYTE_LENGTH
|
|||||||
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
config ARCH_RV_MACHINE_ISA_1_13
|
||||||
|
bool "Machine ISA Version 1.13 or later"
|
||||||
|
default n
|
||||||
|
---help---
|
||||||
|
Indicates support for Machine ISA Version 1.13 or later.
|
||||||
|
This version defined hardware error and software check exception codes,
|
||||||
|
which extend the range of exception codes from 0 ~ 15 to 0 ~ 19.
|
||||||
|
|
||||||
config ARCH_RV_ISA_ZICSR_ZIFENCEI
|
config ARCH_RV_ISA_ZICSR_ZIFENCEI
|
||||||
bool
|
bool
|
||||||
default y
|
default y
|
||||||
|
@ -65,16 +65,10 @@ static const char *g_reasons_str[RISCV_MAX_EXCEPTION + 1] =
|
|||||||
"Load page fault",
|
"Load page fault",
|
||||||
"Reserved",
|
"Reserved",
|
||||||
"Store/AMO page fault",
|
"Store/AMO page fault",
|
||||||
#if RISCV_MAX_EXCEPTION > 15
|
#ifdef CONFIG_ARCH_RV_MACHINE_ISA_1_13
|
||||||
"Reserved",
|
"Reserved",
|
||||||
#endif
|
|
||||||
#if RISCV_MAX_EXCEPTION > 16
|
|
||||||
"Reserved",
|
"Reserved",
|
||||||
#endif
|
|
||||||
#if RISCV_MAX_EXCEPTION > 17
|
|
||||||
"Software check",
|
"Software check",
|
||||||
#endif
|
|
||||||
#if RISCV_MAX_EXCEPTION > 18
|
|
||||||
"Hardware error",
|
"Hardware error",
|
||||||
#endif
|
#endif
|
||||||
#ifdef RISCV_CUSTOM_EXCEPTION_REASONS
|
#ifdef RISCV_CUSTOM_EXCEPTION_REASONS
|
||||||
|
Loading…
Reference in New Issue
Block a user