From 39ed7087b344eaed04bae81e12e2bb3cd4264787 Mon Sep 17 00:00:00 2001 From: Michael Sevakis Date: Sun, 27 Apr 2008 22:01:25 +0000 Subject: IMX31: Try to catch the interrupt that was the reason irq_handler was called since it never should be. The bootloader occasionally shows one but it's not saying what. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17271 a1c6a512-1295-4272-9138-f99709370657 --- firmware/target/arm/imx31/gigabeat-s/avic-imx31.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/firmware/target/arm/imx31/gigabeat-s/avic-imx31.c b/firmware/target/arm/imx31/gigabeat-s/avic-imx31.c index ce2932a13f..9205c2e442 100644 --- a/firmware/target/arm/imx31/gigabeat-s/avic-imx31.c +++ b/firmware/target/arm/imx31/gigabeat-s/avic-imx31.c @@ -46,7 +46,7 @@ static const char * avic_int_names[64] = void UIE_VECTOR(void) { int mode; - long offset; + int offset; asm volatile ( "mrs %0, cpsr \n" /* Mask core IRQ/FIQ */ @@ -56,9 +56,10 @@ void UIE_VECTOR(void) : "=&r"(mode) ); - offset = mode == 0x11 ? (long)FIVECSR : ((long)NIVECSR >> 16); + offset = mode == 0x11 ? + (int32_t)FIVECSR : ((int32_t)NIVECSR >> 16); - panicf("Unhandled %s %ld: %s", + panicf("Unhandled %s %d: %s", mode == 0x11 ? "FIQ" : "IRQ", offset, offset >= 0 ? avic_int_names[offset] : ""); } @@ -66,7 +67,10 @@ void UIE_VECTOR(void) /* We use the AVIC */ void __attribute__((naked)) irq_handler(void) { - panicf("Unhandled IRQ in irq_handler"); + const int offset = (int32_t)NIVECSR >> 16; + disable_interrupt(IRQ_FIQ_STATUS); + panicf("Unhandled IRQ %d in irq_handler: %s", offset, + offset >= 0 ? avic_int_names[offset] : ""); } /* Accoring to section 9.3.5 of the UM, the AVIC doesn't accelerate -- cgit v1.2.3