summaryrefslogtreecommitdiffstats
path: root/firmware/target/mips/ingenic_jz47xx/system-jz4740.c
diff options
context:
space:
mode:
authorMaurus Cuelenaere <mcuelenaere@gmail.com>2008-12-04 21:35:47 +0000
committerMaurus Cuelenaere <mcuelenaere@gmail.com>2008-12-04 21:35:47 +0000
commit9f76f23ca52ec48b5a006d74a7d424956a277ed3 (patch)
tree70d4fd8a7d510f456e8a1541cd1221b198a409b5 /firmware/target/mips/ingenic_jz47xx/system-jz4740.c
parentcea285d64e34f8c2ecce676f6239b59608597019 (diff)
downloadrockbox-9f76f23ca52ec48b5a006d74a7d424956a277ed3.tar.gz
rockbox-9f76f23ca52ec48b5a006d74a7d424956a277ed3.tar.bz2
rockbox-9f76f23ca52ec48b5a006d74a7d424956a277ed3.zip
Oops, logic error! Interrupts enabled != in interrupt mode
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19336 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/target/mips/ingenic_jz47xx/system-jz4740.c')
-rw-r--r--firmware/target/mips/ingenic_jz47xx/system-jz4740.c19
1 files changed, 15 insertions, 4 deletions
diff --git a/firmware/target/mips/ingenic_jz47xx/system-jz4740.c b/firmware/target/mips/ingenic_jz47xx/system-jz4740.c
index bde8e1df6a..f733582d70 100644
--- a/firmware/target/mips/ingenic_jz47xx/system-jz4740.c
+++ b/firmware/target/mips/ingenic_jz47xx/system-jz4740.c
@@ -27,7 +27,6 @@
#include "system-target.h"
#include <string.h>
#include "kernel.h"
-#include "system.h"
#define NUM_DMA 6
#define NUM_GPIO 128
@@ -323,15 +322,26 @@ static int get_irq_number(void)
return irq;
}
+static bool intr_mode = false;
+
+bool in_interrupt_mode(void)
+{
+ return intr_mode;
+}
+
void intr_handler(void)
{
- irq = get_irq_number(); /* irq is defined static at UIRQ() */
- if(UNLIKELY(irq < 0))
+ int irq = get_irq_number();
+ if(irq < 0)
return;
ack_irq(irq);
- if(LIKELY(irq > 0))
+ if(irq > 0)
+ {
+ intr_mode = true;
irqvector[irq-1]();
+ intr_mode = false;
+ }
}
#define EXC(x,y) if(_cause == (x)) return (y);
@@ -368,6 +378,7 @@ void exception_handler(void* stack_ptr, unsigned int cause, unsigned int epc)
static const int FR2n[] = {1, 2, 3, 4, 6, 8, 12, 16, 24, 32};
static unsigned int iclk;
+
static void detect_clock(void)
{
unsigned int cfcr, pllout;