Skip to contentSkip to conversation

[5890] Revert "hw/apic.c: use fls() from host-utils"

Qemu-devel Aurelien Jarno 1 participant 1 message Dec 6, 2008

lore
Share & tools
lore
#0 lore raw

Revision: 5890

          http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=5890
Author:   aurel32
Date:     2008-12-06 10:46:35 +0000 (Sat, 06 Dec 2008)

Log Message:
-----------
Revert "hw/apic.c: use fls() from host-utils"

This reverts commit 5876.

Modified Paths:
--------------
trunk/hw/apic.c

Modified: trunk/hw/apic.c
===================================================================

hw/apic.c +7 -1
@@ -105,6 +105,12 @@
 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)
 {
@@ -300,7 +306,7 @@
     int i;
     for(i = 7; i >= 0; i--) {
         if (tab[i] != 0) {
-            return i * 32 + fls(tab[i]);
+            return i * 32 + fls_bit(tab[i]);
         }
     }
     return -1;