[5876] hw/apic.c: use fls() from host-utils
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.
Modified Paths:
--------------
trunk/hw/apic.c
Modified: trunk/hw/apic.c
===================================================================
hw/apic.c +1 -7
@@ -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 ;
Quoted 5 lines · Aurelien Jarno
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)
Quoted 8 lines
Log Message:
-----------hw/apic.c: usefls()from host-utils...and fix a bug, the implementation in
hw/apic.cwas wrong.Signed-off-by Aurelien Jarno <[email protected]>
I just bisected a broken Linux guest to this changeset. I think it should be fls() - 1.
Regards,
Anthony Liguori
Am 05.12.2008 um 21:39 schrieb Anthony Liguori:
Quoted 10 lines
Quoted 9 lines · Aurelien Jarno
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: usefls()from host-utils
Quoted 6 lines
Quoted 4 lines
...and fix a bug, the implementation in
hw/apic.cwas wrong.Signed-off-by Aurelien Jarno <[email protected]>I just bisected a broken Linux guest to this changeset. I think it should be
fls()- 1.
That unbreaks Haiku guests as well.
Andreas