summaryrefslogtreecommitdiff
path: root/nuttx/arch/arm/src/lpc17xx
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2010-11-20 00:39:29 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2010-11-20 00:39:29 +0000
commit5eae3bcf7b345513044bceaebede0969bab4946d (patch)
treeb827da1499744d503114c5f538007f93234903f9 /nuttx/arch/arm/src/lpc17xx
parent631c85af1216657895832c12d41625f08911a928 (diff)
downloadpx4-nuttx-5eae3bcf7b345513044bceaebede0969bab4946d.tar.gz
px4-nuttx-5eae3bcf7b345513044bceaebede0969bab4946d.tar.bz2
px4-nuttx-5eae3bcf7b345513044bceaebede0969bab4946d.zip
Fix Cortex-M3 nested interrupt hard fault
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@3119 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/arch/arm/src/lpc17xx')
-rw-r--r--nuttx/arch/arm/src/lpc17xx/lpc17_ethernet.c1
-rwxr-xr-xnuttx/arch/arm/src/lpc17xx/lpc17_vectors.S13
2 files changed, 7 insertions, 7 deletions
diff --git a/nuttx/arch/arm/src/lpc17xx/lpc17_ethernet.c b/nuttx/arch/arm/src/lpc17xx/lpc17_ethernet.c
index dc9c8b2c6..6742b33a2 100644
--- a/nuttx/arch/arm/src/lpc17xx/lpc17_ethernet.c
+++ b/nuttx/arch/arm/src/lpc17xx/lpc17_ethernet.c
@@ -1124,7 +1124,6 @@ static int lpc17_interrupt(int irq, void *context)
lpc17_putreg(ETH_INT_WKUP, LPC17_ETH_INTCLR);
EMAC_STAT(priv, wol);
# warning "Missing logic"
- goto intexit;
}
else
#endif
diff --git a/nuttx/arch/arm/src/lpc17xx/lpc17_vectors.S b/nuttx/arch/arm/src/lpc17xx/lpc17_vectors.S
index ae36da345..ed0f10fad 100755
--- a/nuttx/arch/arm/src/lpc17xx/lpc17_vectors.S
+++ b/nuttx/arch/arm/src/lpc17xx/lpc17_vectors.S
@@ -295,17 +295,18 @@ lpc17_common:
2:
msr msp, r1 /* Recover the return MSP value */
- /* Do we need to restore interrupts? Why not just: msr primask, r3 */
+ /* Restore the interrupt state. Preload r14 with the special return
+ * value first (so that the return actually occurs with interrupts
+ * still disabled).
+ */
- tst r3, #1 /* PRIMASK bit 1=1 means that interrupts are masked */
- bne 3f
- cpsie i /* Restore interrupts */
+ ldr r14, =EXC_RETURN /* Load the special value */
+ msr primask, r3 /* Restore interrupts */
/* Always return with R14 containing the special value that will: (1)
* return to thread mode, and (2) continue to use the MSP
*/
-3:
- ldr r14, =EXC_RETURN /* Load the special value */
+
bx r14 /* And return */
.size handlers, .-handlers