Skip to content

Commit cbd2158

Browse files
committed
zephyr: sw_isr_table: Fix compilation error
The IRQ_DIRECT_CONNECT macro eventually uses _Z_ISR_DIRECT_TABLE_ENTRY, which defines a function. IRQ_DIRECT_CONNECT is meant to be used inside functions. While nested functions are supported as an extension in GNU C, the nested function cannot have static storage. https://gcc.gnu.org/onlinedocs/gcc/Nested-Functions.html: > A nested function always has no linkage. Declaring one with extern or > static is erroneous. ./scripts/twister -c -s arch.interrupt.gen_isr_table_local.riscv --all tests/kernel/gen_isr_table/src/main.c: In function 'gen_isr_table_test_build_time_direct_interrupt': include/zephyr/sw_isr_table.h:197:41: error: invalid storage class for function '__isr_table_entry_isr1_irq_2' #define __MK_ISR_ELEMENT_NAME(func, id) __isr_table_entry_ ## func ## _irq_ ## id ^~~~~~~~~~~~~~~~~~ Issue #92194 Signed-off-by: Tom Hughes <tomhughes@chromium.org>
1 parent ad4c3e3 commit cbd2158

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

include/zephyr/sw_isr_table.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -243,9 +243,8 @@ struct z_shared_isr_table_entry z_shared_sw_isr_table[];
243243
__attribute__((section(sect))) \
244244
__used _MK_IRQ_ELEMENT_NAME(func, __COUNTER__) = ((uintptr_t)(func)); \
245245
), ( \
246-
static void __attribute__((section(sect))) __attribute__((naked)) \
247-
__used _MK_IRQ_ELEMENT_NAME(func, __COUNTER__)(void) { \
248-
__asm(ARCH_IRQ_VECTOR_JUMP_CODE(func)); \
246+
void __attribute__((section(sect))) __attribute__((naked)) \
247+
__used _MK_IRQ_ELEMENT_NAME(func, __COUNTER__)(void) { __asm(ARCH_IRQ_VECTOR_JUMP_CODE(func)); \
249248
} \
250249
))
251250

0 commit comments

Comments
 (0)