From 74d26094f81cc93ead6956b6c5dad422e2eac869 Mon Sep 17 00:00:00 2001 From: Andy Ross Date: Tue, 20 Aug 2019 11:44:48 -0700 Subject: [PATCH] arch/common: Provide a weak, generic z_arch_irq_connect_dynamic() It was discovered that the xtensa version of z_arch_irq_connect_dynamic() was being removed along with the old xtensa architecture support, because it was never included in the asm2 builds. But there's no xtensa-specific code in it at all. Architectures that use the existing sw_isr_table mechanism and don't (or can't, in the case of xtensa which has fixed interrupt priority) interpret the other parameters might as well have access to a working generic implementation. Fixes #18272 Signed-off-by: Andy Ross --- arch/common/sw_isr_common.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/arch/common/sw_isr_common.c b/arch/common/sw_isr_common.c index f312bfc96c7..79be8657328 100644 --- a/arch/common/sw_isr_common.c +++ b/arch/common/sw_isr_common.c @@ -24,4 +24,21 @@ void z_isr_install(unsigned int irq, void (*routine)(void *), void *param) _sw_isr_table[table_idx].arg = param; _sw_isr_table[table_idx].isr = routine; } + +/* Some architectures don't/can't interpret flags or priority and have + * no more processing to do than this. Provide a generic fallback. + */ +int __weak z_arch_irq_connect_dynamic(unsigned int irq, + unsigned int priority, + void (*routine)(void *), + void *parameter, + u32_t flags) +{ + ARG_UNUSED(flags); + ARG_UNUSED(priority); + + z_isr_install(irq, routine, parameter); + return irq; +} + #endif /* CONFIG_DYNAMIC_INTERRUPTS */