[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 2/6] virtio: introduce virtio_legacy_is_cross_endian
From: |
Greg Kurz |
Subject: |
[Qemu-devel] [PATCH 2/6] virtio: introduce virtio_legacy_is_cross_endian() |
Date: |
Wed, 17 Jun 2015 15:23:34 +0200 |
User-agent: |
StGit/0.17.1-dirty |
This helper will be used by vhost and tap to detect cross-endianness in
the legacy virtio case.
Signed-off-by: Greg Kurz <address@hidden>
---
include/hw/virtio/virtio-access.h | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/include/hw/virtio/virtio-access.h
b/include/hw/virtio/virtio-access.h
index ee28c21fefed..cee5dd70c997 100644
--- a/include/hw/virtio/virtio-access.h
+++ b/include/hw/virtio/virtio-access.h
@@ -32,6 +32,19 @@ static inline bool virtio_access_is_big_endian(VirtIODevice
*vdev)
#endif
}
+static inline bool virtio_legacy_is_cross_endian(VirtIODevice *vdev)
+{
+#ifdef TARGET_IS_BIENDIAN
+#ifdef HOST_WORDS_BIGENDIAN
+ return !virtio_is_big_endian(vdev);
+#else
+ return virtio_is_big_endian(vdev);
+#endif
+#else
+ return false;
+#endif
+}
+
static inline uint16_t virtio_lduw_phys(VirtIODevice *vdev, hwaddr pa)
{
if (virtio_access_is_big_endian(vdev)) {
- [Qemu-devel] [PATCH 0/6] vhost: cross-endian support, Greg Kurz, 2015/06/17
- [Qemu-devel] [PATCH 3/6] vhost: set vring endianness for legacy virtio, Greg Kurz, 2015/06/17
- [Qemu-devel] [PATCH 5/6] vhost-net: tell tap backend about the vnet endianness, Greg Kurz, 2015/06/17
- [Qemu-devel] [PATCH 4/6] tap: add VNET_LE/VNET_BE operations, Greg Kurz, 2015/06/17
- [Qemu-devel] [PATCH 6/6] vhost_net: re-enable when cross endian, Greg Kurz, 2015/06/17
- [Qemu-devel] [PATCH 1/6] linux-headers: sync vhost.h, Greg Kurz, 2015/06/17
- [Qemu-devel] [PATCH 2/6] virtio: introduce virtio_legacy_is_cross_endian(),
Greg Kurz <=
- Re: [Qemu-devel] [PATCH 0/6] vhost: cross-endian support, Michael S. Tsirkin, 2015/06/17