xref: /linux/include/uapi/linux/virtio_types.h (revision 9095bf25ea08135a5b74875dd0e3eeaddc4218a0)
1eef960a0SMichael S. Tsirkin #ifndef _UAPI_LINUX_VIRTIO_TYPES_H
2eef960a0SMichael S. Tsirkin #define _UAPI_LINUX_VIRTIO_TYPES_H
3eef960a0SMichael S. Tsirkin /* Type definitions for virtio implementations.
4eef960a0SMichael S. Tsirkin  *
5eef960a0SMichael S. Tsirkin  * This header is BSD licensed so anyone can use the definitions to implement
6eef960a0SMichael S. Tsirkin  * compatible drivers/servers.
7eef960a0SMichael S. Tsirkin  *
8eef960a0SMichael S. Tsirkin  * Redistribution and use in source and binary forms, with or without
9eef960a0SMichael S. Tsirkin  * modification, are permitted provided that the following conditions
10eef960a0SMichael S. Tsirkin  * are met:
11eef960a0SMichael S. Tsirkin  * 1. Redistributions of source code must retain the above copyright
12eef960a0SMichael S. Tsirkin  *    notice, this list of conditions and the following disclaimer.
13eef960a0SMichael S. Tsirkin  * 2. Redistributions in binary form must reproduce the above copyright
14eef960a0SMichael S. Tsirkin  *    notice, this list of conditions and the following disclaimer in the
15eef960a0SMichael S. Tsirkin  *    documentation and/or other materials provided with the distribution.
16eef960a0SMichael S. Tsirkin  * 3. Neither the name of IBM nor the names of its contributors
17eef960a0SMichael S. Tsirkin  *    may be used to endorse or promote products derived from this software
18eef960a0SMichael S. Tsirkin  *    without specific prior written permission.
19eef960a0SMichael S. Tsirkin  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' AND
20eef960a0SMichael S. Tsirkin  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21eef960a0SMichael S. Tsirkin  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22eef960a0SMichael S. Tsirkin  * ARE DISCLAIMED.  IN NO EVENT SHALL IBM OR CONTRIBUTORS BE LIABLE
23eef960a0SMichael S. Tsirkin  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24eef960a0SMichael S. Tsirkin  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
25eef960a0SMichael S. Tsirkin  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26eef960a0SMichael S. Tsirkin  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27eef960a0SMichael S. Tsirkin  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
28eef960a0SMichael S. Tsirkin  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
29eef960a0SMichael S. Tsirkin  * SUCH DAMAGE.
30eef960a0SMichael S. Tsirkin  *
31eef960a0SMichael S. Tsirkin  * Copyright (C) 2014 Red Hat, Inc.
32eef960a0SMichael S. Tsirkin  * Author: Michael S. Tsirkin <mst@redhat.com>
33eef960a0SMichael S. Tsirkin  */
34eef960a0SMichael S. Tsirkin #include <linux/types.h>
35eef960a0SMichael S. Tsirkin 
36eef960a0SMichael S. Tsirkin /*
37eef960a0SMichael S. Tsirkin  * __virtio{16,32,64} have the following meaning:
38eef960a0SMichael S. Tsirkin  * - __u{16,32,64} for virtio devices in legacy mode, accessed in native endian
39eef960a0SMichael S. Tsirkin  * - __le{16,32,64} for standard-compliant virtio devices
40eef960a0SMichael S. Tsirkin  */
41eef960a0SMichael S. Tsirkin 
42*9efeccacSMichael S. Tsirkin typedef __u16 __bitwise __virtio16;
43*9efeccacSMichael S. Tsirkin typedef __u32 __bitwise __virtio32;
44*9efeccacSMichael S. Tsirkin typedef __u64 __bitwise __virtio64;
45eef960a0SMichael S. Tsirkin 
46eef960a0SMichael S. Tsirkin #endif /* _UAPI_LINUX_VIRTIO_TYPES_H */
47