* [Qemu-devel] [5890] Revert "hw/apic.c: use fls() from host-utils"
@ 2008-12-06 10:46 Aurelien Jarno
0 siblings, 0 replies; only message in thread
From: Aurelien Jarno @ 2008-12-06 10:46 UTC (permalink / raw)
To: qemu-devel
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 <aurelien@aurel32.net>
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;
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2008-12-06 10:46 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-12-06 10:46 [Qemu-devel] [5890] Revert "hw/apic.c: use fls() from host-utils" Aurelien Jarno
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).