• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /****************************************************************************
2  ****************************************************************************
3  ***
4  ***   This header was automatically generated from a Linux kernel header
5  ***   of the same name, to make information necessary for userspace to
6  ***   call into the kernel available to libc.  It contains only constants,
7  ***   structures, and macros generated from the original header, and thus,
8  ***   contains no copyrightable information.
9  ***
10  ***   To edit the content of this header, modify the corresponding
11  ***   source file (e.g. under external/kernel-headers/original/) then
12  ***   run bionic/libc/kernel/tools/update_all.py
13  ***
14  ***   Any manual change here will be lost the next time this script will
15  ***   be run. You've been warned!
16  ***
17  ****************************************************************************
18  ****************************************************************************/
19 #ifndef _LINUX_VHOST_TYPES_H
20 #define _LINUX_VHOST_TYPES_H
21 #include <linux/types.h>
22 #include <linux/compiler.h>
23 #include <linux/virtio_config.h>
24 #include <linux/virtio_ring.h>
25 struct vhost_vring_state {
26   unsigned int index;
27   unsigned int num;
28 };
29 struct vhost_vring_file {
30   unsigned int index;
31   int fd;
32 };
33 struct vhost_vring_addr {
34   unsigned int index;
35   unsigned int flags;
36 #define VHOST_VRING_F_LOG 0
37   __u64 desc_user_addr;
38   __u64 used_user_addr;
39   __u64 avail_user_addr;
40   __u64 log_guest_addr;
41 };
42 struct vhost_iotlb_msg {
43   __u64 iova;
44   __u64 size;
45   __u64 uaddr;
46 #define VHOST_ACCESS_RO 0x1
47 #define VHOST_ACCESS_WO 0x2
48 #define VHOST_ACCESS_RW 0x3
49   __u8 perm;
50 #define VHOST_IOTLB_MISS 1
51 #define VHOST_IOTLB_UPDATE 2
52 #define VHOST_IOTLB_INVALIDATE 3
53 #define VHOST_IOTLB_ACCESS_FAIL 4
54   __u8 type;
55 };
56 #define VHOST_IOTLB_MSG 0x1
57 #define VHOST_IOTLB_MSG_V2 0x2
58 struct vhost_msg {
59   int type;
60   union {
61     struct vhost_iotlb_msg iotlb;
62     __u8 padding[64];
63   };
64 };
65 struct vhost_msg_v2 {
66   __u32 type;
67   __u32 reserved;
68   union {
69     struct vhost_iotlb_msg iotlb;
70     __u8 padding[64];
71   };
72 };
73 struct vhost_memory_region {
74   __u64 guest_phys_addr;
75   __u64 memory_size;
76   __u64 userspace_addr;
77   __u64 flags_padding;
78 };
79 #define VHOST_PAGE_SIZE 0x1000
80 struct vhost_memory {
81   __u32 nregions;
82   __u32 padding;
83   struct vhost_memory_region regions[0];
84 };
85 #define VHOST_SCSI_ABI_VERSION 1
86 struct vhost_scsi_target {
87   int abi_version;
88   char vhost_wwpn[224];
89   unsigned short vhost_tpgt;
90   unsigned short reserved;
91 };
92 #define VHOST_F_LOG_ALL 26
93 #define VHOST_NET_F_VIRTIO_NET_HDR 27
94 #endif
95