[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [5876] hw/apic.c: use fls() from host-utils
From: |
Aurelien Jarno |
Subject: |
[Qemu-devel] [5876] hw/apic.c: use fls() from host-utils |
Date: |
Thu, 04 Dec 2008 20:57:02 +0000 |
Revision: 5876
http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=5876
Author: aurel32
Date: 2008-12-04 20:57:02 +0000 (Thu, 04 Dec 2008)
Log Message:
-----------
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 <address@hidden>
Modified Paths:
--------------
trunk/hw/apic.c
Modified: trunk/hw/apic.c
===================================================================
--- trunk/hw/apic.c 2008-12-04 20:35:16 UTC (rev 5875)
+++ trunk/hw/apic.c 2008-12-04 20:57:02 UTC (rev 5876)
@@ -105,12 +105,6 @@
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 @@
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;
- [Qemu-devel] [5876] hw/apic.c: use fls() from host-utils,
Aurelien Jarno <=