qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] Use ffs in favor of ffsll
@ 2009-07-01 20:22 Jan Kiszka
  2009-07-01 20:27 ` [Qemu-devel] " Blue Swirl
  0 siblings, 1 reply; 12+ messages in thread
From: Jan Kiszka @ 2009-07-01 20:22 UTC (permalink / raw)
  To: Anthony Liguori, Blue Swirl; +Cc: qemu-devel

[-- Attachment #1: Type: text/plain, Size: 1044 bytes --]

Not all host platforms support the ll variant. This is not a critical
path, so go the easy way.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---

 target-i386/machine.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/target-i386/machine.c b/target-i386/machine.c
index 259302c..4ab154c 100644
--- a/target-i386/machine.c
+++ b/target-i386/machine.c
@@ -147,10 +147,10 @@ void cpu_save(QEMUFile *f, void *opaque)
     /* There can only be one pending IRQ set in the bitmap at a time, so try
        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]);
+    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;
             break;
         }
     }


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 257 bytes --]

^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2009-07-04  7:16 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-01 20:22 [Qemu-devel] [PATCH] Use ffs in favor of ffsll Jan Kiszka
2009-07-01 20:27 ` [Qemu-devel] " Blue Swirl
2009-07-01 20:35   ` Jan Kiszka
2009-07-01 20:55     ` [Qemu-devel] [PATCH v2] " Jan Kiszka
2009-07-01 20:58       ` Nathan Froyd
2009-07-01 22:24         ` [Qemu-devel] " Jan Kiszka
2009-07-01 23:02         ` [Qemu-devel] " Stuart Brady
2009-07-02  7:04           ` [Qemu-devel] [PATCH] Use ctz64 " Jan Kiszka
2009-07-02  7:11             ` [Qemu-devel] [PATCH v2] " Jan Kiszka
2009-07-03  9:35               ` Paul Brook
2009-07-04  7:16                 ` Jan Kiszka
2009-07-02  8:39   ` [Qemu-devel] Re: [PATCH] Use ffs " Christoph Egger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).