Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

arch: riscv: add an option for empty spurious interrupt handler #2

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions arch/riscv/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,13 @@ config RISCV_RESERVED_IRQ_ISR_TABLES_OFFSET
properly sized to take into account this offset. This is a hidden
option which needs to be set per architecture and left alone.

config RISCV_EMPTY_IRQ_SPURIOUS
bool "Create empty spurious interrupt handler"
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.

config NUM_IRQS
int

Expand Down
7 changes: 7 additions & 0 deletions arch/riscv/core/irq_manage.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@ LOG_MODULE_DECLARE(os, CONFIG_KERNEL_LOG_LEVEL);

FUNC_NORETURN void z_irq_spurious(const void *unused)
{
#ifdef CONFIG_RISCV_EMPTY_IRQ_SPURIOUS
while (1) {
}

CODE_UNREACHABLE;
#else
unsigned long mcause;

ARG_UNUSED(unused);
Expand All @@ -37,6 +43,7 @@ FUNC_NORETURN void z_irq_spurious(const void *unused)
}
#endif
z_riscv_fatal_error(K_ERR_SPURIOUS_IRQ, NULL);
#endif
}

#ifdef CONFIG_DYNAMIC_INTERRUPTS
Expand Down
Loading