summaryrefslogtreecommitdiffstats
path: root/main/qemu/qemu-170-ffsll.patch
diff options
context:
space:
mode:
Diffstat (limited to 'main/qemu/qemu-170-ffsll.patch')
-rw-r--r--main/qemu/qemu-170-ffsll.patch18
1 files changed, 18 insertions, 0 deletions
diff --git a/main/qemu/qemu-170-ffsll.patch b/main/qemu/qemu-170-ffsll.patch
new file mode 100644
index 000000000..c5a66426b
--- /dev/null
+++ b/main/qemu/qemu-170-ffsll.patch
@@ -0,0 +1,18 @@
+--- qemu-1.7.0.org/hw/virtio/vhost.c
++++ qemu-1.7.0/hw/virtio/vhost.c
+@@ -22,6 +22,15 @@
+ #include "exec/address-spaces.h"
+ #include "hw/virtio/virtio-bus.h"
+
++#ifndef HAVE_FFSLL
++static int ffsll(long long i) {
++ unsigned long long x = i & -i;
++ if (x <= 0xffffffff) return ffs (i);
++ else return 32 + ffs (i >> 32);
++}
++#endif
++
++
+ static void vhost_dev_sync_region(struct vhost_dev *dev,
+ MemoryRegionSection *section,
+ uint64_t mfirst, uint64_t mlast,