summary refs log tree commit diff stats
path: root/include/qemu/int128.h
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2014-06-03 14:37:43 +0100
committerPeter Maydell <peter.maydell@linaro.org>2014-06-03 14:37:43 +0100
commite00fcfeab3d452cba3d0a08991a39ab15df66424 (patch)
tree443d02c8e6f51f9b6edff482d16ca116519bb030 /include/qemu/int128.h
parent278073ba293d2b78641505f9c40e6f37c4a2f024 (diff)
parent5e70018b00dbe59a96b80933a0dd308ee1ec4488 (diff)
downloadfocaccia-qemu-e00fcfeab3d452cba3d0a08991a39ab15df66424.tar.gz
focaccia-qemu-e00fcfeab3d452cba3d0a08991a39ab15df66424.zip
Merge remote-tracking branch 'remotes/awilliam/tags/vfio-pci-for-qemu-20140602.0' into staging
VFIO patches: realtek NIC quirk + SPAPR IOMMU AddressSpace support

# gpg: Signature made Mon 02 Jun 2014 22:44:42 BST using RSA key ID 3BB08B22
# gpg: Can't check signature: public key not found

* remotes/awilliam/tags/vfio-pci-for-qemu-20140602.0:
  vfio: Add guest side IOMMU support
  vfio: Create VFIOAddressSpace objects as needed
  vfio: Introduce VFIO address spaces
  vfio: Rework to have error paths
  vfio: Fix 128 bit handling
  int128: Add int128_exts64()
  memory: Sanity check that no listeners remain on a destroyed AddressSpace
  vfio-pci: Quirk RTL8168 NIC

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'include/qemu/int128.h')
-rw-r--r--include/qemu/int128.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/qemu/int128.h b/include/qemu/int128.h
index f59703143a..fb782aaddd 100644
--- a/include/qemu/int128.h
+++ b/include/qemu/int128.h
@@ -38,6 +38,11 @@ static inline Int128 int128_2_64(void)
     return (Int128) { 0, 1 };
 }
 
+static inline Int128 int128_exts64(int64_t a)
+{
+    return (Int128) { .lo = a, .hi = (a < 0) ? -1 : 0 };
+}
+
 static inline Int128 int128_and(Int128 a, Int128 b)
 {
     return (Int128) { a.lo & b.lo, a.hi & b.hi };