VirtualBox

source: vbox/trunk/include/VBox/VBoxGuest.h@ 58803

Last change on this file since 58803 was 58116, checked in by vboxsync, 9 years ago

VMM: Doxygen fixes.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 23.3 KB
Line 
1/** @file
2 * VBoxGuest - VirtualBox Guest Additions Driver Interface. (ADD,DEV)
3 *
4 * @remarks This is in the process of being split up and usage cleaned up.
5 */
6
7/*
8 * Copyright (C) 2006-2015 Oracle Corporation
9 *
10 * This file is part of VirtualBox Open Source Edition (OSE), as
11 * available from http://www.virtualbox.org. This file is free software;
12 * you can redistribute it and/or modify it under the terms of the GNU
13 * General Public License (GPL) as published by the Free Software
14 * Foundation, in version 2 as it comes in the "COPYING" file of the
15 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
16 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
17 *
18 * The contents of this file may alternatively be used under the terms
19 * of the Common Development and Distribution License Version 1.0
20 * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
21 * VirtualBox OSE distribution, in which case the provisions of the
22 * CDDL are applicable instead of those of the GPL.
23 *
24 * You may elect to license modified versions of this file under the
25 * terms and conditions of either the GPL or the CDDL or both.
26 */
27
28#ifndef ___VBox_VBoxGuest_h
29#define ___VBox_VBoxGuest_h
30
31#include <VBox/cdefs.h>
32#include <VBox/types.h>
33#include <iprt/assert.h>
34#include <VBox/VMMDev2.h>
35#include <VBox/VBoxGuest2.h>
36
37
38/** @defgroup grp_vboxguest VirtualBox Guest Additions Device Driver
39 *
40 * Also know as VBoxGuest.
41 *
42 * @{
43 */
44
45/** @defgroup grp_vboxguest_ioc VirtualBox Guest Additions Driver Interface
46 * @{
47 */
48
49/** @todo It would be nice if we could have two defines without paths. */
50
51/** @def VBOXGUEST_DEVICE_NAME
52 * The support device name. */
53/** @def VBOXGUEST_USER_DEVICE_NAME
54 * The support device name of the user accessible device node. */
55
56#if defined(RT_OS_OS2)
57# define VBOXGUEST_DEVICE_NAME "\\Dev\\VBoxGst$"
58
59#elif defined(RT_OS_WINDOWS)
60# define VBOXGUEST_DEVICE_NAME "\\\\.\\VBoxGuest"
61
62/** The support service name. */
63# define VBOXGUEST_SERVICE_NAME "VBoxGuest"
64/** Global name for Win2k+ */
65# define VBOXGUEST_DEVICE_NAME_GLOBAL "\\\\.\\Global\\VBoxGuest"
66/** Win32 driver name */
67# define VBOXGUEST_DEVICE_NAME_NT L"\\Device\\VBoxGuest"
68/** Device name. */
69# define VBOXGUEST_DEVICE_NAME_DOS L"\\DosDevices\\VBoxGuest"
70
71#elif defined(RT_OS_HAIKU)
72# define VBOXGUEST_DEVICE_NAME "/dev/misc/vboxguest"
73
74#else /* (PORTME) */
75# define VBOXGUEST_DEVICE_NAME "/dev/vboxguest"
76# if defined(RT_OS_LINUX)
77# define VBOXGUEST_USER_DEVICE_NAME "/dev/vboxuser"
78# endif
79#endif
80
81#ifndef VBOXGUEST_USER_DEVICE_NAME
82# define VBOXGUEST_USER_DEVICE_NAME VBOXGUEST_DEVICE_NAME
83#endif
84
85/** Fictive start address of the hypervisor physical memory for MmMapIoSpace. */
86#define VBOXGUEST_HYPERVISOR_PHYSICAL_START UINT32_C(0xf8000000)
87
88#ifdef RT_OS_DARWIN
89/** Cookie used to fend off some unwanted clients to the IOService. */
90# define VBOXGUEST_DARWIN_IOSERVICE_COOKIE UINT32_C(0x56426f78) /* 'VBox' */
91#endif
92
93#if !defined(IN_RC) && !defined(IN_RING0_AGNOSTIC) && !defined(IPRT_NO_CRT)
94
95/** @name VBoxGuest IOCTL codes and structures.
96 *
97 * The range 0..15 is for basic driver communication.
98 * The range 16..31 is for HGCM communication.
99 * The range 32..47 is reserved for future use.
100 * The range 48..63 is for OS specific communication.
101 * The 7th bit is reserved for future hacks.
102 * The 8th bit is reserved for distinguishing between 32-bit and 64-bit
103 * processes in future 64-bit guest additions.
104 *
105 * @remarks When creating new IOCtl interfaces keep in mind that not all OSes supports
106 * reporting back the output size. (This got messed up a little bit in VBoxDrv.)
107 *
108 * The request size is also a little bit tricky as it's passed as part of the
109 * request code on unix. The size field is 14 bits on Linux, 12 bits on *BSD,
110 * 13 bits Darwin, and 8-bits on Solaris. All the BSDs and Darwin kernels
111 * will make use of the size field, while Linux and Solaris will not. We're of
112 * course using the size to validate and/or map/lock the request, so it has
113 * to be valid.
114 *
115 * For Solaris we will have to do something special though, 255 isn't
116 * sufficient for all we need. A 4KB restriction (BSD) is probably not
117 * too problematic (yet) as a general one.
118 *
119 * More info can be found in SUPDRVIOC.h and related sources.
120 *
121 * @remarks If adding interfaces that only has input or only has output, some new macros
122 * needs to be created so the most efficient IOCtl data buffering method can be
123 * used.
124 * @{
125 */
126#if defined(RT_ARCH_AMD64) || defined(RT_ARCH_SPARC64)
127# define VBOXGUEST_IOCTL_FLAG 128
128#elif defined(RT_ARCH_X86) || defined(RT_ARCH_SPARC)
129# define VBOXGUEST_IOCTL_FLAG 0
130#else
131# error "dunno which arch this is!"
132#endif
133/** @} */
134
135/** Ring-3 request wrapper for big requests.
136 *
137 * This is necessary because the ioctl number scheme on many Unixy OSes (esp. Solaris)
138 * only allows a relatively small size to be encoded into the request. So, for big
139 * request this generic form is used instead. */
140typedef struct VBGLBIGREQ
141{
142 /** Magic value (VBGLBIGREQ_MAGIC). */
143 uint32_t u32Magic;
144 /** The size of the data buffer. */
145 uint32_t cbData;
146 /** The user address of the data buffer. */
147 RTR3PTR pvDataR3;
148#if HC_ARCH_BITS == 32
149 uint32_t u32Padding;
150#endif
151/** @todo r=bird: We need a 'rc' field for passing VBox status codes. Reused
152 * some input field as rc on output. */
153} VBGLBIGREQ;
154/** Pointer to a request wrapper for solaris guests. */
155typedef VBGLBIGREQ *PVBGLBIGREQ;
156/** Pointer to a const request wrapper for solaris guests. */
157typedef const VBGLBIGREQ *PCVBGLBIGREQ;
158
159/** The VBGLBIGREQ::u32Magic value (Ryuu Murakami). */
160#define VBGLBIGREQ_MAGIC 0x19520219
161
162
163#if defined(RT_OS_WINDOWS)
164/** @todo Remove IOCTL_CODE later! Integrate it in VBOXGUEST_IOCTL_CODE below. */
165/** @todo r=bird: IOCTL_CODE is supposedly defined in some header included by Windows.h or ntddk.h, which is why it wasn't in the #if 0 earlier. See HostDrivers/Support/SUPDrvIOC.h... */
166# define IOCTL_CODE(DeviceType, Function, Method, Access, DataSize_ignored) \
167 ( ((DeviceType) << 16) | ((Access) << 14) | ((Function) << 2) | (Method))
168# define VBOXGUEST_IOCTL_CODE_(Function, Size) IOCTL_CODE(FILE_DEVICE_UNKNOWN, 2048 + (Function), METHOD_BUFFERED, FILE_WRITE_ACCESS, 0)
169# define VBOXGUEST_IOCTL_STRIP_SIZE(Code) (Code)
170
171#elif defined(RT_OS_OS2)
172 /* No automatic buffering, size not encoded. */
173# define VBOXGUEST_IOCTL_CATEGORY 0xc2
174# define VBOXGUEST_IOCTL_CODE_(Function, Size) ((unsigned char)(Function))
175# define VBOXGUEST_IOCTL_CATEGORY_FAST 0xc3 /**< Also defined in VBoxGuestA-os2.asm. */
176# define VBOXGUEST_IOCTL_CODE_FAST_(Function) ((unsigned char)(Function))
177# define VBOXGUEST_IOCTL_STRIP_SIZE(Code) (Code)
178
179#elif defined(RT_OS_SOLARIS)
180 /* No automatic buffering, size limited to 255 bytes => use VBGLBIGREQ for everything. */
181# include <sys/ioccom.h>
182# define VBOXGUEST_IOCTL_CODE_(Function, Size) _IOWRN('V', (Function), sizeof(VBGLBIGREQ))
183# define VBOXGUEST_IOCTL_CODE_FAST_(Function) _IO( 'V', (Function))
184# define VBOXGUEST_IOCTL_STRIP_SIZE(Code) (Code)
185
186#elif defined(RT_OS_LINUX)
187 /* No automatic buffering, size limited to 16KB. */
188# include <linux/ioctl.h>
189# define VBOXGUEST_IOCTL_CODE_(Function, Size) _IOC(_IOC_READ|_IOC_WRITE, 'V', (Function), (Size))
190# define VBOXGUEST_IOCTL_CODE_FAST_(Function) _IO( 'V', (Function))
191# define VBOXGUEST_IOCTL_STRIP_SIZE(Code) VBOXGUEST_IOCTL_CODE_(_IOC_NR((Code)), 0)
192
193#elif defined(RT_OS_HAIKU)
194 /* No automatic buffering, size not encoded. */
195 /** @todo do something better */
196# define VBOXGUEST_IOCTL_CODE_(Function, Size) (0x56420000 | (Function))
197# define VBOXGUEST_IOCTL_CODE_FAST_(Function) (0x56420000 | (Function))
198# define VBOXGUEST_IOCTL_STRIP_SIZE(Code) (Code)
199
200#elif defined(RT_OS_FREEBSD) /** @todo r=bird: Please do it like SUPDRVIOC to keep it as similar as possible. */
201# include <sys/ioccom.h>
202
203# define VBOXGUEST_IOCTL_CODE_(Function, Size) _IOWR('V', (Function), VBGLBIGREQ)
204# define VBOXGUEST_IOCTL_CODE_FAST_(Function) _IO( 'V', (Function))
205# define VBOXGUEST_IOCTL_STRIP_SIZE(Code) IOCBASECMD(Code)
206
207#else /* BSD Like */
208 /* Automatic buffering, size limited to 4KB on *BSD and 8KB on Darwin - commands the limit, 4KB. */
209# include <sys/ioccom.h>
210# define VBOXGUEST_IOCTL_CODE_(Function, Size) _IOC(IOC_INOUT, 'V', (Function), (Size))
211# define VBOXGUEST_IOCTL_CODE_FAST_(Function) _IO('V', (Function))
212# define VBOXGUEST_IOCTL_STRIP_SIZE(uIOCtl) ( (uIOCtl) & ~_IOC(0,0,0,IOCPARM_MASK) )
213#endif
214
215#define VBOXGUEST_IOCTL_CODE(Function, Size) VBOXGUEST_IOCTL_CODE_((Function) | VBOXGUEST_IOCTL_FLAG, Size)
216#define VBOXGUEST_IOCTL_CODE_FAST(Function) VBOXGUEST_IOCTL_CODE_FAST_((Function) | VBOXGUEST_IOCTL_FLAG)
217
218/* Define 32 bit codes to support 32 bit applications requests in the 64 bit guest driver. */
219#ifdef RT_ARCH_AMD64
220# define VBOXGUEST_IOCTL_CODE_32(Function, Size) VBOXGUEST_IOCTL_CODE_(Function, Size)
221# define VBOXGUEST_IOCTL_CODE_FAST_32(Function) VBOXGUEST_IOCTL_CODE_FAST_(Function)
222#endif /* RT_ARCH_AMD64 */
223
224
225
226/** IOCTL to VBoxGuest to query the VMMDev IO port region start.
227 * @remarks Ring-0 only. */
228#define VBOXGUEST_IOCTL_GETVMMDEVPORT VBOXGUEST_IOCTL_CODE(1, sizeof(VBoxGuestPortInfo))
229
230#pragma pack(4)
231typedef struct VBoxGuestPortInfo
232{
233 uint32_t portAddress;
234 struct VMMDevMemory *pVMMDevMemory;
235} VBoxGuestPortInfo;
236
237
238/** IOCTL to VBoxGuest to wait for a VMMDev host notification */
239#define VBOXGUEST_IOCTL_WAITEVENT VBOXGUEST_IOCTL_CODE_(2, sizeof(VBoxGuestWaitEventInfo))
240
241/** @name Result codes for VBoxGuestWaitEventInfo::u32Result
242 * @{
243 */
244/** Successful completion, an event occurred. */
245#define VBOXGUEST_WAITEVENT_OK (0)
246/** Successful completion, timed out. */
247#define VBOXGUEST_WAITEVENT_TIMEOUT (1)
248/** Wait was interrupted. */
249#define VBOXGUEST_WAITEVENT_INTERRUPTED (2)
250/** An error occurred while processing the request. */
251#define VBOXGUEST_WAITEVENT_ERROR (3)
252/** @} */
253
254/** Input and output buffers layout of the IOCTL_VBOXGUEST_WAITEVENT */
255typedef struct VBoxGuestWaitEventInfo
256{
257 /** timeout in milliseconds */
258 uint32_t u32TimeoutIn;
259 /** events to wait for */
260 uint32_t u32EventMaskIn;
261 /** result code */
262 uint32_t u32Result;
263 /** events occurred */
264 uint32_t u32EventFlagsOut;
265} VBoxGuestWaitEventInfo;
266AssertCompileSize(VBoxGuestWaitEventInfo, 16);
267
268
269/** IOCTL to VBoxGuest to perform a VMM request
270 * @remark The data buffer for this IOCtl has an variable size, keep this in mind
271 * on systems where this matters. */
272#define VBOXGUEST_IOCTL_VMMREQUEST(Size) VBOXGUEST_IOCTL_CODE_(3, (Size))
273
274
275/** IOCTL to VBoxGuest to control event filter mask. */
276#define VBOXGUEST_IOCTL_CTL_FILTER_MASK VBOXGUEST_IOCTL_CODE_(4, sizeof(VBoxGuestFilterMaskInfo))
277
278/** Input and output buffer layout of the IOCTL_VBOXGUEST_CTL_FILTER_MASK. */
279typedef struct VBoxGuestFilterMaskInfo
280{
281 uint32_t u32OrMask;
282 uint32_t u32NotMask;
283} VBoxGuestFilterMaskInfo;
284AssertCompileSize(VBoxGuestFilterMaskInfo, 8);
285#pragma pack()
286
287/** IOCTL to VBoxGuest to interrupt (cancel) any pending WAITEVENTs and return.
288 * Handled inside the guest additions and not seen by the host at all.
289 * @see VBOXGUEST_IOCTL_WAITEVENT */
290#define VBOXGUEST_IOCTL_CANCEL_ALL_WAITEVENTS VBOXGUEST_IOCTL_CODE_(5, 0)
291
292/** IOCTL to VBoxGuest to perform backdoor logging.
293 * The argument is a string buffer of the specified size. */
294#define VBOXGUEST_IOCTL_LOG(Size) VBOXGUEST_IOCTL_CODE_(6, (Size))
295
296/** IOCTL to VBoxGuest to check memory ballooning.
297 * The guest kernel module / device driver will ask the host for the current size of
298 * the balloon and adjust the size. Or it will set fHandledInR0 = false and R3 is
299 * responsible for allocating memory and calling R0 (VBOXGUEST_IOCTL_CHANGE_BALLOON). */
300#define VBOXGUEST_IOCTL_CHECK_BALLOON VBOXGUEST_IOCTL_CODE_(7, sizeof(VBoxGuestCheckBalloonInfo))
301
302/** Output buffer layout of the VBOXGUEST_IOCTL_CHECK_BALLOON. */
303typedef struct VBoxGuestCheckBalloonInfo
304{
305 /** The size of the balloon in chunks of 1MB. */
306 uint32_t cBalloonChunks;
307 /** false = handled in R0, no further action required.
308 * true = allocate balloon memory in R3. */
309 uint32_t fHandleInR3;
310} VBoxGuestCheckBalloonInfo;
311AssertCompileSize(VBoxGuestCheckBalloonInfo, 8);
312
313
314/** IOCTL to VBoxGuest to supply or revoke one chunk for ballooning.
315 * The guest kernel module / device driver will lock down supplied memory or
316 * unlock reclaimed memory and then forward the physical addresses of the
317 * changed balloon chunk to the host. */
318#define VBOXGUEST_IOCTL_CHANGE_BALLOON VBOXGUEST_IOCTL_CODE_(8, sizeof(VBoxGuestChangeBalloonInfo))
319
320/** Input buffer layout of the VBOXGUEST_IOCTL_CHANGE_BALLOON request.
321 * Information about a memory chunk used to inflate or deflate the balloon. */
322typedef struct VBoxGuestChangeBalloonInfo
323{
324 /** Address of the chunk. */
325 uint64_t u64ChunkAddr;
326 /** true = inflate, false = deflate. */
327 uint32_t fInflate;
328 /** Alignment padding. */
329 uint32_t u32Align;
330} VBoxGuestChangeBalloonInfo;
331AssertCompileSize(VBoxGuestChangeBalloonInfo, 16);
332
333/** IOCTL to VBoxGuest to write guest core. */
334#define VBOXGUEST_IOCTL_WRITE_CORE_DUMP VBOXGUEST_IOCTL_CODE(9, sizeof(VBoxGuestWriteCoreDump))
335
336/** Input and output buffer layout of the VBOXGUEST_IOCTL_WRITE_CORE
337 * request. */
338typedef struct VBoxGuestWriteCoreDump
339{
340 /** Flags (reserved, MBZ). */
341 uint32_t fFlags;
342} VBoxGuestWriteCoreDump;
343AssertCompileSize(VBoxGuestWriteCoreDump, 4);
344
345/** IOCTL to VBoxGuest to update the mouse status features. */
346# define VBOXGUEST_IOCTL_SET_MOUSE_STATUS VBOXGUEST_IOCTL_CODE_(10, sizeof(uint32_t))
347
348#ifdef VBOX_WITH_HGCM
349/** IOCTL to VBoxGuest to connect to a HGCM service. */
350# define VBOXGUEST_IOCTL_HGCM_CONNECT VBOXGUEST_IOCTL_CODE(16, sizeof(VBoxGuestHGCMConnectInfo))
351
352/** IOCTL to VBoxGuest to disconnect from a HGCM service. */
353# define VBOXGUEST_IOCTL_HGCM_DISCONNECT VBOXGUEST_IOCTL_CODE(17, sizeof(VBoxGuestHGCMDisconnectInfo))
354
355/** IOCTL to VBoxGuest to make a call to a HGCM service.
356 * @see VBoxGuestHGCMCallInfo */
357# define VBOXGUEST_IOCTL_HGCM_CALL(Size) VBOXGUEST_IOCTL_CODE(18, (Size))
358
359/** IOCTL to VBoxGuest to make a timed call to a HGCM service. */
360# define VBOXGUEST_IOCTL_HGCM_CALL_TIMED(Size) VBOXGUEST_IOCTL_CODE(20, (Size))
361
362/** IOCTL to VBoxGuest passed from the Kernel Mode driver, but containing a user mode data in VBoxGuestHGCMCallInfo
363 * the driver received from the UM. Called in the context of the process passing the data.
364 * @see VBoxGuestHGCMCallInfo */
365# define VBOXGUEST_IOCTL_HGCM_CALL_USERDATA(Size) VBOXGUEST_IOCTL_CODE(21, (Size))
366
367# ifdef RT_ARCH_AMD64
368/** @name IOCTL numbers that 32-bit clients, like the Windows OpenGL guest
369 * driver, will use when taking to a 64-bit driver.
370 * @remarks These are only used by the driver implementation!
371 * @{*/
372# define VBOXGUEST_IOCTL_HGCM_CONNECT_32 VBOXGUEST_IOCTL_CODE_32(16, sizeof(VBoxGuestHGCMConnectInfo))
373# define VBOXGUEST_IOCTL_HGCM_DISCONNECT_32 VBOXGUEST_IOCTL_CODE_32(17, sizeof(VBoxGuestHGCMDisconnectInfo))
374# define VBOXGUEST_IOCTL_HGCM_CALL_32(Size) VBOXGUEST_IOCTL_CODE_32(18, (Size))
375# define VBOXGUEST_IOCTL_HGCM_CALL_TIMED_32(Size) VBOXGUEST_IOCTL_CODE_32(20, (Size))
376/** @} */
377# endif /* RT_ARCH_AMD64 */
378
379/** Get the pointer to the first HGCM parameter. */
380# define VBOXGUEST_HGCM_CALL_PARMS(a) ( (HGCMFunctionParameter *)((uint8_t *)(a) + sizeof(VBoxGuestHGCMCallInfo)) )
381/** Get the pointer to the first HGCM parameter in a 32-bit request. */
382# define VBOXGUEST_HGCM_CALL_PARMS32(a) ( (HGCMFunctionParameter32 *)((uint8_t *)(a) + sizeof(VBoxGuestHGCMCallInfo)) )
383
384#endif /* VBOX_WITH_HGCM */
385
386#ifdef VBOX_WITH_DPC_LATENCY_CHECKER
387/** IOCTL to VBoxGuest to perform DPC latency tests, printing the result in
388 * the release log on the host. Takes no data, returns no data. */
389# define VBOXGUEST_IOCTL_DPC_LATENCY_CHECKER VBOXGUEST_IOCTL_CODE_(30, 0)
390#endif
391
392/** IOCTL to for setting the mouse driver callback. (kernel only) */
393/** @note The callback will be called in interrupt context with the VBoxGuest
394 * device event spinlock held. */
395#define VBOXGUEST_IOCTL_SET_MOUSE_NOTIFY_CALLBACK VBOXGUEST_IOCTL_CODE(31, sizeof(VBoxGuestMouseSetNotifyCallback))
396
397typedef DECLCALLBACK(void) FNVBOXGUESTMOUSENOTIFY(void *pfnUser);
398typedef FNVBOXGUESTMOUSENOTIFY *PFNVBOXGUESTMOUSENOTIFY;
399
400/** Input buffer for VBOXGUEST_IOCTL_INTERNAL_SET_MOUSE_NOTIFY_CALLBACK. */
401typedef struct VBoxGuestMouseSetNotifyCallback
402{
403 /**
404 * Mouse notification callback.
405 *
406 * @param pvUser The callback argument.
407 */
408 PFNVBOXGUESTMOUSENOTIFY pfnNotify;
409 /** The callback argument*/
410 void *pvUser;
411} VBoxGuestMouseSetNotifyCallback;
412
413
414typedef enum VBOXGUESTCAPSACQUIRE_FLAGS
415{
416 VBOXGUESTCAPSACQUIRE_FLAGS_NONE = 0,
417 /* configures VBoxGuest to use the specified caps in Acquire mode, w/o making any caps acquisition/release.
418 * so far it is only possible to set acquire mode for caps, but not clear it,
419 * so u32NotMask is ignored for this request */
420 VBOXGUESTCAPSACQUIRE_FLAGS_CONFIG_ACQUIRE_MODE,
421 /* to ensure enum is 32bit*/
422 VBOXGUESTCAPSACQUIRE_FLAGS_32bit = 0x7fffffff
423} VBOXGUESTCAPSACQUIRE_FLAGS;
424
425typedef struct VBoxGuestCapsAquire
426{
427 /* result status
428 * VINF_SUCCESS - on success
429 * VERR_RESOURCE_BUSY - some caps in the u32OrMask are acquired by some other VBoxGuest connection.
430 * NOTE: no u32NotMask caps are cleaned in this case, i.e. no modifications are done on failure
431 * VER_INVALID_PARAMETER - invalid Caps are specified with either u32OrMask or u32NotMask. No modifications are done on failure.
432 */
433 int32_t rc;
434 /* Acquire command */
435 VBOXGUESTCAPSACQUIRE_FLAGS enmFlags;
436 /* caps to acquire, OR-ed VMMDEV_GUEST_SUPPORTS_XXX flags */
437 uint32_t u32OrMask;
438 /* caps to release, OR-ed VMMDEV_GUEST_SUPPORTS_XXX flags */
439 uint32_t u32NotMask;
440} VBoxGuestCapsAquire;
441
442/** IOCTL to for Acquiring/Releasing Guest Caps
443 * This is used for multiple purposes:
444 * 1. By doing Acquire r3 client application (e.g. VBoxTray) claims it will use
445 * the given connection for performing operations like Seamles or Auto-resize,
446 * thus, if the application terminates, the driver will automatically cleanup the caps reported to host,
447 * so that host knows guest does not support them anymore
448 * 2. In a multy-user environment this will not allow r3 applications (like VBoxTray)
449 * running in different user sessions simultaneously to interfere with each other.
450 * An r3 client application (like VBoxTray) is responsible for Acquiring/Releasing caps properly as needed.
451 **/
452#define VBOXGUEST_IOCTL_GUEST_CAPS_ACQUIRE VBOXGUEST_IOCTL_CODE(32, sizeof(VBoxGuestCapsAquire))
453
454/** IOCTL to VBoxGuest to set guest capabilities. */
455#define VBOXGUEST_IOCTL_SET_GUEST_CAPABILITIES VBOXGUEST_IOCTL_CODE_(33, sizeof(VBoxGuestSetCapabilitiesInfo))
456
457/** Input and output buffer layout of the VBOXGUEST_IOCTL_SET_GUEST_CAPABILITIES
458 * IOCtl. */
459typedef struct VBoxGuestSetCapabilitiesInfo
460{
461 uint32_t u32OrMask;
462 uint32_t u32NotMask;
463} VBoxGuestSetCapabilitiesInfo;
464AssertCompileSize(VBoxGuestSetCapabilitiesInfo, 8);
465
466
467#ifdef RT_OS_OS2
468
469/**
470 * The data buffer layout for the IDC entry point (AttachDD).
471 *
472 * @remark This is defined in multiple 16-bit headers / sources.
473 * Some places it's called VBGOS2IDC to short things a bit.
474 */
475typedef struct VBOXGUESTOS2IDCCONNECT
476{
477 /** VMMDEV_VERSION. */
478 uint32_t u32Version;
479 /** Opaque session handle. */
480 uint32_t u32Session;
481
482 /**
483 * The 32-bit service entry point.
484 *
485 * @returns VBox status code.
486 * @param u32Session The above session handle.
487 * @param iFunction The requested function.
488 * @param pvData The input/output data buffer. The caller ensures that this
489 * cannot be swapped out, or that it's acceptable to take a
490 * page in fault in the current context. If the request doesn't
491 * take input or produces output, apssing NULL is okay.
492 * @param cbData The size of the data buffer.
493 * @param pcbDataReturned Where to store the amount of data that's returned.
494 * This can be NULL if pvData is NULL.
495 */
496 DECLCALLBACKMEMBER(int, pfnServiceEP)(uint32_t u32Session, unsigned iFunction, void *pvData, size_t cbData, size_t *pcbDataReturned);
497
498 /** The 16-bit service entry point for C code (cdecl).
499 *
500 * It's the same as the 32-bit entry point, but the types has
501 * changed to 16-bit equivalents.
502 *
503 * @code
504 * int far cdecl
505 * VBoxGuestOs2IDCService16(uint32_t u32Session, uint16_t iFunction,
506 * void far *fpvData, uint16_t cbData, uint16_t far *pcbDataReturned);
507 * @endcode
508 */
509 RTFAR16 fpfnServiceEP;
510
511 /** The 16-bit service entry point for Assembly code (register).
512 *
513 * This is just a wrapper around fpfnServiceEP to simplify calls
514 * from 16-bit assembly code.
515 *
516 * @returns (e)ax: VBox status code; cx: The amount of data returned.
517 *
518 * @param u32Session eax - The above session handle.
519 * @param iFunction dl - The requested function.
520 * @param pvData es:bx - The input/output data buffer.
521 * @param cbData cx - The size of the data buffer.
522 */
523 RTFAR16 fpfnServiceAsmEP;
524} VBOXGUESTOS2IDCCONNECT;
525/** Pointer to VBOXGUESTOS2IDCCONNECT buffer. */
526typedef VBOXGUESTOS2IDCCONNECT *PVBOXGUESTOS2IDCCONNECT;
527
528/** OS/2 specific: IDC client disconnect request.
529 *
530 * This takes no input and it doesn't return anything. Obviously this
531 * is only recognized if it arrives thru the IDC service EP.
532 */
533# define VBOXGUEST_IOCTL_OS2_IDC_DISCONNECT VBOXGUEST_IOCTL_CODE(48, sizeof(uint32_t))
534
535#endif /* RT_OS_OS2 */
536
537#if defined(RT_OS_LINUX) || defined(RT_OS_SOLARIS) || defined(RT_OS_FREEBSD)
538
539/* Private IOCtls between user space and the kernel video driver. DRM private
540 * IOCtls always have the type 'd' and a number between 0x40 and 0x99 (0x9F?) */
541
542# define VBOX_DRM_IOCTL(a) (0x40 + DRM_VBOX_ ## a)
543
544/** Stop using HGSMI in the kernel driver until it is re-enabled, so that a
545 * user-space driver can use it. It must be re-enabled before the kernel
546 * driver can be used again in a sensible way. */
547/** @note These IOCtls was removed from the code, but are left here as
548 * templates as we may need similar ones in future. */
549# define DRM_VBOX_DISABLE_HGSMI 0
550# define DRM_IOCTL_VBOX_DISABLE_HGSMI VBOX_DRM_IOCTL(DISABLE_HGSMI)
551# define VBOXVIDEO_IOCTL_DISABLE_HGSMI _IO('d', DRM_IOCTL_VBOX_DISABLE_HGSMI)
552/** Enable HGSMI in the kernel driver after it was previously disabled. */
553# define DRM_VBOX_ENABLE_HGSMI 1
554# define DRM_IOCTL_VBOX_ENABLE_HGSMI VBOX_DRM_IOCTL(ENABLE_HGSMI)
555# define VBOXVIDEO_IOCTL_ENABLE_HGSMI _IO('d', DRM_IOCTL_VBOX_ENABLE_HGSMI)
556
557#endif /* RT_OS_LINUX || RT_OS_SOLARIS || RT_OS_FREEBSD */
558
559#endif /* !defined(IN_RC) && !defined(IN_RING0_AGNOSTIC) && !defined(IPRT_NO_CRT) */
560
561/** @} */
562
563/** @} */
564#endif
565
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette