aboutsummaryrefslogtreecommitdiff
path: root/target-i386/machine.c
diff options
context:
space:
mode:
authorJan Kiszka <jan.kiszka@web.de>2009-07-02 09:11:37 +0200
committerBlue Swirl <blauwirbel@gmail.com>2009-07-02 17:07:08 +0000
commit6ad8702a77edbc2f4da9ae9424c65c2c8c9bf7ed (patch)
tree87eb62d85a7ac106e640cfff041f26ab34a61d52 /target-i386/machine.c
parent1447379b135f2d2428269d2da043b468aed9c6a3 (diff)
Use ctz64 in favor of ffsll
Not all host platforms support ffsll. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Diffstat (limited to 'target-i386/machine.c')
-rw-r--r--target-i386/machine.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/target-i386/machine.c b/target-i386/machine.c
index 259302cb0e..2a72b017f0 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;
}
}