diff options
author | Marc Zyngier <marc.zyngier@arm.com> | 2014-05-08 10:32:43 +0100 |
---|---|---|
committer | Will Deacon <will.deacon@arm.com> | 2015-06-01 16:39:55 +0100 |
commit | 077a10964ea619fd8ac0d8afd2e527d70395dc9d (patch) | |
tree | f1c6f1a869576c21a49cc5e5ebdad96d9c4758ec | |
parent | 19d982151afedff5e40c6804121121de3adb0015 (diff) | |
download | kvmtool-077a10964ea619fd8ac0d8afd2e527d70395dc9d.tar.gz |
kvmtool: add queue endianness initializer
Add a utility function that transfers the endianness sampled
at device reset time to a queue being set up.
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
-rw-r--r-- | include/kvm/virtio.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/include/kvm/virtio.h b/include/kvm/virtio.h index 1180a3e5..8a9eab52 100644 --- a/include/kvm/virtio.h +++ b/include/kvm/virtio.h @@ -28,6 +28,7 @@ struct virt_queue { It's where we assume the next request index is at. */ u16 last_avail_idx; u16 last_used_signalled; + u16 endian; }; /* @@ -165,4 +166,10 @@ static inline void *virtio_get_vq(struct kvm *kvm, u32 pfn, u32 page_size) return guest_flat_to_host(kvm, (u64)pfn * page_size); } +static inline void virtio_init_device_vq(struct virtio_device *vdev, + struct virt_queue *vq) +{ + vq->endian = vdev->endian; +} + #endif /* KVM__VIRTIO_H */ |