Commit 077a1096 authored by Marc Zyngier's avatar Marc Zyngier Committed by Will Deacon
Browse files

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: default avatarMarc Zyngier <marc.zyngier@arm.com>
Signed-off-by: default avatarPekka Enberg <penberg@kernel.org>
parent 19d98215
......@@ -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 */
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment