arch: riscv: add an option for empty spurious interrupt handler
Add the possibility to disable fault handling in spurious interrupt handler on RISCs and replacce it with an infinite loop. Signed-off-by: Magdalena Pastula <magdalena.pastula@nordicsemi.no>
This commit is contained in:
parent
f44146a6cd
commit
0237d375de
2 changed files with 19 additions and 0 deletions
12
arch/Kconfig
12
arch/Kconfig
|
@ -113,6 +113,7 @@ config RISCV
|
||||||
select ARCH_IS_SET
|
select ARCH_IS_SET
|
||||||
select ARCH_SUPPORTS_COREDUMP
|
select ARCH_SUPPORTS_COREDUMP
|
||||||
select ARCH_SUPPORTS_ROM_START if !SOC_FAMILY_ESPRESSIF_ESP32
|
select ARCH_SUPPORTS_ROM_START if !SOC_FAMILY_ESPRESSIF_ESP32
|
||||||
|
select ARCH_SUPPORTS_EMPTY_IRQ_SPURIOUS
|
||||||
select ARCH_HAS_CODE_DATA_RELOCATION
|
select ARCH_HAS_CODE_DATA_RELOCATION
|
||||||
select ARCH_HAS_THREAD_LOCAL_STORAGE
|
select ARCH_HAS_THREAD_LOCAL_STORAGE
|
||||||
select IRQ_OFFLOAD_NESTED if IRQ_OFFLOAD
|
select IRQ_OFFLOAD_NESTED if IRQ_OFFLOAD
|
||||||
|
@ -608,6 +609,14 @@ config SIMPLIFIED_EXCEPTION_CODES
|
||||||
down to the generic K_ERR_CPU_EXCEPTION, which makes testing code
|
down to the generic K_ERR_CPU_EXCEPTION, which makes testing code
|
||||||
much more portable.
|
much more portable.
|
||||||
|
|
||||||
|
config EMPTY_IRQ_SPURIOUS
|
||||||
|
bool "Create empty spurious interrupt handler"
|
||||||
|
depends on ARCH_SUPPORTS_EMPTY_IRQ_SPURIOUS
|
||||||
|
help
|
||||||
|
This option changes body of spurious interrupt handler. When enabled,
|
||||||
|
handler contains only an infinite while loop, when disabled, handler
|
||||||
|
contains the whole Zephyr fault handling procedure.
|
||||||
|
|
||||||
endmenu # Interrupt configuration
|
endmenu # Interrupt configuration
|
||||||
|
|
||||||
config INIT_ARCH_HW_AT_BOOT
|
config INIT_ARCH_HW_AT_BOOT
|
||||||
|
@ -673,6 +682,9 @@ config ARCH_SUPPORTS_ARCH_HW_INIT
|
||||||
config ARCH_SUPPORTS_ROM_START
|
config ARCH_SUPPORTS_ROM_START
|
||||||
bool
|
bool
|
||||||
|
|
||||||
|
config ARCH_SUPPORTS_EMPTY_IRQ_SPURIOUS
|
||||||
|
bool
|
||||||
|
|
||||||
config ARCH_HAS_EXTRA_EXCEPTION_INFO
|
config ARCH_HAS_EXTRA_EXCEPTION_INFO
|
||||||
bool
|
bool
|
||||||
|
|
||||||
|
|
|
@ -19,6 +19,12 @@ LOG_MODULE_DECLARE(os, CONFIG_KERNEL_LOG_LEVEL);
|
||||||
|
|
||||||
FUNC_NORETURN void z_irq_spurious(const void *unused)
|
FUNC_NORETURN void z_irq_spurious(const void *unused)
|
||||||
{
|
{
|
||||||
|
#ifdef CONFIG_EMPTY_IRQ_SPURIOUS
|
||||||
|
while (1) {
|
||||||
|
}
|
||||||
|
|
||||||
|
CODE_UNREACHABLE;
|
||||||
|
#else
|
||||||
unsigned long mcause;
|
unsigned long mcause;
|
||||||
|
|
||||||
ARG_UNUSED(unused);
|
ARG_UNUSED(unused);
|
||||||
|
@ -37,6 +43,7 @@ FUNC_NORETURN void z_irq_spurious(const void *unused)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
z_riscv_fatal_error(K_ERR_SPURIOUS_IRQ, NULL);
|
z_riscv_fatal_error(K_ERR_SPURIOUS_IRQ, NULL);
|
||||||
|
#endif /* CONFIG_EMPTY_IRQ_SPURIOUS */
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_DYNAMIC_INTERRUPTS
|
#ifdef CONFIG_DYNAMIC_INTERRUPTS
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue