From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MM6PN-0006Wj-Jp for qemu-devel@nongnu.org; Wed, 01 Jul 2009 16:27:57 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MM6PI-0006Ol-RX for qemu-devel@nongnu.org; Wed, 01 Jul 2009 16:27:56 -0400 Received: from [199.232.76.173] (port=56375 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MM6PI-0006OL-Fo for qemu-devel@nongnu.org; Wed, 01 Jul 2009 16:27:52 -0400 Received: from mail-fx0-f211.google.com ([209.85.220.211]:55734) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MM6PI-0004EB-FN for qemu-devel@nongnu.org; Wed, 01 Jul 2009 16:27:52 -0400 Received: by fxm7 with SMTP id 7so1003299fxm.34 for ; Wed, 01 Jul 2009 13:27:51 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <4A4BC57E.504@web.de> References: <4A4BC57E.504@web.de> Date: Wed, 1 Jul 2009 23:27:51 +0300 Message-ID: From: Blue Swirl Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] Re: [PATCH] Use ffs in favor of ffsll List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Jan Kiszka Cc: Anthony Liguori , qemu-devel On 7/1/09, Jan Kiszka wrote: > Not all host platforms support the ll variant. This is not a critical > path, so go the easy way. > - for (i = 0; i < ARRAY_SIZE(env->interrupt_bitmap); i++) { > - bit = ffsll(env->interrupt_bitmap[i]); > + for (i = 0; i < sizeof(env->interrupt_bitmap) / sizeof(int); i++) { > + bit = ffs(((int *)env->interrupt_bitmap)[i]); > if (bit) { > - pending_irq = i * 64 + bit - 1; > + pending_irq = i * 8 * sizeof(int) + bit - 1; I think this will not work on a big endian host.