summaryrefslogtreecommitdiff
path: root/nuttx/arch/mips/src/pic32mx/excptmacros.h
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2011-11-18 22:37:27 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2011-11-18 22:37:27 +0000
commit4c9dba435f3e93077bd3c9d68894f025db83e1cb (patch)
tree2c82194f36f24ffcc743eff72603bdaee78e7735 /nuttx/arch/mips/src/pic32mx/excptmacros.h
parent133a0934d05d6ffa700582e77c756ffdb188c825 (diff)
downloadpx4-nuttx-4c9dba435f3e93077bd3c9d68894f025db83e1cb.tar.gz
px4-nuttx-4c9dba435f3e93077bd3c9d68894f025db83e1cb.tar.bz2
px4-nuttx-4c9dba435f3e93077bd3c9d68894f025db83e1cb.zip
More PIC32 fixes
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4101 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/arch/mips/src/pic32mx/excptmacros.h')
-rw-r--r--nuttx/arch/mips/src/pic32mx/excptmacros.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/nuttx/arch/mips/src/pic32mx/excptmacros.h b/nuttx/arch/mips/src/pic32mx/excptmacros.h
index 4a5e9f54d..316ead31c 100644
--- a/nuttx/arch/mips/src/pic32mx/excptmacros.h
+++ b/nuttx/arch/mips/src/pic32mx/excptmacros.h
@@ -114,6 +114,7 @@
* bits (Status<15:10>) and the ErrorEPC register, respectively, on the stack. ..."
*/
+#ifdef CONFIG_PIC32MX_NESTED_INTERRUPTS // Does not work!
mfc0 k0, MIPS32_CP0_CAUSE
mfc0 k1, MIPS32_CP0_EPC
@@ -148,6 +149,25 @@
/* And Enable interrupts */
mtc0 k1, MIPS32_CP0_STATUS
+#else
+ /* Get the EPC and STATUS register (Don't bother with the CAUSE register if we are
+ * not supporting nested interrupts)
+ */
+
+ mfc0 k0, MIPS32_CP0_EPC
+ mfc0 k1, MIPS32_CP0_STATUS
+
+ /* Create the register context stack frame large enough to hold the entire register
+ * save array.
+ */
+
+ addiu sp, sp, -XCPTCONTEXT_SIZE
+
+ /* Save the EPC and STATUS in the register context array */
+
+ sw k0, REG_EPC(sp)
+ sw k1, REG_STATUS(sp)
+#endif
/* Save floating point registers */
@@ -315,6 +335,10 @@
lw gp, REG_GP(k1)
#endif
+ /* $29 = sp: Stack pointer */
+
+ lw sp, REG_SP(k1)
+
/* $30 = either s8 or fp: Depends if a frame pointer is used or not */
lw s8, REG_S8(k1)