diff options
Diffstat (limited to 'nuttx/arch/c5471/src/up_doirq.c')
-rw-r--r-- | nuttx/arch/c5471/src/up_doirq.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/nuttx/arch/c5471/src/up_doirq.c b/nuttx/arch/c5471/src/up_doirq.c index f4e07873c..ab1b40d65 100644 --- a/nuttx/arch/c5471/src/up_doirq.c +++ b/nuttx/arch/c5471/src/up_doirq.c @@ -74,6 +74,13 @@ void up_doirq(int irq, uint32* regs) #else if ((unsigned)irq < NR_IRQS) { + /* Current regs non-zero indicates that we are processing + * an interrupt; current_regs is also used to manage + * interrupt level context switches. + */ + + current_regs = regs; + /* Mask and acknowledge the interrupt */ up_maskack_irq(irq); @@ -82,8 +89,15 @@ void up_doirq(int irq, uint32* regs) irq_dispatch(irq, regs); - /* Then unmask it */ + /* Indicate that we are no long in an interrupt handler */ + + current_regs = NULL; + + /* Unmask the last interrupt (global interrupts are still + * disabled. + */ + current_regs = NULL; up_enable_irq(irq); } up_ledoff(LED_INIRQ); |