arch/tlsr82: Port arm_doirq to tc32_doirq.c
Solve the dependency on ARMV6M when compiling tlsr8278adk80d:nsh. Signed-off-by: wangming9 <wangming9@xiaomi.com>
This commit is contained in:
parent
eba9c61cad
commit
cedc034d9e
@ -231,6 +231,11 @@ static inline void up_enable_irq(int irq)
|
|||||||
_IRQ_MASK_REG |= (1 << irq);
|
_IRQ_MASK_REG |= (1 << irq);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static inline uint32_t getcontrol(void)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
#endif /* __ASSEMBLY__ */
|
#endif /* __ASSEMBLY__ */
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
|
@ -46,7 +46,7 @@ CMN_ASRCS := $(filter-out $(TC32_ASRCS_FILTER), $(CMN_ASRCS))
|
|||||||
|
|
||||||
# Common files in arch/arm/src/armv6-m
|
# 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
|
# Common files in arch/arm/src/tlsr82/tc32
|
||||||
|
|
||||||
|
@ -55,6 +55,63 @@
|
|||||||
* Private Functions
|
* 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
|
* Name: tc32_getirq
|
||||||
*
|
*
|
||||||
|
Loading…
x
Reference in New Issue
Block a user