diff options
Diffstat (limited to 'nuttx/arch/arm/src/lpc214x/lpc214x_decodeirq.c')
-rw-r--r-- | nuttx/arch/arm/src/lpc214x/lpc214x_decodeirq.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/nuttx/arch/arm/src/lpc214x/lpc214x_decodeirq.c b/nuttx/arch/arm/src/lpc214x/lpc214x_decodeirq.c index dc76509a9..6317066c3 100644 --- a/nuttx/arch/arm/src/lpc214x/lpc214x_decodeirq.c +++ b/nuttx/arch/arm/src/lpc214x/lpc214x_decodeirq.c @@ -1,7 +1,7 @@ /******************************************************************************** * arch/arm/src/lpc214x/lpc214x_decodeirq.c * - * Copyright (C) 2007-2009 Gregory Nutt. All rights reserved. + * Copyright (C) 2007-2009, 2011 Gregory Nutt. All rights reserved. * Author: Gregory Nutt <spudmonkey@racsa.co.cr> * * Redistribution and use in source and binary forms, with or without @@ -145,19 +145,25 @@ static void lpc214x_decodeirq( uint32_t *regs) if (irq < NR_IRQS) { + uint32_t *savestate; + /* Current regs non-zero indicates that we are processing an interrupt; * current_regs is also used to manage interrupt level context switches. */ + savestate = (uint32_t*)current_regs; current_regs = regs; /* Deliver the IRQ */ irq_dispatch(irq, regs); - /* Indicate that we are no long in an interrupt handler */ + /* Restore the previous value of current_regs. NULL would indicate that + * we are no longer in an interrupt handler. It will be non-NULL if we + * are returning from a nested interrupt. + */ - current_regs = NULL; + current_regs = savestate; } #endif } |