arch: Add IRQ_OFFSET_NESTED feature
The x86 and xtensa implementations of irq_offload() invoke synchronous
interrupts on the local CPU, and are therefore safe to use from within
an interrupt context. This is a cheap and portable way to exercise
nested interrupts, which are otherwise highly platform-dependent to
test. Add a kconfig to signal the capability.
Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
diff --git a/arch/Kconfig b/arch/Kconfig
index 937382c..a619ee6 100644
--- a/arch/Kconfig
+++ b/arch/Kconfig
@@ -84,6 +84,7 @@
select ARCH_HAS_TIMING_FUNCTIONS
select ARCH_HAS_THREAD_LOCAL_STORAGE
select ARCH_HAS_DEMAND_PAGING
+ select IRQ_OFFLOAD_NESTED if IRQ_OFFLOAD
select NEED_LIBC_MEM_PARTITION if USERSPACE && TIMING_FUNCTIONS \
&& !BOARD_HAS_TIMING_FUNCTIONS \
&& !SOC_HAS_TIMING_FUNCTIONS
@@ -116,6 +117,7 @@
select HAS_DTS
select USE_SWITCH
select USE_SWITCH_SUPPORTED
+ select IRQ_OFFLOAD_NESTED if IRQ_OFFLOAD
imply ATOMIC_OPERATIONS_ARCH
help
Xtensa architecture
@@ -438,6 +440,14 @@
run in interrupt context. Only useful for test cases that need
to validate the correctness of kernel objects in IRQ context.
+config IRQ_OFFLOAD_NESTED
+ bool "irq_offload() supports nested IRQs"
+ depends on IRQ_OFFLOAD
+ help
+ When set by the arch layer, indicates that irq_offload() may
+ legally be called in interrupt context to cause a
+ synchronous nested interrupt on the current CPU. Not all
+ hardware is capable.
config EXTRA_EXCEPTION_INFO
bool "Collect extra exception info"