From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MMGSR-00054j-8M for qemu-devel@nongnu.org; Thu, 02 Jul 2009 03:11:47 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MMGSL-00053W-HK for qemu-devel@nongnu.org; Thu, 02 Jul 2009 03:11:46 -0400 Received: from [199.232.76.173] (port=56192 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MMGSL-00053T-Dt for qemu-devel@nongnu.org; Thu, 02 Jul 2009 03:11:41 -0400 Received: from mx20.gnu.org ([199.232.41.8]:46241) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MMGSK-0000bS-U6 for qemu-devel@nongnu.org; Thu, 02 Jul 2009 03:11:41 -0400 Received: from fmmailgate03.web.de ([217.72.192.234]) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MMGSK-0006Vs-7p for qemu-devel@nongnu.org; Thu, 02 Jul 2009 03:11:40 -0400 Message-ID: <4A4C5DA9.8020909@web.de> Date: Thu, 02 Jul 2009 09:11:37 +0200 From: Jan Kiszka MIME-Version: 1.0 References: <4A4BC57E.504@web.de> <4A4BC87A.6050005@web.de> <4A4BCD26.2060102@web.de> <20090701205802.GA11286@codesourcery.com> <20090701230216.GA14043@miranda.arrow> <4A4C5C0E.2050502@web.de> In-Reply-To: <4A4C5C0E.2050502@web.de> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Sender: jan.kiszka@web.de Subject: [Qemu-devel] [PATCH v2] Use ctz64 in favor of ffsll List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stuart Brady Cc: Anthony Liguori , qemu-devel@nongnu.org Not all host platforms support ffsll. Signed-off-by: Jan Kiszka --- target-i386/machine.c | 7 ++++--- 1 files changed, 4 insertions(+), 3 deletions(-) diff --git a/target-i386/machine.c b/target-i386/machine.c index 259302c..2a72b01 100644 --- a/target-i386/machine.c +++ b/target-i386/machine.c @@ -2,6 +2,7 @@ #include "hw/boards.h" #include "hw/pc.h" #include "hw/isa.h" +#include "host-utils.h" #include "exec-all.h" #include "kvm.h" @@ -148,9 +149,9 @@ void cpu_save(QEMUFile *f, void *opaque) to find it and save its number instead (-1 for none). */ pending_irq = -1; for (i = 0; i < ARRAY_SIZE(env->interrupt_bitmap); i++) { - bit = ffsll(env->interrupt_bitmap[i]); - if (bit) { - pending_irq = i * 64 + bit - 1; + if (env->interrupt_bitmap[i]) { + bit = ctz64(env->interrupt_bitmap[i]); + pending_irq = i * 64 + bit; break; } }