qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


From: Aurelien Jarno
Subject: [Qemu-devel] [5890] Revert "hw/apic.c: use fls() from host-utils"
Date: Sat, 06 Dec 2008 10:46:36 +0000

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.

Signed-off-by: Aurelien Jarno <address@hidden>

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

Modified: trunk/hw/apic.c
===================================================================
--- trunk/hw/apic.c     2008-12-05 20:05:26 UTC (rev 5889)
+++ trunk/hw/apic.c     2008-12-06 10:46:35 UTC (rev 5890)
@@ -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;






reply via email to

[Prev in Thread] Current Thread [Next in Thread]