diff --git a/arch/arm/include/tlsr82/irq.h b/arch/arm/include/tlsr82/irq.h index 2ab314c524..d7032bfbb1 100644 --- a/arch/arm/include/tlsr82/irq.h +++ b/arch/arm/include/tlsr82/irq.h @@ -231,6 +231,11 @@ static inline void up_enable_irq(int irq) _IRQ_MASK_REG |= (1 << irq); } +static inline uint32_t getcontrol(void) +{ + return 0; +} + #endif /* __ASSEMBLY__ */ /**************************************************************************** diff --git a/arch/arm/src/tlsr82/tc32/Make.defs b/arch/arm/src/tlsr82/tc32/Make.defs index 3226340d62..cee1fc88a4 100644 --- a/arch/arm/src/tlsr82/tc32/Make.defs +++ b/arch/arm/src/tlsr82/tc32/Make.defs @@ -46,7 +46,7 @@ CMN_ASRCS := $(filter-out $(TC32_ASRCS_FILTER), $(CMN_ASRCS)) # Common files in arch/arm/src/armv6-m -CMN_CSRCS += arm_sigdeliver.c arm_doirq.c +CMN_CSRCS += arm_sigdeliver.c # Common files in arch/arm/src/tlsr82/tc32 diff --git a/arch/arm/src/tlsr82/tc32/tc32_doirq.c b/arch/arm/src/tlsr82/tc32/tc32_doirq.c index 5404b7c533..d19cdfbb00 100644 --- a/arch/arm/src/tlsr82/tc32/tc32_doirq.c +++ b/arch/arm/src/tlsr82/tc32/tc32_doirq.c @@ -55,6 +55,63 @@ * Private Functions ****************************************************************************/ +uint32_t *arm_doirq(int irq, uint32_t *regs) +{ + board_autoled_on(LED_INIRQ); +#ifdef CONFIG_SUPPRESS_INTERRUPTS + PANIC(); +#else + + /* Nested interrupts are not supported in this implementation. If you + * want to implement nested interrupts, you would have to (1) change the + * way that CURRENT_REGS is handled and (2) the design associated with + * CONFIG_ARCH_INTERRUPTSTACK. + */ + + /* Current regs non-zero indicates that we are processing an interrupt; + * CURRENT_REGS is also used to manage interrupt level context switches. + */ + + if (CURRENT_REGS == NULL) + { + CURRENT_REGS = regs; + regs = NULL; + } + + /* Acknowledge the interrupt */ + + arm_ack_irq(irq); + + /* Deliver the IRQ */ + + irq_dispatch(irq, (uint32_t *)CURRENT_REGS); + + /* If a context switch occurred while processing the interrupt then + * CURRENT_REGS may have change value. If we return any value different + * from the input regs, then the lower level will know that a context + * switch occurred during interrupt processing. + */ + + if (regs == NULL) + { + /* Restore the cpu lock */ + + if (regs != CURRENT_REGS) + { + restore_critical_section(); + regs = (uint32_t *)CURRENT_REGS; + } + + /* Update the CURRENT_REGS to NULL. */ + + CURRENT_REGS = NULL; + } +#endif + + board_autoled_off(LED_INIRQ); + return regs; +} + /**************************************************************************** * Name: tc32_getirq *