aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoraurel32 <aurel32@c046a42c-6fe2-441c-8c8c-71466251a162>2008-12-04 20:57:02 +0000
committeraurel32 <aurel32@c046a42c-6fe2-441c-8c8c-71466251a162>2008-12-04 20:57:02 +0000
commitd34ca5901630dca45f105bbe1a80b51fbb8c4284 (patch)
tree0e353f02725d1c0f30bceadf9f853d72eb7d5b99
parentd096ab91c9cdcb89ec97b8fcff4142204f529a4c (diff)
hw/apic.c: use fls() from host-utils
...and fix a bug, the implementation in hw/apic.c was wrong. Signed-off-by: Aurelien Jarno <aurelien@aurel32.net> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5876 c046a42c-6fe2-441c-8c8c-71466251a162
-rw-r--r--hw/apic.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/hw/apic.c b/hw/apic.c
index a2915f8121..626f72fd0e 100644
--- a/hw/apic.c
+++ b/hw/apic.c
@@ -105,12 +105,6 @@ static void apic_init_ipi(APICState *s);
static void apic_set_irq(APICState *s, int vector_num, int trigger_mode);
static void apic_update_irq(APICState *s);
-/* Find first bit starting from msb */
-static int fls_bit(uint32_t value)
-{
- return 31 - clz32(value);
-}
-
/* Find first bit starting from lsb */
static int ffs_bit(uint32_t value)
{
@@ -306,7 +300,7 @@ static int get_highest_priority_int(uint32_t *tab)
int i;
for(i = 7; i >= 0; i--) {
if (tab[i] != 0) {
- return i * 32 + fls_bit(tab[i]);
+ return i * 32 + fls(tab[i]);
}
}
return -1;