[1] | 1 | /** @file
|
---|
[21217] | 2 | * VBoxGuest - VirtualBox Guest Additions Driver Interface. (ADD,DEV)
|
---|
[21223] | 3 | *
|
---|
[68573] | 4 | * @note This file is used by 16-bit compilers too (OpenWatcom).
|
---|
[1] | 5 | */
|
---|
| 6 |
|
---|
| 7 | /*
|
---|
[98103] | 8 | * Copyright (C) 2006-2023 Oracle and/or its affiliates.
|
---|
[1] | 9 | *
|
---|
[72627] | 10 | * Permission is hereby granted, free of charge, to any person
|
---|
| 11 | * obtaining a copy of this software and associated documentation
|
---|
| 12 | * files (the "Software"), to deal in the Software without
|
---|
| 13 | * restriction, including without limitation the rights to use,
|
---|
| 14 | * copy, modify, merge, publish, distribute, sublicense, and/or sell
|
---|
| 15 | * copies of the Software, and to permit persons to whom the
|
---|
| 16 | * Software is furnished to do so, subject to the following
|
---|
| 17 | * conditions:
|
---|
[5999] | 18 | *
|
---|
[72627] | 19 | * The above copyright notice and this permission notice shall be
|
---|
| 20 | * included in all copies or substantial portions of the Software.
|
---|
[5999] | 21 | *
|
---|
[72627] | 22 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
---|
| 23 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
---|
| 24 | * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
---|
| 25 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
---|
| 26 | * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
---|
| 27 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
---|
| 28 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
---|
| 29 | * OTHER DEALINGS IN THE SOFTWARE.
|
---|
[1] | 30 | */
|
---|
| 31 |
|
---|
[76558] | 32 | #ifndef VBOX_INCLUDED_VBoxGuest_h
|
---|
| 33 | #define VBOX_INCLUDED_VBoxGuest_h
|
---|
[76507] | 34 | #ifndef RT_WITHOUT_PRAGMA_ONCE
|
---|
| 35 | # pragma once
|
---|
| 36 | #endif
|
---|
[1] | 37 |
|
---|
[21223] | 38 | #include <VBox/types.h>
|
---|
[68688] | 39 | #include <iprt/assertcompile.h>
|
---|
[68628] | 40 | #include <VBox/VMMDevCoreTypes.h>
|
---|
[68630] | 41 | #include <VBox/VBoxGuestCoreTypes.h>
|
---|
[1] | 42 |
|
---|
| 43 |
|
---|
[68550] | 44 |
|
---|
[58111] | 45 | /** @defgroup grp_vboxguest VirtualBox Guest Additions Device Driver
|
---|
| 46 | *
|
---|
| 47 | * Also know as VBoxGuest.
|
---|
| 48 | *
|
---|
[21224] | 49 | * @{
|
---|
| 50 | */
|
---|
[3194] | 51 |
|
---|
[58111] | 52 | /** @defgroup grp_vboxguest_ioc VirtualBox Guest Additions Driver Interface
|
---|
[6030] | 53 | *
|
---|
[68550] | 54 | * @note This is considered internal in ring-3, please use the VbglR3 functions.
|
---|
[6030] | 55 | *
|
---|
[68623] | 56 | * - I/O controls for user and/or kernel mode starts at 0.
|
---|
[75547] | 57 | * - IDC specific requests descends from 63.
|
---|
[68623] | 58 | * - Bits 7 and 6 are currently reserved for future hacks.
|
---|
[68550] | 59 | *
|
---|
[5887] | 60 | * @remarks When creating new IOCtl interfaces keep in mind that not all OSes supports
|
---|
[3194] | 61 | * reporting back the output size. (This got messed up a little bit in VBoxDrv.)
|
---|
[6030] | 62 | *
|
---|
[5887] | 63 | * The request size is also a little bit tricky as it's passed as part of the
|
---|
| 64 | * request code on unix. The size field is 14 bits on Linux, 12 bits on *BSD,
|
---|
[6030] | 65 | * 13 bits Darwin, and 8-bits on Solaris. All the BSDs and Darwin kernels
|
---|
[5887] | 66 | * will make use of the size field, while Linux and Solaris will not. We're of
|
---|
[6030] | 67 | * course using the size to validate and/or map/lock the request, so it has
|
---|
[5887] | 68 | * to be valid.
|
---|
[6030] | 69 | *
|
---|
| 70 | * For Solaris we will have to do something special though, 255 isn't
|
---|
[33540] | 71 | * sufficient for all we need. A 4KB restriction (BSD) is probably not
|
---|
[5887] | 72 | * too problematic (yet) as a general one.
|
---|
[6030] | 73 | *
|
---|
[5887] | 74 | * More info can be found in SUPDRVIOC.h and related sources.
|
---|
| 75 | *
|
---|
| 76 | * @remarks If adding interfaces that only has input or only has output, some new macros
|
---|
[3194] | 77 | * needs to be created so the most efficient IOCtl data buffering method can be
|
---|
| 78 | * used.
|
---|
[68550] | 79 | *
|
---|
[1] | 80 | * @{
|
---|
| 81 | */
|
---|
[95794] | 82 | #if !defined(IN_RC) && !defined(IN_RING0_AGNOSTIC)
|
---|
[68550] | 83 |
|
---|
| 84 | /** Fictive start address of the hypervisor physical memory for MmMapIoSpace. */
|
---|
| 85 | #define VBOXGUEST_HYPERVISOR_PHYSICAL_START UINT32_C(0xf8000000)
|
---|
| 86 |
|
---|
| 87 | #ifdef RT_OS_DARWIN
|
---|
| 88 | /** Cookie used to fend off some unwanted clients to the IOService. */
|
---|
| 89 | # define VBOXGUEST_DARWIN_IOSERVICE_COOKIE UINT32_C(0x56426f78) /* 'VBox' */
|
---|
| 90 | #endif
|
---|
| 91 |
|
---|
| 92 |
|
---|
[3638] | 93 | #if defined(RT_OS_WINDOWS)
|
---|
[68550] | 94 | # ifndef CTL_CODE
|
---|
| 95 | # include <iprt/win/windows.h>
|
---|
| 96 | # endif
|
---|
| 97 | /* Automatic buffering, size not encoded. */
|
---|
| 98 | # define VBGL_IOCTL_CODE_SIZE(Function, Size) CTL_CODE(FILE_DEVICE_UNKNOWN, 2048 + (Function), METHOD_BUFFERED, FILE_WRITE_ACCESS)
|
---|
| 99 | # define VBGL_IOCTL_CODE_BIG(Function) CTL_CODE(FILE_DEVICE_UNKNOWN, 2048 + (Function), METHOD_BUFFERED, FILE_WRITE_ACCESS)
|
---|
| 100 | # define VBGL_IOCTL_CODE_FAST(Function) CTL_CODE(FILE_DEVICE_UNKNOWN, 2048 + (Function), METHOD_NEITHER, FILE_WRITE_ACCESS)
|
---|
[68623] | 101 | # define VBGL_IOCTL_CODE_STRIPPED(a_uIOCtl) (a_uIOCtl)
|
---|
[68550] | 102 | # define VBOXGUEST_DEVICE_NAME "\\\\.\\VBoxGuest"
|
---|
| 103 | /** The support service name. */
|
---|
| 104 | # define VBOXGUEST_SERVICE_NAME "VBoxGuest"
|
---|
| 105 | /** Global name for Win2k+ */
|
---|
| 106 | # define VBOXGUEST_DEVICE_NAME_GLOBAL "\\\\.\\Global\\VBoxGuest"
|
---|
| 107 | /** Win32 driver name */
|
---|
| 108 | # define VBOXGUEST_DEVICE_NAME_NT L"\\Device\\VBoxGuest"
|
---|
| 109 | /** Device name. */
|
---|
| 110 | # define VBOXGUEST_DEVICE_NAME_DOS L"\\DosDevices\\VBoxGuest"
|
---|
[3194] | 111 |
|
---|
[3638] | 112 | #elif defined(RT_OS_OS2)
|
---|
[6983] | 113 | /* No automatic buffering, size not encoded. */
|
---|
[68550] | 114 | # define VBGL_IOCTL_CATEGORY 0xc2
|
---|
| 115 | # define VBGL_IOCTL_CODE_SIZE(Function, Size) ((unsigned char)(Function))
|
---|
[68570] | 116 | # define VBGL_IOCTL_CODE_BIG(Function) ((unsigned char)(Function))
|
---|
[68550] | 117 | # define VBGL_IOCTL_CATEGORY_FAST 0xc3 /**< Also defined in VBoxGuestA-os2.asm. */
|
---|
| 118 | # define VBGL_IOCTL_CODE_FAST(Function) ((unsigned char)(Function))
|
---|
[68623] | 119 | # define VBGL_IOCTL_CODE_STRIPPED(a_uIOCtl) (a_uIOCtl)
|
---|
[68550] | 120 | # define VBOXGUEST_DEVICE_NAME "\\Dev\\VBoxGst$"
|
---|
[68596] | 121 | /** Short device name for AttachDD.
|
---|
| 122 | * @note Case sensitive. Must match what VBoxGuestA-os2.asm says! */
|
---|
| 123 | # define VBOXGUEST_DEVICE_NAME_SHORT "vboxgst$"
|
---|
[3194] | 124 |
|
---|
[6983] | 125 | #elif defined(RT_OS_SOLARIS)
|
---|
| 126 | /* No automatic buffering, size limited to 255 bytes => use VBGLBIGREQ for everything. */
|
---|
| 127 | # include <sys/ioccom.h>
|
---|
[96325] | 128 | # define VBGL_IOCTL_CODE_SIZE(Function, Size) ((uintptr_t)(_IOWRN('V', (Function), sizeof(VBGLREQHDR))))
|
---|
[68565] | 129 | # define VBGL_IOCTL_CODE_BIG(Function) _IOWRN('V', (Function), sizeof(VBGLREQHDR))
|
---|
| 130 | # define VBGL_IOCTL_CODE_FAST(Function) _IO( 'F', (Function))
|
---|
[68623] | 131 | # define VBGL_IOCTL_CODE_STRIPPED(a_uIOCtl) (a_uIOCtl)
|
---|
[68565] | 132 | # define VBGL_IOCTL_IS_FAST(a_uIOCtl) ( ((a_uIOCtl) & 0x0000ff00) == ('F' << 8) )
|
---|
[6983] | 133 |
|
---|
[3638] | 134 | #elif defined(RT_OS_LINUX)
|
---|
[6983] | 135 | /* No automatic buffering, size limited to 16KB. */
|
---|
[5891] | 136 | # include <linux/ioctl.h>
|
---|
[68550] | 137 | # define VBGL_IOCTL_CODE_SIZE(Function, Size) _IOC(_IOC_READ | _IOC_WRITE, 'V', (Function), (Size))
|
---|
| 138 | # define VBGL_IOCTL_CODE_BIG(Function) _IO('V', (Function))
|
---|
[68565] | 139 | # define VBGL_IOCTL_CODE_FAST(Function) _IO('F', (Function))
|
---|
[68623] | 140 | # define VBGL_IOCTL_CODE_STRIPPED(a_uIOCtl) _IOC_NR((a_uIOCtl))
|
---|
[68550] | 141 | # define VBOXGUEST_USER_DEVICE_NAME "/dev/vboxuser"
|
---|
[6167] | 142 |
|
---|
[43363] | 143 | #elif defined(RT_OS_HAIKU)
|
---|
| 144 | /* No automatic buffering, size not encoded. */
|
---|
| 145 | /** @todo do something better */
|
---|
[68550] | 146 | # define VBGL_IOCTL_CODE_SIZE(Function, Size) (0x56420000 | (Function))
|
---|
| 147 | # define VBGL_IOCTL_CODE_BIG(Function) (0x56420000 | (Function))
|
---|
| 148 | # define VBGL_IOCTL_CODE_FAST(Function) (0x56420000 | (Function))
|
---|
[68623] | 149 | # define VBGL_IOCTL_CODE_STRIPPED(a_uIOCtl) (a_uIOCtl)
|
---|
[68550] | 150 | # define VBOXGUEST_DEVICE_NAME "/dev/misc/vboxguest"
|
---|
[43363] | 151 |
|
---|
[39890] | 152 | #else /* BSD Like */
|
---|
| 153 | /* Automatic buffering, size limited to 4KB on *BSD and 8KB on Darwin - commands the limit, 4KB. */
|
---|
| 154 | # include <sys/ioccom.h>
|
---|
[68550] | 155 | # define VBGL_IOCTL_CODE_SIZE(Function, Size) _IOC(IOC_INOUT, 'V', (Function), (Size))
|
---|
[68565] | 156 | # define VBGL_IOCTL_CODE_BIG(Function) _IO('V', (Function))
|
---|
| 157 | # define VBGL_IOCTL_CODE_FAST(Function) _IO('F', (Function))
|
---|
[68623] | 158 | # define VBGL_IOCTL_CODE_STRIPPED(a_uIOCtl) ((a_uIOCtl) & ~(_IOC(0,0,0,IOCPARM_MASK)))
|
---|
[68581] | 159 | # define VBGL_IOCTL_IS_FAST(a_uIOCtl) ( IOCGROUP(a_uIOCtl) == 'F' )
|
---|
[75706] | 160 | # if defined(RT_OS_DARWIN)
|
---|
| 161 | # define VBOXGUEST_DEVICE_NAME "/dev/vboxguest"
|
---|
| 162 | # define VBOXGUEST_USER_DEVICE_NAME "/dev/vboxguestu"
|
---|
| 163 | # endif
|
---|
| 164 |
|
---|
[1] | 165 | #endif
|
---|
| 166 |
|
---|
[68550] | 167 | /** @todo It would be nice if we could have two defines without paths. */
|
---|
[15810] | 168 |
|
---|
[68550] | 169 | /** @def VBOXGUEST_DEVICE_NAME
|
---|
| 170 | * The support device name. */
|
---|
| 171 | #ifndef VBOXGUEST_DEVICE_NAME /* PORTME */
|
---|
| 172 | # define VBOXGUEST_DEVICE_NAME "/dev/vboxguest"
|
---|
| 173 | #endif
|
---|
[21223] | 174 |
|
---|
[68550] | 175 | /** @def VBOXGUEST_USER_DEVICE_NAME
|
---|
| 176 | * The support device name of the user accessible device node. */
|
---|
| 177 | #ifndef VBOXGUEST_USER_DEVICE_NAME
|
---|
| 178 | # define VBOXGUEST_USER_DEVICE_NAME VBOXGUEST_DEVICE_NAME
|
---|
| 179 | #endif
|
---|
[21223] | 180 |
|
---|
[1] | 181 |
|
---|
[68550] | 182 | /**
|
---|
| 183 | * The VBoxGuest I/O control version.
|
---|
| 184 | *
|
---|
| 185 | * As usual, the high word contains the major version and changes to it
|
---|
| 186 | * signifies incompatible changes.
|
---|
| 187 | *
|
---|
| 188 | * The lower word is the minor version number, it is increased when new
|
---|
| 189 | * functions are added or existing changed in a backwards compatible manner.
|
---|
| 190 | */
|
---|
| 191 | #define VBGL_IOC_VERSION UINT32_C(0x00010000)
|
---|
| 192 |
|
---|
| 193 |
|
---|
| 194 |
|
---|
| 195 | /** @name VBGL_IOCTL_DRIVER_INFO
|
---|
| 196 | * Adjust and get driver information.
|
---|
| 197 | *
|
---|
| 198 | * @note May switch the session to a backwards compatible interface version if
|
---|
| 199 | * uClientVersion indicates older client code.
|
---|
| 200 | *
|
---|
[1] | 201 | * @{
|
---|
| 202 | */
|
---|
[68550] | 203 | #define VBGL_IOCTL_DRIVER_VERSION_INFO VBGL_IOCTL_CODE_SIZE(0, VBGL_IOCTL_DRIVER_VERSION_INFO_SIZE)
|
---|
| 204 | #define VBGL_IOCTL_DRIVER_VERSION_INFO_SIZE sizeof(VBGLIOCDRIVERVERSIONINFO)
|
---|
| 205 | #define VBGL_IOCTL_DRIVER_VERSION_INFO_SIZE_IN RT_UOFFSET_AFTER(VBGLIOCDRIVERVERSIONINFO, u.In)
|
---|
| 206 | #define VBGL_IOCTL_DRIVER_VERSION_INFO_SIZE_OUT sizeof(VBGLIOCDRIVERVERSIONINFO)
|
---|
| 207 | typedef struct VBGLIOCDRIVERVERSIONINFO
|
---|
| 208 | {
|
---|
| 209 | /** The header. */
|
---|
| 210 | VBGLREQHDR Hdr;
|
---|
| 211 | union
|
---|
| 212 | {
|
---|
| 213 | struct
|
---|
| 214 | {
|
---|
| 215 | /** The requested interface version number (VBGL_IOC_VERSION). */
|
---|
| 216 | uint32_t uReqVersion;
|
---|
| 217 | /** The minimum interface version number
|
---|
| 218 | * (typically the major version part of VBGL_IOC_VERSION). */
|
---|
| 219 | uint32_t uMinVersion;
|
---|
| 220 | /** Reserved, MBZ. */
|
---|
| 221 | uint32_t uReserved1;
|
---|
| 222 | /** Reserved, MBZ. */
|
---|
| 223 | uint32_t uReserved2;
|
---|
| 224 | } In;
|
---|
| 225 | struct
|
---|
| 226 | {
|
---|
| 227 | /** Interface version for this session (typically VBGL_IOC_VERSION). */
|
---|
| 228 | uint32_t uSessionVersion;
|
---|
| 229 | /** The version of the IDC interface (VBGL_IOC_VERSION). */
|
---|
| 230 | uint32_t uDriverVersion;
|
---|
| 231 | /** The SVN revision of the driver.
|
---|
| 232 | * This will be set to 0 if not compiled into the driver. */
|
---|
| 233 | uint32_t uDriverRevision;
|
---|
| 234 | /** Reserved \#1 (will be returned as zero until defined). */
|
---|
| 235 | uint32_t uReserved1;
|
---|
| 236 | /** Reserved \#2 (will be returned as zero until defined). */
|
---|
| 237 | uint32_t uReserved2;
|
---|
| 238 | } Out;
|
---|
| 239 | } u;
|
---|
[68573] | 240 | } VBGLIOCDRIVERVERSIONINFO, RT_FAR *PVBGLIOCDRIVERVERSIONINFO;
|
---|
[68550] | 241 | AssertCompileSize(VBGLIOCDRIVERVERSIONINFO, 24 + 20);
|
---|
[68586] | 242 | #if !defined(__GNUC__) /* Some GCC versions can't handle the complicated RT_UOFFSET_AFTER macro, it seems. */ \
|
---|
[68616] | 243 | && (!defined(RT_OS_OS2) || (!defined(__IBMC__) && !defined(__IBMCPP__) && (!defined(__WATCOMC__) || !defined(__cplusplus))))
|
---|
[68550] | 244 | AssertCompile(VBGL_IOCTL_DRIVER_VERSION_INFO_SIZE_IN == 24 + 16);
|
---|
[68570] | 245 | #endif
|
---|
[1] | 246 | /** @} */
|
---|
| 247 |
|
---|
[68550] | 248 |
|
---|
| 249 | /** @name VBGL_IOCTL_GET_PORT_INFO
|
---|
| 250 | * Query VMMDev I/O port region and MMIO mapping address.
|
---|
| 251 | * @remarks Ring-0 only.
|
---|
| 252 | * @{
|
---|
| 253 | */
|
---|
[68623] | 254 | #define VBGL_IOCTL_GET_VMMDEV_IO_INFO VBGL_IOCTL_CODE_SIZE(1, VBGL_IOCTL_GET_VMMDEV_IO_INFO_SIZE)
|
---|
[68550] | 255 | #define VBGL_IOCTL_GET_VMMDEV_IO_INFO_SIZE sizeof(VBGLIOCGETVMMDEVIOINFO)
|
---|
| 256 | #define VBGL_IOCTL_GET_VMMDEV_IO_INFO_SIZE_IN sizeof(VBGLREQHDR)
|
---|
| 257 | #define VBGL_IOCTL_GET_VMMDEV_IO_INFO_SIZE_OUT sizeof(VBGLIOCGETVMMDEVIOINFO)
|
---|
| 258 | typedef struct VBGLIOCGETVMMDEVIOINFO
|
---|
[1] | 259 | {
|
---|
[68550] | 260 | /** The header. */
|
---|
| 261 | VBGLREQHDR Hdr;
|
---|
| 262 | union
|
---|
| 263 | {
|
---|
| 264 | struct
|
---|
| 265 | {
|
---|
| 266 | /** The MMIO mapping. NULL if no MMIO region. */
|
---|
[68573] | 267 | struct VMMDevMemory volatile RT_FAR *pvVmmDevMapping;
|
---|
[100267] | 268 | /** The MMIO region for the request port, NULL if not available. */
|
---|
| 269 | uintptr_t volatile RT_FAR *pMmioReq;
|
---|
[68550] | 270 | /** The I/O port address. */
|
---|
| 271 | RTIOPORT IoPort;
|
---|
| 272 | /** Padding, ignore. */
|
---|
[68573] | 273 | RTIOPORT auPadding[HC_ARCH_BITS == 64 ? 3 : 1];
|
---|
[68550] | 274 | } Out;
|
---|
| 275 | } u;
|
---|
[68573] | 276 | } VBGLIOCGETVMMDEVIOINFO, RT_FAR *PVBGLIOCGETVMMDEVIOINFO;
|
---|
[100267] | 277 | AssertCompileSize(VBGLIOCGETVMMDEVIOINFO, 24 + (HC_ARCH_BITS == 64 ? 24 : 12));
|
---|
[68550] | 278 | /** @} */
|
---|
[1] | 279 |
|
---|
[21224] | 280 |
|
---|
[68550] | 281 | /** @name VBGL_IOCTL_VMMDEV_REQUEST
|
---|
| 282 | * IOCTL to VBoxGuest to perform a VMM Device request less than 1KB in size.
|
---|
| 283 | * @{
|
---|
| 284 | */
|
---|
[68561] | 285 | #define VBGL_IOCTL_VMMDEV_REQUEST(a_cb) VBGL_IOCTL_CODE_SIZE(2, (a_cb))
|
---|
[68550] | 286 | /** @} */
|
---|
[1] | 287 |
|
---|
[21224] | 288 |
|
---|
[68550] | 289 | /** @name VBGL_IOCTL_VMMDEV_REQUEST_BIG
|
---|
| 290 | * IOCTL to VBoxGuest to perform a VMM Device request that can 1KB or larger.
|
---|
| 291 | * @{
|
---|
| 292 | */
|
---|
| 293 | #define VBGL_IOCTL_VMMDEV_REQUEST_BIG VBGL_IOCTL_CODE_BIG(3)
|
---|
| 294 | /** @} */
|
---|
[21224] | 295 |
|
---|
[75547] | 296 | #ifdef VBOX_WITH_HGCM
|
---|
[68550] | 297 |
|
---|
| 298 | /** @name VBGL_IOCTL_HGCM_CONNECT
|
---|
| 299 | * Connect to a HGCM service.
|
---|
| 300 | * @{ */
|
---|
| 301 | # define VBGL_IOCTL_HGCM_CONNECT VBGL_IOCTL_CODE_SIZE(4, VBGL_IOCTL_HGCM_CONNECT_SIZE)
|
---|
| 302 | # define VBGL_IOCTL_HGCM_CONNECT_SIZE sizeof(VBGLIOCHGCMCONNECT)
|
---|
| 303 | # define VBGL_IOCTL_HGCM_CONNECT_SIZE_IN sizeof(VBGLIOCHGCMCONNECT)
|
---|
| 304 | # define VBGL_IOCTL_HGCM_CONNECT_SIZE_OUT RT_UOFFSET_AFTER(VBGLIOCHGCMCONNECT, u.Out)
|
---|
| 305 | typedef struct VBGLIOCHGCMCONNECT
|
---|
[1] | 306 | {
|
---|
[68550] | 307 | /** The header. */
|
---|
| 308 | VBGLREQHDR Hdr;
|
---|
| 309 | union
|
---|
| 310 | {
|
---|
| 311 | struct
|
---|
| 312 | {
|
---|
| 313 | HGCMServiceLocation Loc;
|
---|
| 314 | } In;
|
---|
| 315 | struct
|
---|
| 316 | {
|
---|
| 317 | uint32_t idClient;
|
---|
| 318 | } Out;
|
---|
| 319 | } u;
|
---|
[68573] | 320 | } VBGLIOCHGCMCONNECT, RT_FAR *PVBGLIOCHGCMCONNECT;
|
---|
[68550] | 321 | AssertCompileSize(VBGLIOCHGCMCONNECT, 24 + 132);
|
---|
[68586] | 322 | #if !defined(__GNUC__) /* Some GCC versions can't handle the complicated RT_UOFFSET_AFTER macro, it seems. */ \
|
---|
[68616] | 323 | && (!defined(RT_OS_OS2) || (!defined(__IBMC__) && !defined(__IBMCPP__) && (!defined(__WATCOMC__) || !defined(__cplusplus))))
|
---|
[68550] | 324 | AssertCompile(VBGL_IOCTL_HGCM_CONNECT_SIZE_OUT == 24 + 4);
|
---|
[68570] | 325 | #endif
|
---|
[68550] | 326 | /** @} */
|
---|
[1] | 327 |
|
---|
| 328 |
|
---|
[68550] | 329 | /** @name VBGL_IOCTL_HGCM_DISCONNECT
|
---|
| 330 | * Disconnect from a HGCM service.
|
---|
| 331 | * @{ */
|
---|
| 332 | # define VBGL_IOCTL_HGCM_DISCONNECT VBGL_IOCTL_CODE_SIZE(5, VBGL_IOCTL_HGCM_DISCONNECT_SIZE)
|
---|
| 333 | # define VBGL_IOCTL_HGCM_DISCONNECT_SIZE sizeof(VBGLIOCHGCMDISCONNECT)
|
---|
| 334 | # define VBGL_IOCTL_HGCM_DISCONNECT_SIZE_IN sizeof(VBGLIOCHGCMDISCONNECT)
|
---|
| 335 | # define VBGL_IOCTL_HGCM_DISCONNECT_SIZE_OUT sizeof(VBGLREQHDR)
|
---|
| 336 | /** @note This is also used by a VbglR0 API. */
|
---|
| 337 | typedef struct VBGLIOCHGCMDISCONNECT
|
---|
| 338 | {
|
---|
| 339 | /** The header. */
|
---|
| 340 | VBGLREQHDR Hdr;
|
---|
| 341 | union
|
---|
| 342 | {
|
---|
| 343 | struct
|
---|
| 344 | {
|
---|
| 345 | uint32_t idClient;
|
---|
| 346 | } In;
|
---|
| 347 | } u;
|
---|
[68573] | 348 | } VBGLIOCHGCMDISCONNECT, RT_FAR *PVBGLIOCHGCMDISCONNECT;
|
---|
[68550] | 349 | AssertCompileSize(VBGLIOCHGCMDISCONNECT, 24 + 4);
|
---|
| 350 | /** @} */
|
---|
[32574] | 351 |
|
---|
[4516] | 352 |
|
---|
[68550] | 353 | /** @name VBGL_IOCTL_HGCM_CALL, VBGL_IOCTL_HGCM_CALL_WITH_USER_DATA
|
---|
| 354 | *
|
---|
[75547] | 355 | * Make a call to a HGCM service. There are several variations here.
|
---|
[68550] | 356 | *
|
---|
| 357 | * The VBGL_IOCTL_HGCM_CALL_WITH_USER_DATA variation is for other drivers (like
|
---|
| 358 | * the graphics ones) passing on requests from user land that contains user
|
---|
| 359 | * data. These calls are always interruptible.
|
---|
| 360 | *
|
---|
| 361 | * @{ */
|
---|
[68623] | 362 | # define VBGL_IOCTL_HGCM_CALL_32(a_cb) VBGL_IOCTL_CODE_SIZE(6, (a_cb))
|
---|
| 363 | # define VBGL_IOCTL_HGCM_CALL_64(a_cb) VBGL_IOCTL_CODE_SIZE(7, (a_cb))
|
---|
| 364 | # if ARCH_BITS == 64
|
---|
| 365 | # define VBGL_IOCTL_HGCM_CALL(a_cb) VBGL_IOCTL_HGCM_CALL_64(a_cb)
|
---|
| 366 | # else
|
---|
| 367 | # define VBGL_IOCTL_HGCM_CALL(a_cb) VBGL_IOCTL_HGCM_CALL_32(a_cb)
|
---|
| 368 | # endif
|
---|
| 369 | # define VBGL_IOCTL_HGCM_CALL_WITH_USER_DATA(a_cb) VBGL_IOCTL_CODE_SIZE(8, (a_cb))
|
---|
[68550] | 370 | /** @} */
|
---|
[75547] | 371 |
|
---|
| 372 |
|
---|
| 373 | /** @name VBGL_IOCTL_IDC_HGCM_FAST_CALL
|
---|
| 374 | *
|
---|
| 375 | * Variant of VBGL_IOCTL_HGCM_CALL for drivers that submits the request as-is to
|
---|
| 376 | * the host and handles the waiting, the caller does all the rest.
|
---|
| 377 | *
|
---|
| 378 | * @note ring-0 only.
|
---|
| 379 | * @note Size is not encoded in the I/O control code.
|
---|
| 380 | * @{
|
---|
| 381 | */
|
---|
[78300] | 382 | #define VBGL_IOCTL_IDC_HGCM_FAST_CALL VBGL_IOCTL_CODE_SIZE(61, sizeof(VBGLIOCIDCHGCMFASTCALL))
|
---|
[75547] | 383 | #define VBGL_IOCTL_IDC_HGCM_FAST_CALL_SIZE(a_cb) (a_cb)
|
---|
| 384 | #define VBGL_IOCTL_IDC_HGCM_FAST_CALL_SIZE_IN(a_cb) (a_cb)
|
---|
| 385 | #define VBGL_IOCTL_IDC_HGCM_FAST_CALL_SIZE_OUT(a_cb) (a_cb)
|
---|
| 386 | #pragma pack(4) /* Want it to fit nicely with the 44 byte VMMDevHGCMCall and optimally align 64-bit parameters structures. */
|
---|
| 387 | typedef struct VBGLIOCIDCHGCMFASTCALL
|
---|
| 388 | {
|
---|
| 389 | /** The header. */
|
---|
| 390 | VBGLREQHDR Hdr;
|
---|
| 391 | /** The physical address of the following VMMDevHGCMCall structure. */
|
---|
[100267] | 392 | RTGCPHYS64 GCPhysReq;
|
---|
| 393 | uint64_t uTimestamp[2]; /** @todo Looks completely unused. */
|
---|
[75547] | 394 | /** Set if interruptible. */
|
---|
| 395 | bool fInterruptible;
|
---|
| 396 | /** Reserved. */
|
---|
| 397 | uint8_t abReserved0[3];
|
---|
| 398 | /* After this structure follows a VMMDevHGCMCall strcuture (44 bytes), then
|
---|
| 399 | zero or more HGCMFunctionParameter structures (12 or 16 bytes), and finally
|
---|
| 400 | page lists and embedded buffers. */
|
---|
| 401 | } VBGLIOCIDCHGCMFASTCALL, RT_FAR *PVBGLIOCIDCHGCMFASTCALL;
|
---|
| 402 | #pragma pack()
|
---|
[100267] | 403 | AssertCompileSize(VBGLIOCIDCHGCMFASTCALL, /* 24 + 8 + 2*8 + 1 + 3 = 0x34 (52) = */ 0x34);
|
---|
[75547] | 404 |
|
---|
| 405 | /**
|
---|
| 406 | * Macro for initializing VBGLIOCIDCHGCMFASTCALL and the following
|
---|
| 407 | * VMMDevHGCMCall structures.
|
---|
| 408 | *
|
---|
| 409 | * @param a_pHdr The request header to initialize.
|
---|
[100267] | 410 | * @param a_HdrPhys The physical address corresponding to @a a_pHdr.
|
---|
[75547] | 411 | * @param a_pCall Pointer to the VMMDevHGCMCall structure.
|
---|
| 412 | * @param a_idClient The HGCM client ID.
|
---|
| 413 | * @param a_uFunction The HGCM function number.
|
---|
| 414 | * @param a_cParms The number of parameters following @a a_pCall.
|
---|
| 415 | * @param a_cbReq The size of the whole request.
|
---|
| 416 | */
|
---|
| 417 | #define VBGLIOCIDCHGCMFASTCALL_INIT(a_pHdr, a_HdrPhys, a_pCall, a_idClient, a_uFunction, a_cParms, a_cbReq) \
|
---|
| 418 | do { \
|
---|
| 419 | Assert((uintptr_t)(a_pHdr) + sizeof(VBGLIOCIDCHGCMFASTCALL) == (uintptr_t)(a_pCall)); \
|
---|
| 420 | VBGLREQHDR_INIT_EX(&(a_pHdr)->Hdr, a_cbReq, a_cbReq); \
|
---|
| 421 | pReq->Hdr.GCPhysReq = (a_HdrPhys) + sizeof(VBGLIOCIDCHGCMFASTCALL); \
|
---|
| 422 | pReq->Hdr.fInterruptible = false; \
|
---|
| 423 | \
|
---|
| 424 | (a_pCall)->header.header.size = (a_cbReq) - sizeof(VBGLIOCIDCHGCMFASTCALL); \
|
---|
| 425 | (a_pCall)->header.header.version = VBGLREQHDR_VERSION; \
|
---|
[77060] | 426 | (a_pCall)->header.header.requestType= (ARCH_BITS == 64 ? VMMDevReq_HGCMCall64 : VMMDevReq_HGCMCall32); \
|
---|
[75547] | 427 | (a_pCall)->header.header.rc = VERR_INTERNAL_ERROR; \
|
---|
| 428 | (a_pCall)->header.header.reserved1 = 0; \
|
---|
| 429 | (a_pCall)->header.header.fRequestor = VMMDEV_REQUESTOR_KERNEL | VMMDEV_REQUESTOR_USR_DRV_OTHER \
|
---|
| 430 | | VMMDEV_REQUESTOR_CON_DONT_KNOW | VMMDEV_REQUESTOR_TRUST_NOT_GIVEN; \
|
---|
| 431 | (a_pCall)->header.fu32Flags = 0; \
|
---|
| 432 | (a_pCall)->header.result = VERR_INTERNAL_ERROR; \
|
---|
| 433 | (a_pCall)->u32ClientID = (a_idClient); \
|
---|
| 434 | (a_pCall)->u32Function = (a_uFunction); \
|
---|
| 435 | (a_pCall)->cParms = (a_cParms); \
|
---|
| 436 | } while (0)
|
---|
| 437 |
|
---|
| 438 |
|
---|
| 439 | /** @} */
|
---|
| 440 |
|
---|
[68550] | 441 | #endif /* VBOX_WITH_HGCM */
|
---|
| 442 |
|
---|
| 443 |
|
---|
| 444 | /** @name VBGL_IOCTL_LOG
|
---|
| 445 | * IOCTL to VBoxGuest to perform backdoor logging.
|
---|
| 446 | * @{ */
|
---|
| 447 | #define VBOXGUEST_IOCTL_LOG(Size)
|
---|
[68623] | 448 | #define VBGL_IOCTL_LOG(a_cchMsg) VBGL_IOCTL_CODE_BIG(9)
|
---|
[68550] | 449 | #define VBGL_IOCTL_LOG_SIZE(a_cchMsg) (sizeof(VBGLREQHDR) + (a_cchMsg) + 1)
|
---|
| 450 | #define VBGL_IOCTL_LOG_SIZE_IN(a_cchMsg) (sizeof(VBGLREQHDR) + (a_cchMsg) + 1)
|
---|
| 451 | #define VBGL_IOCTL_LOG_SIZE_OUT sizeof(VBGLREQHDR)
|
---|
| 452 | typedef struct VBGLIOCLOG
|
---|
[26999] | 453 | {
|
---|
[68550] | 454 | /** The header. */
|
---|
| 455 | VBGLREQHDR Hdr;
|
---|
| 456 | union
|
---|
| 457 | {
|
---|
| 458 | struct
|
---|
| 459 | {
|
---|
| 460 | /** The log message.
|
---|
| 461 | * The length is determined from the input size and zero termination. */
|
---|
| 462 | char szMsg[RT_FLEXIBLE_ARRAY_IN_NESTED_UNION];
|
---|
| 463 | } In;
|
---|
| 464 | } u;
|
---|
[68573] | 465 | } VBGLIOCLOG, RT_FAR *PVBGLIOCLOG;
|
---|
[68550] | 466 | /** @} */
|
---|
[26999] | 467 |
|
---|
| 468 |
|
---|
[68550] | 469 | /** @name VBGL_IOCTL_WAIT_FOR_EVENTS
|
---|
| 470 | * Wait for a VMMDev host event notification.
|
---|
| 471 | * @{
|
---|
| 472 | */
|
---|
[68963] | 473 | #define VBGL_IOCTL_WAIT_FOR_EVENTS VBGL_IOCTL_CODE_SIZE(10, VBGL_IOCTL_WAIT_FOR_EVENTS_SIZE)
|
---|
[68550] | 474 | #define VBGL_IOCTL_WAIT_FOR_EVENTS_SIZE sizeof(VBGLIOCWAITFOREVENTS)
|
---|
| 475 | #define VBGL_IOCTL_WAIT_FOR_EVENTS_SIZE_IN sizeof(VBGLIOCWAITFOREVENTS)
|
---|
| 476 | #define VBGL_IOCTL_WAIT_FOR_EVENTS_SIZE_OUT RT_UOFFSET_AFTER(VBGLIOCWAITFOREVENTS, u.Out)
|
---|
| 477 | typedef struct VBGLIOCWAITFOREVENTS
|
---|
[32574] | 478 | {
|
---|
[68550] | 479 | /** The header. */
|
---|
| 480 | VBGLREQHDR Hdr;
|
---|
| 481 | union
|
---|
| 482 | {
|
---|
| 483 | struct
|
---|
| 484 | {
|
---|
| 485 | /** Timeout in milliseconds. */
|
---|
| 486 | uint32_t cMsTimeOut;
|
---|
| 487 | /** Events to wait for. */
|
---|
| 488 | uint32_t fEvents;
|
---|
| 489 | } In;
|
---|
| 490 | struct
|
---|
| 491 | {
|
---|
| 492 | /** Events that occurred. */
|
---|
| 493 | uint32_t fEvents;
|
---|
| 494 | } Out;
|
---|
| 495 | } u;
|
---|
[68573] | 496 | } VBGLIOCWAITFOREVENTS, RT_FAR *PVBGLIOCWAITFOREVENTS;
|
---|
[68550] | 497 | AssertCompileSize(VBGLIOCWAITFOREVENTS, 24 + 8);
|
---|
| 498 | /** @} */
|
---|
[6247] | 499 |
|
---|
| 500 |
|
---|
[68550] | 501 | /** @name VBGL_IOCTL_INTERRUPT_ALL_WAIT_FOR_EVENTS
|
---|
| 502 | * IOCTL to VBoxGuest to interrupt (cancel) any pending
|
---|
| 503 | * VBGL_IOCTL_WAIT_FOR_EVENTS and return.
|
---|
| 504 | *
|
---|
| 505 | * Handled inside the guest additions and not seen by the host at all.
|
---|
| 506 | * After calling this, VBGL_IOCTL_WAIT_FOR_EVENTS should no longer be called in
|
---|
| 507 | * the same session. At the time of writing this is not enforced; at the time
|
---|
| 508 | * of reading it may be.
|
---|
| 509 | * @see VBGL_IOCTL_WAIT_FOR_EVENTS
|
---|
| 510 | *
|
---|
| 511 | * @{
|
---|
| 512 | */
|
---|
[68623] | 513 | #define VBGL_IOCTL_INTERRUPT_ALL_WAIT_FOR_EVENTS VBGL_IOCTL_CODE_SIZE(11, VBGL_IOCTL_INTERRUPT_ALL_WAIT_FOR_EVENTS_SIZE)
|
---|
[68550] | 514 | #define VBGL_IOCTL_INTERRUPT_ALL_WAIT_FOR_EVENTS_SIZE sizeof(VBGLREQHDR)
|
---|
| 515 | #define VBGL_IOCTL_INTERRUPT_ALL_WAIT_FOR_EVENTS_SIZE_IN sizeof(VBGLREQHDR)
|
---|
| 516 | #define VBGL_IOCTL_INTERRUPT_ALL_WAIT_FOR_EVENTS_SIZE_OUT sizeof(VBGLREQHDR)
|
---|
| 517 | /** @} */
|
---|
[21224] | 518 |
|
---|
[1] | 519 |
|
---|
[68550] | 520 | /** @name VBGL_IOCTL_CHANGE_FILTER_MASK
|
---|
| 521 | * IOCTL to VBoxGuest to control the event filter mask.
|
---|
| 522 | * @{ */
|
---|
[68623] | 523 | #define VBGL_IOCTL_CHANGE_FILTER_MASK VBGL_IOCTL_CODE_SIZE(12, VBGL_IOCTL_CHANGE_FILTER_MASK_SIZE)
|
---|
[68550] | 524 | #define VBGL_IOCTL_CHANGE_FILTER_MASK_SIZE sizeof(VBGLIOCCHANGEFILTERMASK)
|
---|
| 525 | #define VBGL_IOCTL_CHANGE_FILTER_MASK_SIZE_IN sizeof(VBGLIOCCHANGEFILTERMASK)
|
---|
| 526 | #define VBGL_IOCTL_CHANGE_FILTER_MASK_SIZE_OUT sizeof(VBGLREQHDR)
|
---|
| 527 | typedef struct VBGLIOCCHANGEFILTERMASK
|
---|
| 528 | {
|
---|
| 529 | /** The header. */
|
---|
| 530 | VBGLREQHDR Hdr;
|
---|
| 531 | union
|
---|
| 532 | {
|
---|
| 533 | struct
|
---|
| 534 | {
|
---|
| 535 | /** Flags to set. */
|
---|
| 536 | uint32_t fOrMask;
|
---|
| 537 | /** Flags to remove. */
|
---|
| 538 | uint32_t fNotMask;
|
---|
| 539 | } In;
|
---|
| 540 | } u;
|
---|
[68573] | 541 | } VBGLIOCCHANGEFILTERMASK, RT_FAR *PVBGLIOCCHANGEFILTERMASK;
|
---|
[68550] | 542 | AssertCompileSize(VBGLIOCCHANGEFILTERMASK, 24 + 8);
|
---|
| 543 | /** @} */
|
---|
[21224] | 544 |
|
---|
[1] | 545 |
|
---|
[85024] | 546 | /** @name VBGL_IOCTL_ACQUIRE_GUEST_CAPABILITIES
|
---|
[68550] | 547 | * IOCTL to for acquiring and releasing guest capabilities.
|
---|
| 548 | *
|
---|
| 549 | * This is used for multiple purposes:
|
---|
| 550 | * 1. By doing @a acquire r3 client application (e.g. VBoxTray) claims it will
|
---|
| 551 | * use the given session for performing operations like @a seamless or
|
---|
| 552 | * @a auto-resize, thus, if the application terminates, the driver will
|
---|
| 553 | * automatically cleanup the caps reported to host, so that host knows guest
|
---|
| 554 | * does not support them anymore
|
---|
| 555 | * 2. In a multy-user environment this will not allow r3 applications (like
|
---|
| 556 | * VBoxTray) running in different user sessions simultaneously to interfere
|
---|
| 557 | * with each other. An r3 client application (like VBoxTray) is responsible
|
---|
| 558 | * for Acquiring/Releasing caps properly as needed.
|
---|
| 559 | *
|
---|
| 560 | *
|
---|
| 561 | * VERR_RESOURCE_BUSY is returned if any capabilities in the fOrMask are
|
---|
| 562 | * currently acquired by some other VBoxGuest session.
|
---|
| 563 | *
|
---|
[85024] | 564 | * @todo Rename to VBGL_IOCTL_ACQUIRE_GUEST_CAPS
|
---|
[68550] | 565 | * @{
|
---|
| 566 | */
|
---|
[68623] | 567 | #define VBGL_IOCTL_ACQUIRE_GUEST_CAPABILITIES VBGL_IOCTL_CODE_SIZE(13, VBGL_IOCTL_ACQUIRE_GUEST_CAPABILITIES_SIZE)
|
---|
[68550] | 568 | #define VBGL_IOCTL_ACQUIRE_GUEST_CAPABILITIES_SIZE sizeof(VBGLIOCACQUIREGUESTCAPS)
|
---|
| 569 | #define VBGL_IOCTL_ACQUIRE_GUEST_CAPABILITIES_SIZE_IN sizeof(VBGLIOCACQUIREGUESTCAPS)
|
---|
| 570 | #define VBGL_IOCTL_ACQUIRE_GUEST_CAPABILITIES_SIZE_OUT sizeof(VBGLREQHDR)
|
---|
[40484] | 571 |
|
---|
[68550] | 572 | /** Default operation (full acquire/release). */
|
---|
| 573 | #define VBGL_IOC_AGC_FLAGS_DEFAULT UINT32_C(0x00000000)
|
---|
| 574 | /** Configures VBoxGuest to use the specified caps in Acquire mode, w/o making
|
---|
| 575 | * any caps acquisition/release. This is only possible to set acquire mode for
|
---|
| 576 | * caps, but not clear it, so fNotMask is ignored when this flag is set. */
|
---|
| 577 | #define VBGL_IOC_AGC_FLAGS_CONFIG_ACQUIRE_MODE UINT32_C(0x00000001)
|
---|
| 578 | /** Valid flag mask. */
|
---|
| 579 | #define VBGL_IOC_AGC_FLAGS_VALID_MASK UINT32_C(0x00000001)
|
---|
| 580 |
|
---|
| 581 | typedef struct VBGLIOCACQUIREGUESTCAPS
|
---|
| 582 | {
|
---|
| 583 | /** The header. */
|
---|
| 584 | VBGLREQHDR Hdr;
|
---|
| 585 | union
|
---|
| 586 | {
|
---|
| 587 | struct
|
---|
| 588 | {
|
---|
| 589 | /** Acquire flags (VBGL_IOC_AGC_FLAGS_XXX). */
|
---|
| 590 | uint32_t fFlags;
|
---|
| 591 | /** Guest capabilities to acquire (VMMDEV_GUEST_SUPPORTS_XXX). */
|
---|
| 592 | uint32_t fOrMask;
|
---|
| 593 | /** Guest capabilities to release (VMMDEV_GUEST_SUPPORTS_XXX). */
|
---|
| 594 | uint32_t fNotMask;
|
---|
| 595 | } In;
|
---|
| 596 | } u;
|
---|
[68573] | 597 | } VBGLIOCACQUIREGUESTCAPS, RT_FAR *PVBGLIOCACQUIREGUESTCAPS;
|
---|
[68550] | 598 | AssertCompileSize(VBGLIOCACQUIREGUESTCAPS, 24 + 12);
|
---|
[21224] | 599 | /** @} */
|
---|
[1] | 600 |
|
---|
| 601 |
|
---|
[68550] | 602 | /** @name VBGL_IOCTL_CHANGE_GUEST_CAPABILITIES
|
---|
| 603 | * IOCTL to VBoxGuest to set guest capabilities.
|
---|
| 604 | * @{ */
|
---|
[68623] | 605 | #define VBGL_IOCTL_CHANGE_GUEST_CAPABILITIES VBGL_IOCTL_CODE_SIZE(14, VBGL_IOCTL_CHANGE_GUEST_CAPABILITIES_SIZE)
|
---|
[68550] | 606 | #define VBGL_IOCTL_CHANGE_GUEST_CAPABILITIES_SIZE sizeof(VBGLIOCSETGUESTCAPS)
|
---|
| 607 | #define VBGL_IOCTL_CHANGE_GUEST_CAPABILITIES_SIZE_IN sizeof(VBGLIOCSETGUESTCAPS)
|
---|
| 608 | #define VBGL_IOCTL_CHANGE_GUEST_CAPABILITIES_SIZE_OUT sizeof(VBGLIOCSETGUESTCAPS)
|
---|
| 609 | typedef struct VBGLIOCSETGUESTCAPS
|
---|
| 610 | {
|
---|
| 611 | /** The header. */
|
---|
| 612 | VBGLREQHDR Hdr;
|
---|
| 613 | union
|
---|
| 614 | {
|
---|
| 615 | struct
|
---|
| 616 | {
|
---|
| 617 | /** The capabilities to set (VMMDEV_GUEST_SUPPORTS_XXX). */
|
---|
| 618 | uint32_t fOrMask;
|
---|
| 619 | /** The capabilities to drop (VMMDEV_GUEST_SUPPORTS_XXX). */
|
---|
| 620 | uint32_t fNotMask;
|
---|
| 621 | } In;
|
---|
| 622 | struct
|
---|
| 623 | {
|
---|
| 624 | /** The capabilities held by the session after the call (VMMDEV_GUEST_SUPPORTS_XXX). */
|
---|
| 625 | uint32_t fSessionCaps;
|
---|
| 626 | /** The capabilities for all the sessions after the call (VMMDEV_GUEST_SUPPORTS_XXX). */
|
---|
| 627 | uint32_t fGlobalCaps;
|
---|
| 628 | } Out;
|
---|
| 629 | } u;
|
---|
[68573] | 630 | } VBGLIOCSETGUESTCAPS, RT_FAR *PVBGLIOCSETGUESTCAPS;
|
---|
[68550] | 631 | AssertCompileSize(VBGLIOCSETGUESTCAPS, 24 + 8);
|
---|
| 632 | typedef VBGLIOCSETGUESTCAPS VBoxGuestSetCapabilitiesInfo;
|
---|
| 633 | /** @} */
|
---|
[1] | 634 |
|
---|
[44992] | 635 |
|
---|
[68550] | 636 | /** @name VBGL_IOCTL_SET_MOUSE_STATUS
|
---|
| 637 | * IOCTL to VBoxGuest to update the mouse status features.
|
---|
| 638 | * @{ */
|
---|
[68623] | 639 | #define VBGL_IOCTL_SET_MOUSE_STATUS VBGL_IOCTL_CODE_SIZE(15, VBGL_IOCTL_SET_MOUSE_STATUS_SIZE)
|
---|
[68550] | 640 | #define VBGL_IOCTL_SET_MOUSE_STATUS_SIZE sizeof(VBGLIOCSETMOUSESTATUS)
|
---|
| 641 | #define VBGL_IOCTL_SET_MOUSE_STATUS_SIZE_IN sizeof(VBGLIOCSETMOUSESTATUS)
|
---|
| 642 | #define VBGL_IOCTL_SET_MOUSE_STATUS_SIZE_OUT sizeof(VBGLREQHDR)
|
---|
| 643 | typedef struct VBGLIOCSETMOUSESTATUS
|
---|
| 644 | {
|
---|
| 645 | /** The header. */
|
---|
| 646 | VBGLREQHDR Hdr;
|
---|
| 647 | union
|
---|
| 648 | {
|
---|
| 649 | struct
|
---|
| 650 | {
|
---|
| 651 | /** Mouse status flags (VMMDEV_MOUSE_XXX). */
|
---|
| 652 | uint32_t fStatus;
|
---|
| 653 | } In;
|
---|
| 654 | } u;
|
---|
[68573] | 655 | } VBGLIOCSETMOUSESTATUS, RT_FAR *PVBGLIOCSETMOUSESTATUS;
|
---|
[68550] | 656 | /** @} */
|
---|
[41642] | 657 |
|
---|
[50537] | 658 |
|
---|
[68550] | 659 | /** @name VBGL_IOCTL_SET_MOUSE_NOTIFY_CALLBACK
|
---|
| 660 | *
|
---|
| 661 | * IOCTL to for setting the mouse driver callback.
|
---|
| 662 | * @note The callback will be called in interrupt context with the VBoxGuest
|
---|
| 663 | * device event spinlock held.
|
---|
| 664 | * @note ring-0 only.
|
---|
| 665 | *
|
---|
| 666 | * @{ */
|
---|
[68623] | 667 | #define VBGL_IOCTL_SET_MOUSE_NOTIFY_CALLBACK VBGL_IOCTL_CODE_SIZE(16, VBGL_IOCTL_SET_MOUSE_NOTIFY_CALLBACK_SIZE)
|
---|
[68550] | 668 | #define VBGL_IOCTL_SET_MOUSE_NOTIFY_CALLBACK_SIZE sizeof(VBGLIOCSETMOUSENOTIFYCALLBACK)
|
---|
| 669 | #define VBGL_IOCTL_SET_MOUSE_NOTIFY_CALLBACK_SIZE_IN sizeof(VBGLIOCSETMOUSENOTIFYCALLBACK)
|
---|
| 670 | #define VBGL_IOCTL_SET_MOUSE_NOTIFY_CALLBACK_SIZE_OUT sizeof(VBGLREQHDR)
|
---|
| 671 | typedef struct VBGLIOCSETMOUSENOTIFYCALLBACK
|
---|
[50537] | 672 | {
|
---|
[68550] | 673 | /** The header. */
|
---|
| 674 | VBGLREQHDR Hdr;
|
---|
| 675 | union
|
---|
| 676 | {
|
---|
| 677 | struct
|
---|
| 678 | {
|
---|
| 679 | /** Mouse notification callback function. */
|
---|
| 680 | PFNVBOXGUESTMOUSENOTIFY pfnNotify;
|
---|
| 681 | /** The callback argument. */
|
---|
[68573] | 682 | void RT_FAR *pvUser;
|
---|
[68550] | 683 | } In;
|
---|
| 684 | } u;
|
---|
[68573] | 685 | } VBGLIOCSETMOUSENOTIFYCALLBACK, RT_FAR *PVBGLIOCSETMOUSENOTIFYCALLBACK;
|
---|
[68550] | 686 | /** @} */
|
---|
[50537] | 687 |
|
---|
| 688 |
|
---|
[68550] | 689 | /** @name VBGL_IOCTL_CHECK_BALLOON
|
---|
| 690 | * IOCTL to VBoxGuest to check memory ballooning.
|
---|
| 691 | *
|
---|
| 692 | * The guest kernel module / device driver will ask the host for the current size of
|
---|
| 693 | * the balloon and adjust the size. Or it will set fHandledInR0 = false and R3 is
|
---|
| 694 | * responsible for allocating memory and calling R0 (VBGL_IOCTL_CHANGE_BALLOON).
|
---|
| 695 | * @{ */
|
---|
[68623] | 696 | #define VBGL_IOCTL_CHECK_BALLOON VBGL_IOCTL_CODE_SIZE(17, VBGL_IOCTL_CHECK_BALLOON_SIZE)
|
---|
[68550] | 697 | #define VBGL_IOCTL_CHECK_BALLOON_SIZE sizeof(VBGLIOCCHECKBALLOON)
|
---|
| 698 | #define VBGL_IOCTL_CHECK_BALLOON_SIZE_IN sizeof(VBGLREQHDR)
|
---|
| 699 | #define VBGL_IOCTL_CHECK_BALLOON_SIZE_OUT sizeof(VBGLIOCCHECKBALLOON)
|
---|
| 700 | typedef struct VBGLIOCCHECKBALLOON
|
---|
[46196] | 701 | {
|
---|
[68550] | 702 | /** The header. */
|
---|
| 703 | VBGLREQHDR Hdr;
|
---|
| 704 | union
|
---|
| 705 | {
|
---|
| 706 | struct
|
---|
| 707 | {
|
---|
| 708 | /** The size of the balloon in chunks of 1MB. */
|
---|
| 709 | uint32_t cBalloonChunks;
|
---|
| 710 | /** false = handled in R0, no further action required.
|
---|
| 711 | * true = allocate balloon memory in R3. */
|
---|
| 712 | bool fHandleInR3;
|
---|
| 713 | /** Explicit padding, please ignore. */
|
---|
| 714 | bool afPadding[3];
|
---|
| 715 | } Out;
|
---|
| 716 | } u;
|
---|
[68573] | 717 | } VBGLIOCCHECKBALLOON, RT_FAR *PVBGLIOCCHECKBALLOON;
|
---|
[68550] | 718 | AssertCompileSize(VBGLIOCCHECKBALLOON, 24 + 8);
|
---|
| 719 | typedef VBGLIOCCHECKBALLOON VBoxGuestCheckBalloonInfo;
|
---|
| 720 | /** @} */
|
---|
[46196] | 721 |
|
---|
[68550] | 722 |
|
---|
| 723 | /** @name VBGL_IOCTL_CHANGE_BALLOON
|
---|
| 724 | * IOCTL to VBoxGuest to supply or revoke one chunk for ballooning.
|
---|
| 725 | *
|
---|
| 726 | * The guest kernel module / device driver will lock down supplied memory or
|
---|
| 727 | * unlock reclaimed memory and then forward the physical addresses of the
|
---|
| 728 | * changed balloon chunk to the host.
|
---|
| 729 | *
|
---|
| 730 | * @{ */
|
---|
[68623] | 731 | #define VBGL_IOCTL_CHANGE_BALLOON VBGL_IOCTL_CODE_SIZE(18, VBGL_IOCTL_CHANGE_BALLOON_SIZE)
|
---|
[68550] | 732 | #define VBGL_IOCTL_CHANGE_BALLOON_SIZE sizeof(VBGLIOCCHANGEBALLOON)
|
---|
| 733 | #define VBGL_IOCTL_CHANGE_BALLOON_SIZE_IN sizeof(VBGLIOCCHANGEBALLOON)
|
---|
| 734 | #define VBGL_IOCTL_CHANGE_BALLOON_SIZE_OUT sizeof(VBGLREQHDR)
|
---|
| 735 | typedef struct VBGLIOCCHANGEBALLOON
|
---|
[45760] | 736 | {
|
---|
[68550] | 737 | /** The header. */
|
---|
| 738 | VBGLREQHDR Hdr;
|
---|
| 739 | union
|
---|
| 740 | {
|
---|
| 741 | struct
|
---|
| 742 | {
|
---|
| 743 | /** Address of the chunk (user space address). */
|
---|
| 744 | RTR3PTR pvChunk;
|
---|
| 745 | /** Explicit alignment padding, MBZ. */
|
---|
[68573] | 746 | uint8_t abPadding[ARCH_BITS == 64 ? 0 + 7 : 4 + 7];
|
---|
[68550] | 747 | /** true = inflate, false = deflate. */
|
---|
| 748 | bool fInflate;
|
---|
| 749 | } In;
|
---|
| 750 | } u;
|
---|
[68573] | 751 | } VBGLIOCCHANGEBALLOON, RT_FAR *PVBGLIOCCHANGEBALLOON;
|
---|
[68550] | 752 | AssertCompileSize(VBGLIOCCHANGEBALLOON, 24+16);
|
---|
| 753 | /** @} */
|
---|
[45760] | 754 |
|
---|
| 755 |
|
---|
[68550] | 756 | /** @name VBGL_IOCTL_WRITE_CORE_DUMP
|
---|
| 757 | * IOCTL to VBoxGuest to write guest core.
|
---|
| 758 | * @{ */
|
---|
[68623] | 759 | #define VBGL_IOCTL_WRITE_CORE_DUMP VBGL_IOCTL_CODE_SIZE(19, VBGL_IOCTL_WRITE_CORE_DUMP_SIZE)
|
---|
[68550] | 760 | #define VBGL_IOCTL_WRITE_CORE_DUMP_SIZE sizeof(VBGLIOCWRITECOREDUMP)
|
---|
| 761 | #define VBGL_IOCTL_WRITE_CORE_DUMP_SIZE_IN sizeof(VBGLIOCWRITECOREDUMP)
|
---|
| 762 | #define VBGL_IOCTL_WRITE_CORE_DUMP_SIZE_OUT sizeof(VBGLREQHDR)
|
---|
| 763 | typedef struct VBGLIOCWRITECOREDUMP
|
---|
[50524] | 764 | {
|
---|
[68550] | 765 | /** The header. */
|
---|
| 766 | VBGLREQHDR Hdr;
|
---|
| 767 | union
|
---|
| 768 | {
|
---|
| 769 | struct
|
---|
| 770 | {
|
---|
| 771 | /** Flags (reserved, MBZ). */
|
---|
| 772 | uint32_t fFlags;
|
---|
| 773 | } In;
|
---|
| 774 | } u;
|
---|
[68573] | 775 | } VBGLIOCWRITECOREDUMP, RT_FAR *PVBGLIOCWRITECOREDUMP;
|
---|
[68550] | 776 | AssertCompileSize(VBGLIOCWRITECOREDUMP, 24 + 4);
|
---|
| 777 | typedef VBGLIOCWRITECOREDUMP VBoxGuestWriteCoreDump;
|
---|
| 778 | /** @} */
|
---|
[45760] | 779 |
|
---|
[50524] | 780 |
|
---|
[68550] | 781 | #ifdef VBOX_WITH_DPC_LATENCY_CHECKER
|
---|
| 782 | /** @name VBGL_IOCTL_DPC_LATENCY_CHECKER
|
---|
| 783 | * IOCTL to VBoxGuest to perform DPC latency tests, printing the result in
|
---|
| 784 | * the release log on the host. Takes no data, returns no data.
|
---|
| 785 | * @{ */
|
---|
[68623] | 786 | # define VBGL_IOCTL_DPC_LATENCY_CHECKER VBGL_IOCTL_CODE_SIZE(20, VBGL_IOCTL_DPC_LATENCY_CHECKER_SIZE)
|
---|
[68550] | 787 | # define VBGL_IOCTL_DPC_LATENCY_CHECKER_SIZE sizeof(VBGLREQHDR)
|
---|
| 788 | # define VBGL_IOCTL_DPC_LATENCY_CHECKER_SIZE_IN sizeof(VBGLREQHDR)
|
---|
| 789 | # define VBGL_IOCTL_DPC_LATENCY_CHECKER_SIZE_OUT sizeof(VBGLREQHDR)
|
---|
| 790 | /** @} */
|
---|
| 791 | #endif
|
---|
| 792 |
|
---|
| 793 |
|
---|
[3638] | 794 | #ifdef RT_OS_OS2
|
---|
[6030] | 795 | /**
|
---|
[3255] | 796 | * The data buffer layout for the IDC entry point (AttachDD).
|
---|
[6030] | 797 | *
|
---|
| 798 | * @remark This is defined in multiple 16-bit headers / sources.
|
---|
[3255] | 799 | * Some places it's called VBGOS2IDC to short things a bit.
|
---|
[3241] | 800 | */
|
---|
[68575] | 801 | typedef struct VBGLOS2ATTACHDD
|
---|
[3241] | 802 | {
|
---|
[68570] | 803 | /** VBGL_IOC_VERSION. */
|
---|
[3241] | 804 | uint32_t u32Version;
|
---|
| 805 | /** Opaque session handle. */
|
---|
| 806 | uint32_t u32Session;
|
---|
| 807 |
|
---|
| 808 | /**
|
---|
| 809 | * The 32-bit service entry point.
|
---|
[6030] | 810 | *
|
---|
| 811 | * @returns VBox status code.
|
---|
[68570] | 812 | * @param u32Session The session handle (PVBOXGUESTSESSION).
|
---|
[3241] | 813 | * @param iFunction The requested function.
|
---|
[68570] | 814 | * @param pReqHdr The input/output data buffer. The caller
|
---|
| 815 | * ensures that this cannot be swapped out, or that
|
---|
| 816 | * it's acceptable to take a page in fault in the
|
---|
| 817 | * current context. If the request doesn't take
|
---|
| 818 | * input or produces output, apssing NULL is okay.
|
---|
| 819 | * @param cbReq The size of the data buffer.
|
---|
[3241] | 820 | */
|
---|
[68573] | 821 | # if ARCH_BITS == 32 || defined(DOXYGEN_RUNNING)
|
---|
[85121] | 822 | DECLCALLBACKMEMBER(int, pfnServiceEP,(uint32_t u32Session, unsigned iFunction, PVBGLREQHDR pReqHdr, size_t cbReq));
|
---|
[68573] | 823 | # else
|
---|
| 824 | uint32_t pfnServiceEP;
|
---|
| 825 | #endif
|
---|
[3241] | 826 |
|
---|
[6030] | 827 | /** The 16-bit service entry point for C code (cdecl).
|
---|
| 828 | *
|
---|
| 829 | * It's the same as the 32-bit entry point, but the types has
|
---|
[3241] | 830 | * changed to 16-bit equivalents.
|
---|
[6030] | 831 | *
|
---|
[3241] | 832 | * @code
|
---|
[6030] | 833 | * int far cdecl
|
---|
| 834 | * VBoxGuestOs2IDCService16(uint32_t u32Session, uint16_t iFunction,
|
---|
[68570] | 835 | * PVBGLREQHDR fpvData, uint16_t cbData);
|
---|
[3241] | 836 | * @endcode
|
---|
| 837 | */
|
---|
[68573] | 838 | # if ARCH_BITS == 16 || defined(DOXYGEN_RUNNING)
|
---|
[85121] | 839 | DECLCALLBACKMEMBER(int, fpfnServiceEP,(uint32_t u32Session, uint16_t iFunction, PVBGLREQHDR fpvData, uint16_t cbData));
|
---|
[68573] | 840 | # else
|
---|
[3241] | 841 | RTFAR16 fpfnServiceEP;
|
---|
[68573] | 842 | # endif
|
---|
[3241] | 843 |
|
---|
[6030] | 844 | /** The 16-bit service entry point for Assembly code (register).
|
---|
| 845 | *
|
---|
[3241] | 846 | * This is just a wrapper around fpfnServiceEP to simplify calls
|
---|
| 847 | * from 16-bit assembly code.
|
---|
| 848 | *
|
---|
| 849 | * @returns (e)ax: VBox status code; cx: The amount of data returned.
|
---|
[6030] | 850 | *
|
---|
[3241] | 851 | * @param u32Session eax - The above session handle.
|
---|
| 852 | * @param iFunction dl - The requested function.
|
---|
| 853 | * @param pvData es:bx - The input/output data buffer.
|
---|
| 854 | * @param cbData cx - The size of the data buffer.
|
---|
| 855 | */
|
---|
| 856 | RTFAR16 fpfnServiceAsmEP;
|
---|
[68575] | 857 | } VBGLOS2ATTACHDD;
|
---|
[3241] | 858 | /** Pointer to VBOXGUESTOS2IDCCONNECT buffer. */
|
---|
[68575] | 859 | typedef VBGLOS2ATTACHDD RT_FAR *PVBGLOS2ATTACHDD;
|
---|
| 860 |
|
---|
| 861 | /**
|
---|
| 862 | * Prototype for the 16-bit callback returned by AttachDD on OS/2.
|
---|
| 863 | * @param pAttachInfo Pointer to structure to fill in.
|
---|
| 864 | */
|
---|
[68576] | 865 | # if defined(__IBMC__) || defined(__IBMCPP__)
|
---|
| 866 | typedef void (* __cdecl RT_FAR_CODE PFNVBGLOS2ATTACHDD)(PVBGLOS2ATTACHDD pAttachInfo);
|
---|
| 867 | # else
|
---|
[68575] | 868 | typedef void (__cdecl RT_FAR_CODE *PFNVBGLOS2ATTACHDD)(PVBGLOS2ATTACHDD pAttachInfo);
|
---|
[68576] | 869 | # endif
|
---|
[68550] | 870 | #endif /* RT_OS_OS2 */
|
---|
[3241] | 871 |
|
---|
[68550] | 872 |
|
---|
| 873 | /** @name VBGL_IOCL_IDC_CONNECT
|
---|
| 874 | * IDC client connect request.
|
---|
[6030] | 875 | *
|
---|
[68550] | 876 | * On platforms other than Windows and OS/2, this will also create a kernel
|
---|
| 877 | * session for the caller.
|
---|
| 878 | *
|
---|
| 879 | * @note ring-0 only.
|
---|
[75547] | 880 | * @{
|
---|
[3241] | 881 | */
|
---|
[68623] | 882 | #define VBGL_IOCTL_IDC_CONNECT VBGL_IOCTL_CODE_SIZE(63, VBGL_IOCTL_IDC_CONNECT_SIZE)
|
---|
[68550] | 883 | #define VBGL_IOCTL_IDC_CONNECT_SIZE sizeof(VBGLIOCIDCCONNECT)
|
---|
| 884 | #define VBGL_IOCTL_IDC_CONNECT_SIZE_IN RT_UOFFSET_AFTER(VBGLIOCIDCCONNECT, u.In)
|
---|
| 885 | #define VBGL_IOCTL_IDC_CONNECT_SIZE_OUT sizeof(VBGLIOCIDCCONNECT)
|
---|
| 886 | typedef struct VBGLIOCIDCCONNECT
|
---|
| 887 | {
|
---|
| 888 | /** The header. */
|
---|
| 889 | VBGLREQHDR Hdr;
|
---|
| 890 | /** The payload union. */
|
---|
| 891 | union
|
---|
| 892 | {
|
---|
| 893 | struct
|
---|
| 894 | {
|
---|
| 895 | /** VBGL_IOCTL_IDC_CONNECT_MAGIC_COOKIE. */
|
---|
| 896 | uint32_t u32MagicCookie;
|
---|
| 897 | /** The desired version of the I/O control interface (VBGL_IOC_VERSION). */
|
---|
| 898 | uint32_t uReqVersion;
|
---|
| 899 | /** The minimum version of the I/O control interface (VBGL_IOC_VERSION). */
|
---|
| 900 | uint32_t uMinVersion;
|
---|
| 901 | /** Reserved, MBZ. */
|
---|
| 902 | uint32_t uReserved;
|
---|
| 903 | } In;
|
---|
| 904 | struct
|
---|
| 905 | {
|
---|
| 906 | /** The session handle (opaque). */
|
---|
[68575] | 907 | #if ARCH_BITS >= 32
|
---|
[68573] | 908 | void RT_FAR *pvSession;
|
---|
[68575] | 909 | #else
|
---|
| 910 | uint32_t pvSession;
|
---|
| 911 | #endif
|
---|
[68550] | 912 | /** The version of the I/O control interface for this session
|
---|
| 913 | * (typically VBGL_IOC_VERSION). */
|
---|
| 914 | uint32_t uSessionVersion;
|
---|
| 915 | /** The I/O control interface version for of the driver (VBGL_IOC_VERSION). */
|
---|
| 916 | uint32_t uDriverVersion;
|
---|
| 917 | /** The SVN revision of the driver.
|
---|
| 918 | * This will be set to 0 if not compiled into the driver. */
|
---|
| 919 | uint32_t uDriverRevision;
|
---|
| 920 | /** Reserved \#1 (will be returned as zero until defined). */
|
---|
| 921 | uint32_t uReserved1;
|
---|
| 922 | /** Reserved \#2 (will be returned as NULL until defined). */
|
---|
[68573] | 923 | void RT_FAR *pvReserved2;
|
---|
[68550] | 924 | } Out;
|
---|
| 925 | } u;
|
---|
[68573] | 926 | } VBGLIOCIDCCONNECT, RT_FAR *PVBGLIOCIDCCONNECT;
|
---|
| 927 | AssertCompileSize(VBGLIOCIDCCONNECT, 24 + 16 + (ARCH_BITS == 64 ? 8 : 4) * 2);
|
---|
[68586] | 928 | #if !defined(__GNUC__) /* Some GCC versions can't handle the complicated RT_UOFFSET_AFTER macro, it seems. */ \
|
---|
[68616] | 929 | && (!defined(RT_OS_OS2) || (!defined(__IBMC__) && !defined(__IBMCPP__) && (!defined(__WATCOMC__) || !defined(__cplusplus))))
|
---|
[68550] | 930 | AssertCompile(VBGL_IOCTL_IDC_CONNECT_SIZE_IN == 24 + 16);
|
---|
[68570] | 931 | #endif
|
---|
[68550] | 932 | #define VBGL_IOCTL_IDC_CONNECT_MAGIC_COOKIE UINT32_C(0x55aa4d5a) /**< Magic value for doing an IDC connect. */
|
---|
| 933 | /** @} */
|
---|
[3241] | 934 |
|
---|
| 935 |
|
---|
[68550] | 936 | /** @name VBGL_IOCL_IDC_DISCONNECT
|
---|
| 937 | * IDC client disconnect request.
|
---|
| 938 | *
|
---|
| 939 | * This will destroy the kernel session associated with the IDC connection.
|
---|
| 940 | *
|
---|
| 941 | * @note ring-0 only.
|
---|
[75547] | 942 | * @{
|
---|
[68550] | 943 | */
|
---|
[68623] | 944 | #define VBGL_IOCTL_IDC_DISCONNECT VBGL_IOCTL_CODE_SIZE(62, VBGL_IOCTL_IDC_DISCONNECT_SIZE)
|
---|
[68550] | 945 | #define VBGL_IOCTL_IDC_DISCONNECT_SIZE sizeof(VBGLIOCIDCDISCONNECT)
|
---|
| 946 | #define VBGL_IOCTL_IDC_DISCONNECT_SIZE_IN sizeof(VBGLIOCIDCDISCONNECT)
|
---|
| 947 | #define VBGL_IOCTL_IDC_DISCONNECT_SIZE_OUT sizeof(VBGLREQHDR)
|
---|
| 948 | typedef struct VBGLIOCIDCDISCONNECT
|
---|
| 949 | {
|
---|
| 950 | /** The header. */
|
---|
| 951 | VBGLREQHDR Hdr;
|
---|
| 952 | union
|
---|
| 953 | {
|
---|
| 954 | struct
|
---|
| 955 | {
|
---|
| 956 | /** The session handle for platforms where this is needed. */
|
---|
[68575] | 957 | #if ARCH_BITS >= 32
|
---|
[68573] | 958 | void RT_FAR *pvSession;
|
---|
[68575] | 959 | #else
|
---|
| 960 | uint32_t pvSession;
|
---|
| 961 | #endif
|
---|
[68550] | 962 | } In;
|
---|
| 963 | } u;
|
---|
[68573] | 964 | } VBGLIOCIDCDISCONNECT, RT_FAR *PVBGLIOCIDCDISCONNECT;
|
---|
| 965 | AssertCompileSize(VBGLIOCIDCDISCONNECT, 24 + (ARCH_BITS == 64 ? 8 : 4));
|
---|
[68550] | 966 | /** @} */
|
---|
| 967 |
|
---|
| 968 |
|
---|
[68561] | 969 | #if !defined(RT_OS_WINDOWS) && !defined(RT_OS_OS2)
|
---|
| 970 | RT_C_DECLS_BEGIN
|
---|
| 971 | /**
|
---|
| 972 | * The VBoxGuest IDC entry point.
|
---|
| 973 | *
|
---|
| 974 | * @returns VBox status code.
|
---|
| 975 | * @param pvSession The session.
|
---|
| 976 | * @param uReq The request code.
|
---|
[68565] | 977 | * @param pReqHdr The request.
|
---|
[68561] | 978 | * @param cbReq The request size.
|
---|
| 979 | */
|
---|
[68573] | 980 | int VBOXCALL VBoxGuestIDC(void RT_FAR *pvSession, uintptr_t uReq, PVBGLREQHDR pReqHdr, size_t cbReq);
|
---|
[68561] | 981 | RT_C_DECLS_END
|
---|
| 982 | #endif
|
---|
| 983 |
|
---|
| 984 |
|
---|
[49633] | 985 | #if defined(RT_OS_LINUX) || defined(RT_OS_SOLARIS) || defined(RT_OS_FREEBSD)
|
---|
[49627] | 986 |
|
---|
| 987 | /* Private IOCtls between user space and the kernel video driver. DRM private
|
---|
| 988 | * IOCtls always have the type 'd' and a number between 0x40 and 0x99 (0x9F?) */
|
---|
| 989 |
|
---|
| 990 | # define VBOX_DRM_IOCTL(a) (0x40 + DRM_VBOX_ ## a)
|
---|
| 991 |
|
---|
| 992 | /** Stop using HGSMI in the kernel driver until it is re-enabled, so that a
|
---|
| 993 | * user-space driver can use it. It must be re-enabled before the kernel
|
---|
| 994 | * driver can be used again in a sensible way. */
|
---|
[52867] | 995 | /** @note These IOCtls was removed from the code, but are left here as
|
---|
| 996 | * templates as we may need similar ones in future. */
|
---|
[49627] | 997 | # define DRM_VBOX_DISABLE_HGSMI 0
|
---|
| 998 | # define DRM_IOCTL_VBOX_DISABLE_HGSMI VBOX_DRM_IOCTL(DISABLE_HGSMI)
|
---|
| 999 | # define VBOXVIDEO_IOCTL_DISABLE_HGSMI _IO('d', DRM_IOCTL_VBOX_DISABLE_HGSMI)
|
---|
| 1000 | /** Enable HGSMI in the kernel driver after it was previously disabled. */
|
---|
| 1001 | # define DRM_VBOX_ENABLE_HGSMI 1
|
---|
| 1002 | # define DRM_IOCTL_VBOX_ENABLE_HGSMI VBOX_DRM_IOCTL(ENABLE_HGSMI)
|
---|
| 1003 | # define VBOXVIDEO_IOCTL_ENABLE_HGSMI _IO('d', DRM_IOCTL_VBOX_ENABLE_HGSMI)
|
---|
| 1004 |
|
---|
[49633] | 1005 | #endif /* RT_OS_LINUX || RT_OS_SOLARIS || RT_OS_FREEBSD */
|
---|
[49627] | 1006 |
|
---|
[14021] | 1007 | #endif /* !defined(IN_RC) && !defined(IN_RING0_AGNOSTIC) && !defined(IPRT_NO_CRT) */
|
---|
[1] | 1008 |
|
---|
[53615] | 1009 | /** @} */
|
---|
| 1010 |
|
---|
[58111] | 1011 | /** @} */
|
---|
[76585] | 1012 | #endif /* !VBOX_INCLUDED_VBoxGuest_h */
|
---|
[21211] | 1013 |
|
---|