summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Sevakis <jethead71@rockbox.org>2008-02-05 07:17:56 +0000
committerMichael Sevakis <jethead71@rockbox.org>2008-02-05 07:17:56 +0000
commitc3e73a5f9ee1ec7d0759ee3ce27954e6e653a698 (patch)
treeb327d20d907fe32150d58bb8134c1ccd37e3d3e0
parent2c82494e66a59f5bea0e31eaf66800ca9db6f8c8 (diff)
downloadrockbox-c3e73a5f9ee1ec7d0759ee3ce27954e6e653a698.zip
rockbox-c3e73a5f9ee1ec7d0759ee3ce27954e6e653a698.tar.gz
rockbox-c3e73a5f9ee1ec7d0759ee3ce27954e6e653a698.tar.bz2
rockbox-c3e73a5f9ee1ec7d0759ee3ce27954e6e653a698.tar.xz
Do better job with UIE_VECTOR.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16221 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--firmware/target/arm/imx31/gigabeat-s/avic-imx31.c22
1 files changed, 14 insertions, 8 deletions
diff --git a/firmware/target/arm/imx31/gigabeat-s/avic-imx31.c b/firmware/target/arm/imx31/gigabeat-s/avic-imx31.c
index 4266573..fa74d3b 100644
--- a/firmware/target/arm/imx31/gigabeat-s/avic-imx31.c
+++ b/firmware/target/arm/imx31/gigabeat-s/avic-imx31.c
@@ -45,22 +45,28 @@ static const char * avic_int_names[64] =
static void UIE_VECTOR(void)
{
- set_interrupt_status(IRQ_FIQ_DISABLED, IRQ_FIQ_STATUS);
- long offset = FIVECSR;
- long offsetn = (long)NIVECSR >> 16;
+ int mode;
+ long offset;
- if (offsetn == -1)
- offset = offsetn; /* Could be FIQ */
+ asm volatile (
+ "mrs %0, cpsr \n" /* Mask core IRQ/FIQ */
+ "orr %0, %0, #0xc0 \n"
+ "msr cpsr_c, %0 \n"
+ "and %0, %0, #0x1f \n" /* Get mode bits */
+ : "=&r"(mode)
+ );
+
+ offset = mode == 0x11 ? (long)FIVECSR : ((long)NIVECSR >> 16);
panicf("Unhandled %s %ld: %s",
- offsetn >= 0 ? "IRQ" : "FIQ", offset,
- offset >= 0 ? avic_int_names[offset] : "");
+ mode == 0x11 ? "FIQ" : "IRQ", offset,
+ offset >= 0 ? avic_int_names[offset] : "<Unknown>");
}
/* We use the AVIC */
void __attribute__((naked)) irq_handler(void)
{
- panicf("Unhandled IRQ");
+ panicf("Unhandled IRQ in irq_handler");
}
/* Accoring to section 9.3.5 of the UM, the AVIC doesn't accelerate