File tree Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -113,6 +113,7 @@ config RISCV
113113 select ARCH_IS_SET
114114 select ARCH_SUPPORTS_COREDUMP
115115 select ARCH_SUPPORTS_ROM_START if !SOC_FAMILY_ESPRESSIF_ESP32
116+ select ARCH_SUPPORTS_EMPTY_IRQ_SPURIOUS
116117 select ARCH_HAS_CODE_DATA_RELOCATION
117118 select ARCH_HAS_THREAD_LOCAL_STORAGE
118119 select IRQ_OFFLOAD_NESTED if IRQ_OFFLOAD
@@ -608,6 +609,14 @@ config SIMPLIFIED_EXCEPTION_CODES
608609 down to the generic K_ERR_CPU_EXCEPTION, which makes testing code
609610 much more portable.
610611
612+ config EMPTY_IRQ_SPURIOUS
613+ bool "Create empty spurious interrupt handler"
614+ depends on ARCH_SUPPORTS_EMPTY_IRQ_SPURIOUS
615+ help
616+ This option changes body of spurious interrupt handler. When enabled,
617+ handler contains only an infinite while loop, when disabled, handler
618+ contains the whole Zephyr fault handling procedure.
619+
611620endmenu # Interrupt configuration
612621
613622config INIT_ARCH_HW_AT_BOOT
@@ -673,6 +682,9 @@ config ARCH_SUPPORTS_ARCH_HW_INIT
673682config ARCH_SUPPORTS_ROM_START
674683 bool
675684
685+ config ARCH_SUPPORTS_EMPTY_IRQ_SPURIOUS
686+ bool
687+
676688config ARCH_HAS_EXTRA_EXCEPTION_INFO
677689 bool
678690
Original file line number Diff line number Diff line change @@ -19,6 +19,12 @@ LOG_MODULE_DECLARE(os, CONFIG_KERNEL_LOG_LEVEL);
1919
2020FUNC_NORETURN void z_irq_spurious (const void * unused )
2121{
22+ #ifdef CONFIG_EMPTY_IRQ_SPURIOUS
23+ while (1 ) {
24+ }
25+
26+ CODE_UNREACHABLE ;
27+ #else
2228 unsigned long mcause ;
2329
2430 ARG_UNUSED (unused );
@@ -37,6 +43,7 @@ FUNC_NORETURN void z_irq_spurious(const void *unused)
3743 }
3844#endif
3945 z_riscv_fatal_error (K_ERR_SPURIOUS_IRQ , NULL );
46+ #endif /* CONFIG_EMPTY_IRQ_SPURIOUS */
4047}
4148
4249#ifdef CONFIG_DYNAMIC_INTERRUPTS
You can’t perform that action at this time.
0 commit comments