From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MM6Xm-0004Mz-DL for qemu-devel@nongnu.org; Wed, 01 Jul 2009 16:36:38 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MM6Xh-0004LG-TN for qemu-devel@nongnu.org; Wed, 01 Jul 2009 16:36:38 -0400 Received: from [199.232.76.173] (port=60903 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MM6Xh-0004LD-O8 for qemu-devel@nongnu.org; Wed, 01 Jul 2009 16:36:33 -0400 Received: from fmmailgate03.web.de ([217.72.192.234]:43270) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MM6Xh-0005e6-Dw for qemu-devel@nongnu.org; Wed, 01 Jul 2009 16:36:33 -0400 Message-ID: <4A4BC87A.6050005@web.de> Date: Wed, 01 Jul 2009 22:35:06 +0200 From: Jan Kiszka MIME-Version: 1.0 References: <4A4BC57E.504@web.de> In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enig777D4909F1BC9E3ED610879C" Sender: jan.kiszka@web.de 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: Blue Swirl Cc: Anthony Liguori , qemu-devel This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig777D4909F1BC9E3ED610879C Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Blue Swirl wrote: > 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. >=20 >> - for (i =3D 0; i < ARRAY_SIZE(env->interrupt_bitmap); i++) { >> - bit =3D ffsll(env->interrupt_bitmap[i]); >> + for (i =3D 0; i < sizeof(env->interrupt_bitmap) / sizeof(int); i= ++) { >> + bit =3D ffs(((int *)env->interrupt_bitmap)[i]); >> if (bit) { >> - pending_irq =3D i * 64 + bit - 1; >> + pending_irq =3D i * 8 * sizeof(int) + bit - 1; >=20 > I think this will not work on a big endian host. Right, may theoretically bite us once we are able to migrate between kvm and tcg. Will send a better version nevertheless. Jan --------------enig777D4909F1BC9E3ED610879C Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.9 (GNU/Linux) Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org iEYEARECAAYFAkpLyH8ACgkQniDOoMHTA+la6wCfV0xvMuz27rWb5lys9FM+mh5e 0RMAn0dHbTyXtt0vwf/W48UrVlDjh3M3 =jV2U -----END PGP SIGNATURE----- --------------enig777D4909F1BC9E3ED610879C--