From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1L8ugK-0000Px-Cb for qemu-devel@nongnu.org; Sat, 06 Dec 2008 05:46:40 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1L8ugH-0000PU-Q9 for qemu-devel@nongnu.org; Sat, 06 Dec 2008 05:46:39 -0500 Received: from [199.232.76.173] (port=38879 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1L8ugH-0000PP-Ft for qemu-devel@nongnu.org; Sat, 06 Dec 2008 05:46:37 -0500 Received: from savannah.gnu.org ([199.232.41.3]:46263 helo=sv.gnu.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1L8ugH-0007WN-6r for qemu-devel@nongnu.org; Sat, 06 Dec 2008 05:46:37 -0500 Received: from cvs.savannah.gnu.org ([199.232.41.69]) by sv.gnu.org with esmtp (Exim 4.63) (envelope-from ) id 1L8ugG-0006pX-Dn for qemu-devel@nongnu.org; Sat, 06 Dec 2008 10:46:36 +0000 Received: from aurel32 by cvs.savannah.gnu.org with local (Exim 4.63) (envelope-from ) id 1L8ugG-0006pT-14 for qemu-devel@nongnu.org; Sat, 06 Dec 2008 10:46:36 +0000 MIME-Version: 1.0 Errors-To: aurel32 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Aurelien Jarno Message-Id: Date: Sat, 06 Dec 2008 10:46:36 +0000 Subject: [Qemu-devel] [5890] Revert "hw/apic.c: use fls() from host-utils" Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org 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 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;