diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2011-12-22 22:50:41 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2011-12-22 22:50:41 +0000 |
commit | 65e06691366f04996013a254b7ac306f075141a7 (patch) | |
tree | f06f589088d470b507da58787fd9df49b9e3b06c /nuttx/arch/mips/src/mips32/up_swint0.c | |
parent | c1cec70f7ea9e4ec9272a369f44ce28166ca60d2 (diff) | |
download | px4-nuttx-65e06691366f04996013a254b7ac306f075141a7.tar.gz px4-nuttx-65e06691366f04996013a254b7ac306f075141a7.tar.bz2 px4-nuttx-65e06691366f04996013a254b7ac306f075141a7.zip |
PIC32, need to clear SW interrupt bit in CAUSE register
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4218 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/arch/mips/src/mips32/up_swint0.c')
-rw-r--r-- | nuttx/arch/mips/src/mips32/up_swint0.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/nuttx/arch/mips/src/mips32/up_swint0.c b/nuttx/arch/mips/src/mips32/up_swint0.c index 443f81cfc..6929d0b12 100644 --- a/nuttx/arch/mips/src/mips32/up_swint0.c +++ b/nuttx/arch/mips/src/mips32/up_swint0.c @@ -45,9 +45,11 @@ #include <assert.h> #include <debug.h> -#include <arch/irq.h> #include <nuttx/sched.h> +#include <arch/irq.h> +#include <arch/mips32/cp0.h> + #include "up_internal.h" /**************************************************************************** @@ -268,6 +270,7 @@ static inline void dispatch_syscall(uint32_t *regs) int up_swint0(int irq, FAR void *context) { uint32_t *regs = (uint32_t*)context; + uint32_t cause; DEBUGASSERT(regs && regs == current_regs); @@ -359,9 +362,15 @@ int up_swint0(int irq, FAR void *context) } #endif - /* Clear the pending software interrupt 0 */ + /* Clear the pending software interrupt 0 in the PIC32 interrupt block */ up_clrpend_irq(PIC32MX_IRQSRC_CS0); - + + /* And reset the software interrupt bit in the MIPS CAUSE register */ + + cause = cp0_getcause(); + cause &= ~CP0_CAUSE_IP0; + cp0_putcause(cause); + return OK; } |