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 __UAPI_VBOXGUEST_H__
20 #define __UAPI_VBOXGUEST_H__
21 #include <asm/bitsperlong.h>
22 #include <linux/ioctl.h>
23 #include <linux/vbox_err.h>
24 #include <linux/vbox_vmmdev_types.h>
25 #define VBG_IOCTL_HDR_VERSION 0x10001
26 #define VBG_IOCTL_HDR_TYPE_DEFAULT 0
27 struct vbg_ioctl_hdr {
28   __u32 size_in;
29   __u32 version;
30   __u32 type;
31   __s32 rc;
32   __u32 size_out;
33   __u32 reserved;
34 };
35 #define VBG_IOC_VERSION 0x00010000u
36 struct vbg_ioctl_driver_version_info {
37   struct vbg_ioctl_hdr hdr;
38   union {
39     struct {
40       __u32 req_version;
41       __u32 min_version;
42       __u32 reserved1;
43       __u32 reserved2;
44     } in;
45     struct {
46       __u32 session_version;
47       __u32 driver_version;
48       __u32 driver_revision;
49       __u32 reserved1;
50       __u32 reserved2;
51     } out;
52   } u;
53 };
54 #define VBG_IOCTL_DRIVER_VERSION_INFO _IOWR('V', 0, struct vbg_ioctl_driver_version_info)
55 #define VBG_IOCTL_VMMDEV_REQUEST(s) _IOC(_IOC_READ | _IOC_WRITE, 'V', 2, s)
56 #define VBG_IOCTL_VMMDEV_REQUEST_BIG _IO('V', 3)
57 struct vbg_ioctl_hgcm_connect {
58   struct vbg_ioctl_hdr hdr;
59   union {
60     struct {
61       struct vmmdev_hgcm_service_location loc;
62     } in;
63     struct {
64       __u32 client_id;
65     } out;
66   } u;
67 };
68 #define VBG_IOCTL_HGCM_CONNECT _IOWR('V', 4, struct vbg_ioctl_hgcm_connect)
69 struct vbg_ioctl_hgcm_disconnect {
70   struct vbg_ioctl_hdr hdr;
71   union {
72     struct {
73       __u32 client_id;
74     } in;
75   } u;
76 };
77 #define VBG_IOCTL_HGCM_DISCONNECT _IOWR('V', 5, struct vbg_ioctl_hgcm_disconnect)
78 struct vbg_ioctl_hgcm_call {
79   struct vbg_ioctl_hdr hdr;
80   __u32 client_id;
81   __u32 function;
82   __u32 timeout_ms;
83   __u8 interruptible;
84   __u8 reserved;
85   __u16 parm_count;
86 };
87 #define VBG_IOCTL_HGCM_CALL_32(s) _IOC(_IOC_READ | _IOC_WRITE, 'V', 6, s)
88 #define VBG_IOCTL_HGCM_CALL_64(s) _IOC(_IOC_READ | _IOC_WRITE, 'V', 7, s)
89 #if __BITS_PER_LONG == 64
90 #define VBG_IOCTL_HGCM_CALL(s) VBG_IOCTL_HGCM_CALL_64(s)
91 #else
92 #define VBG_IOCTL_HGCM_CALL(s) VBG_IOCTL_HGCM_CALL_32(s)
93 #endif
94 struct vbg_ioctl_log {
95   struct vbg_ioctl_hdr hdr;
96   union {
97     struct {
98       char msg[1];
99     } in;
100   } u;
101 };
102 #define VBG_IOCTL_LOG(s) _IO('V', 9)
103 struct vbg_ioctl_wait_for_events {
104   struct vbg_ioctl_hdr hdr;
105   union {
106     struct {
107       __u32 timeout_ms;
108       __u32 events;
109     } in;
110     struct {
111       __u32 events;
112     } out;
113   } u;
114 };
115 #define VBG_IOCTL_WAIT_FOR_EVENTS _IOWR('V', 10, struct vbg_ioctl_wait_for_events)
116 #define VBG_IOCTL_INTERRUPT_ALL_WAIT_FOR_EVENTS _IOWR('V', 11, struct vbg_ioctl_hdr)
117 struct vbg_ioctl_change_filter {
118   struct vbg_ioctl_hdr hdr;
119   union {
120     struct {
121       __u32 or_mask;
122       __u32 not_mask;
123     } in;
124   } u;
125 };
126 #define VBG_IOCTL_CHANGE_FILTER_MASK _IOWR('V', 12, struct vbg_ioctl_change_filter)
127 struct vbg_ioctl_acquire_guest_caps {
128   struct vbg_ioctl_hdr hdr;
129   union {
130     struct {
131       __u32 flags;
132       __u32 or_mask;
133       __u32 not_mask;
134     } in;
135   } u;
136 };
137 #define VBGL_IOC_AGC_FLAGS_CONFIG_ACQUIRE_MODE 0x00000001
138 #define VBGL_IOC_AGC_FLAGS_VALID_MASK 0x00000001
139 #define VBG_IOCTL_ACQUIRE_GUEST_CAPABILITIES _IOWR('V', 13, struct vbg_ioctl_acquire_guest_caps)
140 struct vbg_ioctl_set_guest_caps {
141   struct vbg_ioctl_hdr hdr;
142   union {
143     struct {
144       __u32 or_mask;
145       __u32 not_mask;
146     } in;
147     struct {
148       __u32 session_caps;
149       __u32 global_caps;
150     } out;
151   } u;
152 };
153 #define VBG_IOCTL_CHANGE_GUEST_CAPABILITIES _IOWR('V', 14, struct vbg_ioctl_set_guest_caps)
154 struct vbg_ioctl_check_balloon {
155   struct vbg_ioctl_hdr hdr;
156   union {
157     struct {
158       __u32 balloon_chunks;
159       __u8 handle_in_r3;
160       __u8 padding[3];
161     } out;
162   } u;
163 };
164 #define VBG_IOCTL_CHECK_BALLOON _IOWR('V', 17, struct vbg_ioctl_check_balloon)
165 struct vbg_ioctl_write_coredump {
166   struct vbg_ioctl_hdr hdr;
167   union {
168     struct {
169       __u32 flags;
170     } in;
171   } u;
172 };
173 #define VBG_IOCTL_WRITE_CORE_DUMP _IOWR('V', 19, struct vbg_ioctl_write_coredump)
174 #endif
175