virtio: memory access APIs
authorMichael S. Tsirkin <mst@redhat.com>
Wed, 22 Oct 2014 12:35:56 +0000 (15:35 +0300)
committerMichael S. Tsirkin <mst@redhat.com>
Tue, 9 Dec 2014 10:05:24 +0000 (12:05 +0200)
commiteef960a04354d13426c43a4e3750a5e2b383040c
treea5d6e327dbb22c85b2f6592077a544bcc0153471
parent4ec22faeb2a165b6ce7009f91309046010b3f282
virtio: memory access APIs

virtio 1.0 makes all memory structures LE, so
we need APIs to conditionally do a byteswap on BE
architectures.

To make it easier to check code statically,
add virtio specific types for multi-byte integers
in memory.

Add low level wrappers that do a byteswap conditionally, these will be
useful e.g. for vhost.  Add high level wrappers that
query device endian-ness and act accordingly.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com>
include/linux/virtio_byteorder.h [new file with mode: 0644]
include/linux/virtio_config.h
include/uapi/linux/Kbuild
include/uapi/linux/virtio_ring.h
include/uapi/linux/virtio_types.h [new file with mode: 0644]