summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRafaël Carré <rafael.carre@gmail.com>2010-05-25 16:20:04 +0000
committerRafaël Carré <rafael.carre@gmail.com>2010-05-25 16:20:04 +0000
commit873dd7becce840fec815b12d43759924bf4ada4c (patch)
treea4e9c251f4dcf54fd49245aba13c2dfd5a9b494e
parent02068ed6cd647a1560da0bb429397342c0cdeb31 (diff)
downloadrockbox-873dd7becce840fec815b12d43759924bf4ada4c.zip
rockbox-873dd7becce840fec815b12d43759924bf4ada4c.tar.gz
rockbox-873dd7becce840fec815b12d43759924bf4ada4c.tar.bz2
rockbox-873dd7becce840fec815b12d43759924bf4ada4c.tar.xz
as3525: find_first_set_bit() isn't built in bootloaders
We assume only one bit is set and use clz to find the most significant set bit, if there's more than one bit set we'll see it in the panic msg git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26285 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--firmware/target/arm/as3525/system-as3525.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/firmware/target/arm/as3525/system-as3525.c b/firmware/target/arm/as3525/system-as3525.c
index f215300..8a04507 100644
--- a/firmware/target/arm/as3525/system-as3525.c
+++ b/firmware/target/arm/as3525/system-as3525.c
@@ -98,7 +98,7 @@ static void UIRQ(void)
if(status == 0)
panicf("Unhandled IRQ (source unknown!)");
- unsigned irq_no = find_first_set_bit(status);
+ unsigned irq_no = 31 - __builtin_clz(status);
panicf("Unhandled %smasked IRQ %02X: %s (status 0x%8X)",
masked ? "" : "no", irq_no, irqname[irq_no], status);