diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2011-04-06 23:01:06 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2011-04-06 23:01:06 +0000 |
commit | 8285ffad2245a53de14c65913b00dab5568f0afc (patch) | |
tree | a4707d8f1e51d31b1fc2866c63260bfbf99b1f34 /nuttx/arch/arm/src/imx | |
parent | dcea5f0360725d2c25b61eefe9db7b2474b26dd6 (diff) | |
download | px4-nuttx-8285ffad2245a53de14c65913b00dab5568f0afc.tar.gz px4-nuttx-8285ffad2245a53de14c65913b00dab5568f0afc.tar.bz2 px4-nuttx-8285ffad2245a53de14c65913b00dab5568f0afc.zip |
current_regs should be volatile; add support for nested interrupts; enable interrupts during syscall processing
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@3475 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/arch/arm/src/imx')
-rw-r--r-- | nuttx/arch/arm/src/imx/imx_decodeirq.c | 11 | ||||
-rw-r--r-- | nuttx/arch/arm/src/imx/imx_irq.c | 4 |
2 files changed, 10 insertions, 5 deletions
diff --git a/nuttx/arch/arm/src/imx/imx_decodeirq.c b/nuttx/arch/arm/src/imx/imx_decodeirq.c index 96a40fd4a..55c72ed76 100644 --- a/nuttx/arch/arm/src/imx/imx_decodeirq.c +++ b/nuttx/arch/arm/src/imx/imx_decodeirq.c @@ -2,7 +2,7 @@ * arch/arm/src/imx/imx_decodeirq.c * arch/arm/src/chip/imx_decodeirq.c * - * Copyright (C) 2009 Gregory Nutt. All rights reserved. + * Copyright (C) 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 @@ -78,6 +78,7 @@ void up_decodeirq(uint32_t* regs) current_regs = regs; PANIC(OSERR_ERREXCEPTION); #else + uint32_t* savestate; uint32_t regval; int irq; @@ -85,6 +86,7 @@ void up_decodeirq(uint32_t* regs) * current_regs is also used to manage interrupt level context switches. */ + savestate = (uint32_t*)current_regs; current_regs = regs; /* Loop while there are pending interrupts to be processed */ @@ -124,8 +126,11 @@ void up_decodeirq(uint32_t* regs) } while (irq < NR_IRQS); - /* Indicate that we are no longer 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/imx/imx_irq.c b/nuttx/arch/arm/src/imx/imx_irq.c index b346064c5..934a60f0b 100644 --- a/nuttx/arch/arm/src/imx/imx_irq.c +++ b/nuttx/arch/arm/src/imx/imx_irq.c @@ -2,7 +2,7 @@ * arch/arm/src/imc/imx_irq.c * arch/arm/src/chip/imx_irq.c * - * Copyright (C) 2009 Gregory Nutt. All rights reserved. + * Copyright (C) 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 @@ -56,7 +56,7 @@ * Public Data ****************************************************************************/ -uint32_t *current_regs; +volatile uint32_t *current_regs; /**************************************************************************** * Private Data |