diff options
author | patacongo <patacongo@7fd9a85b-ad96-42d3-883c-3090e2eb8679> | 2011-04-06 23:01:06 +0000 |
---|---|---|
committer | patacongo <patacongo@7fd9a85b-ad96-42d3-883c-3090e2eb8679> | 2011-04-06 23:01:06 +0000 |
commit | d8ab80ccef6b4f340bdc54e90f38b7ac98219a6e (patch) | |
tree | a4707d8f1e51d31b1fc2866c63260bfbf99b1f34 /nuttx/arch/arm/src/lpc214x | |
parent | 0b6e9f33f5e5e03930da93c254d596857b3c58b8 (diff) |
current_regs should be volatile; add support for nested interrupts; enable interrupts during syscall processing
git-svn-id: https://nuttx.svn.sourceforge.net/svnroot/nuttx/trunk@3475 7fd9a85b-ad96-42d3-883c-3090e2eb8679
Diffstat (limited to 'nuttx/arch/arm/src/lpc214x')
-rw-r--r-- | nuttx/arch/arm/src/lpc214x/lpc214x_decodeirq.c | 12 | ||||
-rw-r--r-- | nuttx/arch/arm/src/lpc214x/lpc214x_irq.c | 4 |
2 files changed, 11 insertions, 5 deletions
diff --git a/nuttx/arch/arm/src/lpc214x/lpc214x_decodeirq.c b/nuttx/arch/arm/src/lpc214x/lpc214x_decodeirq.c index dc76509a9b..6317066c3f 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 } diff --git a/nuttx/arch/arm/src/lpc214x/lpc214x_irq.c b/nuttx/arch/arm/src/lpc214x/lpc214x_irq.c index 9d8ed817bc..a8b91037c8 100644 --- a/nuttx/arch/arm/src/lpc214x/lpc214x_irq.c +++ b/nuttx/arch/arm/src/lpc214x/lpc214x_irq.c @@ -1,7 +1,7 @@ /**************************************************************************** * arch/arm/src/lpc214x/lpc214x_irq.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 @@ -59,7 +59,7 @@ * Public Data ****************************************************************************/ -uint32_t *current_regs; +volatile uint32_t *current_regs; /**************************************************************************** * Private Data |