VirtualBox

source: vbox/trunk/src/VBox/HostDrivers/Support/SUPDrvIOC.h@ 36239

Last change on this file since 36239 was 36232, checked in by vboxsync, 14 years ago

RTCPUSET, SUPDrv: Preparation for supporting 256 CPUs/cores/threads.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 39.1 KB
Line 
1/* $Revision: 36232 $ */
2/** @file
3 * VirtualBox Support Driver - IOCtl definitions.
4 */
5
6/*
7 * Copyright (C) 2006-2010 Oracle Corporation
8 *
9 * This file is part of VirtualBox Open Source Edition (OSE), as
10 * available from http://www.virtualbox.org. This file is free software;
11 * you can redistribute it and/or modify it under the terms of the GNU
12 * General Public License (GPL) as published by the Free Software
13 * Foundation, in version 2 as it comes in the "COPYING" file of the
14 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
15 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
16 *
17 * The contents of this file may alternatively be used under the terms
18 * of the Common Development and Distribution License Version 1.0
19 * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
20 * VirtualBox OSE distribution, in which case the provisions of the
21 * CDDL are applicable instead of those of the GPL.
22 *
23 * You may elect to license modified versions of this file under the
24 * terms and conditions of either the GPL or the CDDL or both.
25 */
26
27#ifndef ___SUPDrvIOC_h___
28#define ___SUPDrvIOC_h___
29
30/*
31 * Basic types.
32 */
33#include <iprt/types.h>
34
35/*
36 * IOCtl numbers.
37 * We're using the Win32 type of numbers here, thus the macros below.
38 * The SUP_IOCTL_FLAG macro is used to separate requests from 32-bit
39 * and 64-bit processes.
40 */
41#if defined(RT_ARCH_AMD64) || defined(RT_ARCH_SPARC64)
42# define SUP_IOCTL_FLAG 128
43#elif defined(RT_ARCH_X86) || defined(RT_ARCH_SPARC)
44# define SUP_IOCTL_FLAG 0
45#else
46# error "dunno which arch this is!"
47#endif
48
49#ifdef RT_OS_WINDOWS
50# ifndef CTL_CODE
51# include <Windows.h>
52# endif
53 /* Automatic buffering, size not encoded. */
54# define SUP_CTL_CODE_SIZE(Function, Size) CTL_CODE(FILE_DEVICE_UNKNOWN, (Function) | SUP_IOCTL_FLAG, METHOD_BUFFERED, FILE_WRITE_ACCESS)
55# define SUP_CTL_CODE_BIG(Function) CTL_CODE(FILE_DEVICE_UNKNOWN, (Function) | SUP_IOCTL_FLAG, METHOD_BUFFERED, FILE_WRITE_ACCESS)
56# define SUP_CTL_CODE_FAST(Function) CTL_CODE(FILE_DEVICE_UNKNOWN, (Function) | SUP_IOCTL_FLAG, METHOD_NEITHER, FILE_WRITE_ACCESS)
57# define SUP_CTL_CODE_NO_SIZE(uIOCtl) (uIOCtl)
58
59#elif defined(RT_OS_SOLARIS)
60 /* No automatic buffering, size limited to 255 bytes. */
61# include <sys/ioccom.h>
62# define SUP_CTL_CODE_SIZE(Function, Size) _IOWRN('V', (Function) | SUP_IOCTL_FLAG, sizeof(SUPREQHDR))
63# define SUP_CTL_CODE_BIG(Function) _IOWRN('V', (Function) | SUP_IOCTL_FLAG, sizeof(SUPREQHDR))
64# define SUP_CTL_CODE_FAST(Function) _IO( 'V', (Function) | SUP_IOCTL_FLAG)
65# define SUP_CTL_CODE_NO_SIZE(uIOCtl) (uIOCtl)
66
67#elif defined(RT_OS_OS2)
68 /* No automatic buffering, size not encoded. */
69# define SUP_CTL_CATEGORY 0xc0
70# define SUP_CTL_CODE_SIZE(Function, Size) ((unsigned char)(Function))
71# define SUP_CTL_CODE_BIG(Function) ((unsigned char)(Function))
72# define SUP_CTL_CATEGORY_FAST 0xc1
73# define SUP_CTL_CODE_FAST(Function) ((unsigned char)(Function))
74# define SUP_CTL_CODE_NO_SIZE(uIOCtl) (uIOCtl)
75
76#elif defined(RT_OS_LINUX)
77 /* No automatic buffering, size limited to 16KB. */
78# include <linux/ioctl.h>
79# define SUP_CTL_CODE_SIZE(Function, Size) _IOC(_IOC_READ | _IOC_WRITE, 'V', (Function) | SUP_IOCTL_FLAG, (Size))
80# define SUP_CTL_CODE_BIG(Function) _IO('V', (Function) | SUP_IOCTL_FLAG)
81# define SUP_CTL_CODE_FAST(Function) _IO('V', (Function) | SUP_IOCTL_FLAG)
82# define SUP_CTL_CODE_NO_SIZE(uIOCtl) ((uIOCtl) & ~IOCSIZE_MASK)
83
84#elif defined(RT_OS_L4)
85 /* Implemented in suplib, no worries. */
86# define SUP_CTL_CODE_SIZE(Function, Size) (Function)
87# define SUP_CTL_CODE_BIG(Function) (Function)
88# define SUP_CTL_CODE_FAST(Function) (Function)
89# define SUP_CTL_CODE_NO_SIZE(uIOCtl) (uIOCtl)
90
91#else /* BSD Like */
92 /* Automatic buffering, size limited to 4KB on *BSD and 8KB on Darwin - commands the limit, 4KB. */
93# include <sys/ioccom.h>
94# define SUP_CTL_CODE_SIZE(Function, Size) _IOC(IOC_INOUT, 'V', (Function) | SUP_IOCTL_FLAG, (Size))
95# define SUP_CTL_CODE_BIG(Function) _IO('V', (Function) | SUP_IOCTL_FLAG)
96# define SUP_CTL_CODE_FAST(Function) _IO('V', (Function) | SUP_IOCTL_FLAG)
97# define SUP_CTL_CODE_NO_SIZE(uIOCtl) ( (uIOCtl) & ~_IOC(0,0,0,IOCPARM_MASK) )
98#endif
99
100/** Fast path IOCtl: VMMR0_DO_RAW_RUN */
101#define SUP_IOCTL_FAST_DO_RAW_RUN SUP_CTL_CODE_FAST(64)
102/** Fast path IOCtl: VMMR0_DO_HWACC_RUN */
103#define SUP_IOCTL_FAST_DO_HWACC_RUN SUP_CTL_CODE_FAST(65)
104/** Just a NOP call for profiling the latency of a fast ioctl call to VMMR0. */
105#define SUP_IOCTL_FAST_DO_NOP SUP_CTL_CODE_FAST(66)
106
107
108
109/*******************************************************************************
110* Structures and Typedefs *
111*******************************************************************************/
112#ifdef RT_ARCH_AMD64
113# pragma pack(8) /* paranoia. */
114#else
115# pragma pack(4) /* paranoia. */
116#endif
117
118
119/**
120 * Common In/Out header.
121 */
122typedef struct SUPREQHDR
123{
124 /** Cookie. */
125 uint32_t u32Cookie;
126 /** Session cookie. */
127 uint32_t u32SessionCookie;
128 /** The size of the input. */
129 uint32_t cbIn;
130 /** The size of the output. */
131 uint32_t cbOut;
132 /** Flags. See SUPREQHDR_FLAGS_* for details and values. */
133 uint32_t fFlags;
134 /** The VBox status code of the operation, out direction only. */
135 int32_t rc;
136} SUPREQHDR;
137/** Pointer to a IOC header. */
138typedef SUPREQHDR *PSUPREQHDR;
139
140/** @name SUPREQHDR::fFlags values
141 * @{ */
142/** Masks out the magic value. */
143#define SUPREQHDR_FLAGS_MAGIC_MASK UINT32_C(0xff0000ff)
144/** The generic mask. */
145#define SUPREQHDR_FLAGS_GEN_MASK UINT32_C(0x0000ff00)
146/** The request specific mask. */
147#define SUPREQHDR_FLAGS_REQ_MASK UINT32_C(0x00ff0000)
148
149/** There is extra input that needs copying on some platforms. */
150#define SUPREQHDR_FLAGS_EXTRA_IN UINT32_C(0x00000100)
151/** There is extra output that needs copying on some platforms. */
152#define SUPREQHDR_FLAGS_EXTRA_OUT UINT32_C(0x00000200)
153
154/** The magic value. */
155#define SUPREQHDR_FLAGS_MAGIC UINT32_C(0x42000042)
156/** The default value. Use this when no special stuff is requested. */
157#define SUPREQHDR_FLAGS_DEFAULT SUPREQHDR_FLAGS_MAGIC
158/** @} */
159
160
161/** @name SUP_IOCTL_COOKIE
162 * @{
163 */
164/** Negotiate cookie. */
165#define SUP_IOCTL_COOKIE SUP_CTL_CODE_SIZE(1, SUP_IOCTL_COOKIE_SIZE)
166/** The request size. */
167#define SUP_IOCTL_COOKIE_SIZE sizeof(SUPCOOKIE)
168/** The SUPREQHDR::cbIn value. */
169#define SUP_IOCTL_COOKIE_SIZE_IN sizeof(SUPREQHDR) + RT_SIZEOFMEMB(SUPCOOKIE, u.In)
170/** The SUPREQHDR::cbOut value. */
171#define SUP_IOCTL_COOKIE_SIZE_OUT sizeof(SUPREQHDR) + RT_SIZEOFMEMB(SUPCOOKIE, u.Out)
172/** SUPCOOKIE_IN magic word. */
173#define SUPCOOKIE_MAGIC "The Magic Word!"
174/** The initial cookie. */
175#define SUPCOOKIE_INITIAL_COOKIE 0x69726f74 /* 'tori' */
176
177/** Current interface version.
178 * The upper 16-bit is the major version, the the lower the minor version.
179 * When incompatible changes are made, the upper major number has to be changed.
180 *
181 * Update rules:
182 * -# Only update the major number when incompatible changes have been made to
183 * the IOC interface or the ABI provided via the functions returned by
184 * SUPQUERYFUNCS.
185 * -# When adding new features (new IOC number, new flags, new exports, ++)
186 * only update the minor number and change SUPLib.cpp to require the
187 * new IOC version.
188 * -# When incrementing the major number, clear the minor part and reset
189 * any IOC version requirements in SUPLib.cpp.
190 * -# When increment the major number, execute all pending work.
191 *
192 * @todo Pending work on next major version change:
193 * - None.
194 */
195#define SUPDRV_IOC_VERSION 0x00160001
196
197/** SUP_IOCTL_COOKIE. */
198typedef struct SUPCOOKIE
199{
200 /** The header.
201 * u32Cookie must be set to SUPCOOKIE_INITIAL_COOKIE.
202 * u32SessionCookie should be set to some random value. */
203 SUPREQHDR Hdr;
204 union
205 {
206 struct
207 {
208 /** Magic word. */
209 char szMagic[16];
210 /** The requested interface version number. */
211 uint32_t u32ReqVersion;
212 /** The minimum interface version number. */
213 uint32_t u32MinVersion;
214 } In;
215 struct
216 {
217 /** Cookie. */
218 uint32_t u32Cookie;
219 /** Session cookie. */
220 uint32_t u32SessionCookie;
221 /** Interface version for this session. */
222 uint32_t u32SessionVersion;
223 /** The actual interface version in the driver. */
224 uint32_t u32DriverVersion;
225 /** Number of functions available for the SUP_IOCTL_QUERY_FUNCS request. */
226 uint32_t cFunctions;
227 /** Session handle. */
228 R0PTRTYPE(PSUPDRVSESSION) pSession;
229 } Out;
230 } u;
231} SUPCOOKIE, *PSUPCOOKIE;
232/** @} */
233
234
235/** @name SUP_IOCTL_QUERY_FUNCS
236 * Query SUPR0 functions.
237 * @{
238 */
239#define SUP_IOCTL_QUERY_FUNCS(cFuncs) SUP_CTL_CODE_BIG(2)
240#define SUP_IOCTL_QUERY_FUNCS_SIZE(cFuncs) RT_UOFFSETOF(SUPQUERYFUNCS, u.Out.aFunctions[(cFuncs)])
241#define SUP_IOCTL_QUERY_FUNCS_SIZE_IN sizeof(SUPREQHDR)
242#define SUP_IOCTL_QUERY_FUNCS_SIZE_OUT(cFuncs) SUP_IOCTL_QUERY_FUNCS_SIZE(cFuncs)
243
244/** A function. */
245typedef struct SUPFUNC
246{
247 /** Name - mangled. */
248 char szName[32];
249 /** Address. */
250 RTR0PTR pfn;
251} SUPFUNC, *PSUPFUNC;
252
253typedef struct SUPQUERYFUNCS
254{
255 /** The header. */
256 SUPREQHDR Hdr;
257 union
258 {
259 struct
260 {
261 /** Number of functions returned. */
262 uint32_t cFunctions;
263 /** Array of functions. */
264 SUPFUNC aFunctions[1];
265 } Out;
266 } u;
267} SUPQUERYFUNCS, *PSUPQUERYFUNCS;
268/** @} */
269
270
271/** @name SUP_IOCTL_LDR_OPEN
272 * Open an image.
273 * @{
274 */
275#define SUP_IOCTL_LDR_OPEN SUP_CTL_CODE_SIZE(3, SUP_IOCTL_LDR_OPEN_SIZE)
276#define SUP_IOCTL_LDR_OPEN_SIZE sizeof(SUPLDROPEN)
277#define SUP_IOCTL_LDR_OPEN_SIZE_IN sizeof(SUPLDROPEN)
278#define SUP_IOCTL_LDR_OPEN_SIZE_OUT (sizeof(SUPREQHDR) + RT_SIZEOFMEMB(SUPLDROPEN, u.Out))
279typedef struct SUPLDROPEN
280{
281 /** The header. */
282 SUPREQHDR Hdr;
283 union
284 {
285 struct
286 {
287 /** Size of the image we'll be loading (including tables). */
288 uint32_t cbImageWithTabs;
289 /** The size of the image bits. (Less or equal to cbImageWithTabs.) */
290 uint32_t cbImageBits;
291 /** Image name.
292 * This is the NAME of the image, not the file name. It is used
293 * to share code with other processes. (Max len is 32 chars!) */
294 char szName[32];
295 /** Image file name.
296 * This can be used to load the image using a native loader. */
297 char szFilename[260];
298 } In;
299 struct
300 {
301 /** The base address of the image. */
302 RTR0PTR pvImageBase;
303 /** Indicate whether or not the image requires loading. */
304 bool fNeedsLoading;
305 /** Indicates that we're using the native ring-0 loader. */
306 bool fNativeLoader;
307 } Out;
308 } u;
309} SUPLDROPEN, *PSUPLDROPEN;
310/** @} */
311
312
313/** @name SUP_IOCTL_LDR_LOAD
314 * Upload the image bits.
315 * @{
316 */
317#define SUP_IOCTL_LDR_LOAD SUP_CTL_CODE_BIG(4)
318#define SUP_IOCTL_LDR_LOAD_SIZE(cbImage) RT_UOFFSETOF(SUPLDRLOAD, u.In.abImage[cbImage])
319#define SUP_IOCTL_LDR_LOAD_SIZE_IN(cbImage) RT_UOFFSETOF(SUPLDRLOAD, u.In.abImage[cbImage])
320#define SUP_IOCTL_LDR_LOAD_SIZE_OUT sizeof(SUPREQHDR)
321
322/**
323 * Module initialization callback function.
324 * This is called once after the module has been loaded.
325 *
326 * @returns 0 on success.
327 * @returns Appropriate error code on failure.
328 */
329typedef DECLCALLBACK(int) FNR0MODULEINIT(void);
330/** Pointer to a FNR0MODULEINIT(). */
331typedef R0PTRTYPE(FNR0MODULEINIT *) PFNR0MODULEINIT;
332
333/**
334 * Module termination callback function.
335 * This is called once right before the module is being unloaded.
336 */
337typedef DECLCALLBACK(void) FNR0MODULETERM(void);
338/** Pointer to a FNR0MODULETERM(). */
339typedef R0PTRTYPE(FNR0MODULETERM *) PFNR0MODULETERM;
340
341/**
342 * Symbol table entry.
343 */
344typedef struct SUPLDRSYM
345{
346 /** Offset into of the string table. */
347 uint32_t offName;
348 /** Offset of the symbol relative to the image load address. */
349 uint32_t offSymbol;
350} SUPLDRSYM;
351/** Pointer to a symbol table entry. */
352typedef SUPLDRSYM *PSUPLDRSYM;
353/** Pointer to a const symbol table entry. */
354typedef SUPLDRSYM const *PCSUPLDRSYM;
355
356/**
357 * SUPLDRLOAD::u::In::EP type.
358 */
359typedef enum SUPLDRLOADEP
360{
361 SUPLDRLOADEP_NOTHING = 0,
362 SUPLDRLOADEP_VMMR0,
363 SUPLDRLOADEP_SERVICE,
364 SUPLDRLOADEP_32BIT_HACK = 0x7fffffff
365} SUPLDRLOADEP;
366
367typedef struct SUPLDRLOAD
368{
369 /** The header. */
370 SUPREQHDR Hdr;
371 union
372 {
373 struct
374 {
375 /** The address of module initialization function. Similar to _DLL_InitTerm(hmod, 0). */
376 PFNR0MODULEINIT pfnModuleInit;
377 /** The address of module termination function. Similar to _DLL_InitTerm(hmod, 1). */
378 PFNR0MODULETERM pfnModuleTerm;
379 /** Special entry points. */
380 union
381 {
382 /** SUPLDRLOADEP_VMMR0. */
383 struct
384 {
385 /** The module handle (i.e. address). */
386 RTR0PTR pvVMMR0;
387 /** Address of VMMR0EntryInt function. */
388 RTR0PTR pvVMMR0EntryInt;
389 /** Address of VMMR0EntryFast function. */
390 RTR0PTR pvVMMR0EntryFast;
391 /** Address of VMMR0EntryEx function. */
392 RTR0PTR pvVMMR0EntryEx;
393 } VMMR0;
394 /** SUPLDRLOADEP_SERVICE. */
395 struct
396 {
397 /** The service request handler.
398 * (PFNR0SERVICEREQHANDLER isn't defined yet.) */
399 RTR0PTR pfnServiceReq;
400 /** Reserved, must be NIL. */
401 RTR0PTR apvReserved[3];
402 } Service;
403 } EP;
404 /** Address. */
405 RTR0PTR pvImageBase;
406 /** Entry point type. */
407 SUPLDRLOADEP eEPType;
408 /** The size of the image bits (starting at offset 0 and
409 * approaching offSymbols). */
410 uint32_t cbImageBits;
411 /** The offset of the symbol table. */
412 uint32_t offSymbols;
413 /** The number of entries in the symbol table. */
414 uint32_t cSymbols;
415 /** The offset of the string table. */
416 uint32_t offStrTab;
417 /** Size of the string table. */
418 uint32_t cbStrTab;
419 /** Size of image data in achImage. */
420 uint32_t cbImageWithTabs;
421 /** The image data. */
422 uint8_t abImage[1];
423 } In;
424 } u;
425} SUPLDRLOAD, *PSUPLDRLOAD;
426/** @} */
427
428
429/** @name SUP_IOCTL_LDR_FREE
430 * Free an image.
431 * @{
432 */
433#define SUP_IOCTL_LDR_FREE SUP_CTL_CODE_SIZE(5, SUP_IOCTL_LDR_FREE_SIZE)
434#define SUP_IOCTL_LDR_FREE_SIZE sizeof(SUPLDRFREE)
435#define SUP_IOCTL_LDR_FREE_SIZE_IN sizeof(SUPLDRFREE)
436#define SUP_IOCTL_LDR_FREE_SIZE_OUT sizeof(SUPREQHDR)
437typedef struct SUPLDRFREE
438{
439 /** The header. */
440 SUPREQHDR Hdr;
441 union
442 {
443 struct
444 {
445 /** Address. */
446 RTR0PTR pvImageBase;
447 } In;
448 } u;
449} SUPLDRFREE, *PSUPLDRFREE;
450/** @} */
451
452
453/** @name SUP_IOCTL_LDR_GET_SYMBOL
454 * Get address of a symbol within an image.
455 * @{
456 */
457#define SUP_IOCTL_LDR_GET_SYMBOL SUP_CTL_CODE_SIZE(6, SUP_IOCTL_LDR_GET_SYMBOL_SIZE)
458#define SUP_IOCTL_LDR_GET_SYMBOL_SIZE sizeof(SUPLDRGETSYMBOL)
459#define SUP_IOCTL_LDR_GET_SYMBOL_SIZE_IN sizeof(SUPLDRGETSYMBOL)
460#define SUP_IOCTL_LDR_GET_SYMBOL_SIZE_OUT (sizeof(SUPREQHDR) + RT_SIZEOFMEMB(SUPLDRGETSYMBOL, u.Out))
461typedef struct SUPLDRGETSYMBOL
462{
463 /** The header. */
464 SUPREQHDR Hdr;
465 union
466 {
467 struct
468 {
469 /** Address. */
470 RTR0PTR pvImageBase;
471 /** The symbol name. */
472 char szSymbol[64];
473 } In;
474 struct
475 {
476 /** The symbol address. */
477 RTR0PTR pvSymbol;
478 } Out;
479 } u;
480} SUPLDRGETSYMBOL, *PSUPLDRGETSYMBOL;
481/** @} */
482
483
484/** @name SUP_IOCTL_CALL_VMMR0
485 * Call the R0 VMM Entry point.
486 * @{
487 */
488#define SUP_IOCTL_CALL_VMMR0(cbReq) SUP_CTL_CODE_SIZE(7, SUP_IOCTL_CALL_VMMR0_SIZE(cbReq))
489#define SUP_IOCTL_CALL_VMMR0_SIZE(cbReq) RT_UOFFSETOF(SUPCALLVMMR0, abReqPkt[cbReq])
490#define SUP_IOCTL_CALL_VMMR0_SIZE_IN(cbReq) SUP_IOCTL_CALL_VMMR0_SIZE(cbReq)
491#define SUP_IOCTL_CALL_VMMR0_SIZE_OUT(cbReq) SUP_IOCTL_CALL_VMMR0_SIZE(cbReq)
492typedef struct SUPCALLVMMR0
493{
494 /** The header. */
495 SUPREQHDR Hdr;
496 union
497 {
498 struct
499 {
500 /** The VM handle. */
501 PVMR0 pVMR0;
502 /** VCPU id. */
503 uint32_t idCpu;
504 /** Which operation to execute. */
505 uint32_t uOperation;
506 /** Argument to use when no request packet is supplied. */
507 uint64_t u64Arg;
508 } In;
509 } u;
510 /** The VMMR0Entry request packet. */
511 uint8_t abReqPkt[1];
512} SUPCALLVMMR0, *PSUPCALLVMMR0;
513/** @} */
514
515
516/** @name SUP_IOCTL_CALL_VMMR0_BIG
517 * Version of SUP_IOCTL_CALL_VMMR0 for dealing with large requests.
518 * @{
519 */
520#define SUP_IOCTL_CALL_VMMR0_BIG SUP_CTL_CODE_BIG(27)
521#define SUP_IOCTL_CALL_VMMR0_BIG_SIZE(cbReq) RT_UOFFSETOF(SUPCALLVMMR0, abReqPkt[cbReq])
522#define SUP_IOCTL_CALL_VMMR0_BIG_SIZE_IN(cbReq) SUP_IOCTL_CALL_VMMR0_SIZE(cbReq)
523#define SUP_IOCTL_CALL_VMMR0_BIG_SIZE_OUT(cbReq) SUP_IOCTL_CALL_VMMR0_SIZE(cbReq)
524/** @} */
525
526
527/** @name SUP_IOCTL_LOW_ALLOC
528 * Allocate memory below 4GB (physically).
529 * @{
530 */
531#define SUP_IOCTL_LOW_ALLOC SUP_CTL_CODE_BIG(8)
532#define SUP_IOCTL_LOW_ALLOC_SIZE(cPages) ((uint32_t)RT_UOFFSETOF(SUPLOWALLOC, u.Out.aPages[cPages]))
533#define SUP_IOCTL_LOW_ALLOC_SIZE_IN (sizeof(SUPREQHDR) + RT_SIZEOFMEMB(SUPLOWALLOC, u.In))
534#define SUP_IOCTL_LOW_ALLOC_SIZE_OUT(cPages) SUP_IOCTL_LOW_ALLOC_SIZE(cPages)
535typedef struct SUPLOWALLOC
536{
537 /** The header. */
538 SUPREQHDR Hdr;
539 union
540 {
541 struct
542 {
543 /** Number of pages to allocate. */
544 uint32_t cPages;
545 } In;
546 struct
547 {
548 /** The ring-3 address of the allocated memory. */
549 RTR3PTR pvR3;
550 /** The ring-0 address of the allocated memory. */
551 RTR0PTR pvR0;
552 /** Array of pages. */
553 RTHCPHYS aPages[1];
554 } Out;
555 } u;
556} SUPLOWALLOC, *PSUPLOWALLOC;
557/** @} */
558
559
560/** @name SUP_IOCTL_LOW_FREE
561 * Free low memory.
562 * @{
563 */
564#define SUP_IOCTL_LOW_FREE SUP_CTL_CODE_SIZE(9, SUP_IOCTL_LOW_FREE_SIZE)
565#define SUP_IOCTL_LOW_FREE_SIZE sizeof(SUPLOWFREE)
566#define SUP_IOCTL_LOW_FREE_SIZE_IN sizeof(SUPLOWFREE)
567#define SUP_IOCTL_LOW_FREE_SIZE_OUT sizeof(SUPREQHDR)
568typedef struct SUPLOWFREE
569{
570 /** The header. */
571 SUPREQHDR Hdr;
572 union
573 {
574 struct
575 {
576 /** The ring-3 address of the memory to free. */
577 RTR3PTR pvR3;
578 } In;
579 } u;
580} SUPLOWFREE, *PSUPLOWFREE;
581/** @} */
582
583
584/** @name SUP_IOCTL_PAGE_ALLOC_EX
585 * Allocate memory and map it into kernel and/or user space. The memory is of
586 * course locked. The result should be freed using SUP_IOCTL_PAGE_FREE.
587 *
588 * @remarks Allocations without a kernel mapping may fail with
589 * VERR_NOT_SUPPORTED on some platforms.
590 *
591 * @{
592 */
593#define SUP_IOCTL_PAGE_ALLOC_EX SUP_CTL_CODE_BIG(10)
594#define SUP_IOCTL_PAGE_ALLOC_EX_SIZE(cPages) RT_UOFFSETOF(SUPPAGEALLOCEX, u.Out.aPages[cPages])
595#define SUP_IOCTL_PAGE_ALLOC_EX_SIZE_IN (sizeof(SUPREQHDR) + RT_SIZEOFMEMB(SUPPAGEALLOCEX, u.In))
596#define SUP_IOCTL_PAGE_ALLOC_EX_SIZE_OUT(cPages) SUP_IOCTL_PAGE_ALLOC_EX_SIZE(cPages)
597typedef struct SUPPAGEALLOCEX
598{
599 /** The header. */
600 SUPREQHDR Hdr;
601 union
602 {
603 struct
604 {
605 /** Number of pages to allocate */
606 uint32_t cPages;
607 /** Whether it should have kernel mapping. */
608 bool fKernelMapping;
609 /** Whether it should have a user mapping. */
610 bool fUserMapping;
611 /** Reserved. Must be false. */
612 bool fReserved0;
613 /** Reserved. Must be false. */
614 bool fReserved1;
615 } In;
616 struct
617 {
618 /** Returned ring-3 address. */
619 RTR3PTR pvR3;
620 /** Returned ring-0 address. */
621 RTR0PTR pvR0;
622 /** The physical addresses of the allocated pages. */
623 RTHCPHYS aPages[1];
624 } Out;
625 } u;
626} SUPPAGEALLOCEX, *PSUPPAGEALLOCEX;
627/** @} */
628
629
630/** @name SUP_IOCTL_PAGE_MAP_KERNEL
631 * Maps a portion of memory allocated by SUP_IOCTL_PAGE_ALLOC_EX /
632 * SUPR0PageAllocEx into kernel space for use by a device or similar.
633 *
634 * The mapping will be freed together with the ring-3 mapping when
635 * SUP_IOCTL_PAGE_FREE or SUPR0PageFree is called.
636 *
637 * @remarks Not necessarily supported on all platforms.
638 *
639 * @{
640 */
641#define SUP_IOCTL_PAGE_MAP_KERNEL SUP_CTL_CODE_SIZE(11, SUP_IOCTL_PAGE_MAP_KERNEL_SIZE)
642#define SUP_IOCTL_PAGE_MAP_KERNEL_SIZE sizeof(SUPPAGEMAPKERNEL)
643#define SUP_IOCTL_PAGE_MAP_KERNEL_SIZE_IN sizeof(SUPPAGEMAPKERNEL)
644#define SUP_IOCTL_PAGE_MAP_KERNEL_SIZE_OUT sizeof(SUPPAGEMAPKERNEL)
645typedef struct SUPPAGEMAPKERNEL
646{
647 /** The header. */
648 SUPREQHDR Hdr;
649 union
650 {
651 struct
652 {
653 /** The pointer of to the previously allocated memory. */
654 RTR3PTR pvR3;
655 /** The offset to start mapping from. */
656 uint32_t offSub;
657 /** Size of the section to map. */
658 uint32_t cbSub;
659 /** Flags reserved for future fun. */
660 uint32_t fFlags;
661 } In;
662 struct
663 {
664 /** The ring-0 address corresponding to pvR3 + offSub. */
665 RTR0PTR pvR0;
666 } Out;
667 } u;
668} SUPPAGEMAPKERNEL, *PSUPPAGEMAPKERNEL;
669/** @} */
670
671
672/** @name SUP_IOCTL_PAGE_PROTECT
673 * Changes the page level protection of the user and/or kernel mappings of
674 * memory previously allocated by SUPR0PageAllocEx.
675 *
676 * @remarks Not necessarily supported on all platforms.
677 *
678 * @{
679 */
680#define SUP_IOCTL_PAGE_PROTECT SUP_CTL_CODE_SIZE(12, SUP_IOCTL_PAGE_PROTECT_SIZE)
681#define SUP_IOCTL_PAGE_PROTECT_SIZE sizeof(SUPPAGEPROTECT)
682#define SUP_IOCTL_PAGE_PROTECT_SIZE_IN sizeof(SUPPAGEPROTECT)
683#define SUP_IOCTL_PAGE_PROTECT_SIZE_OUT sizeof(SUPPAGEPROTECT)
684typedef struct SUPPAGEPROTECT
685{
686 /** The header. */
687 SUPREQHDR Hdr;
688 union
689 {
690 struct
691 {
692 /** The pointer of to the previously allocated memory.
693 * Pass NIL_RTR3PTR if the ring-0 mapping should remain unaffected. */
694 RTR3PTR pvR3;
695 /** The pointer of to the previously allocated memory.
696 * Pass NIL_RTR0PTR if the ring-0 mapping should remain unaffected. */
697 RTR0PTR pvR0;
698 /** The offset to start changing protection at. */
699 uint32_t offSub;
700 /** Size of the portion that should be changed. */
701 uint32_t cbSub;
702 /** Protection flags, RTMEM_PROT_*. */
703 uint32_t fProt;
704 } In;
705 } u;
706} SUPPAGEPROTECT, *PSUPPAGEPROTECT;
707/** @} */
708
709
710/** @name SUP_IOCTL_PAGE_FREE
711 * Free memory allocated with SUP_IOCTL_PAGE_ALLOC_EX.
712 * @{
713 */
714#define SUP_IOCTL_PAGE_FREE SUP_CTL_CODE_SIZE(13, SUP_IOCTL_PAGE_FREE_SIZE_IN)
715#define SUP_IOCTL_PAGE_FREE_SIZE sizeof(SUPPAGEFREE)
716#define SUP_IOCTL_PAGE_FREE_SIZE_IN sizeof(SUPPAGEFREE)
717#define SUP_IOCTL_PAGE_FREE_SIZE_OUT sizeof(SUPREQHDR)
718typedef struct SUPPAGEFREE
719{
720 /** The header. */
721 SUPREQHDR Hdr;
722 union
723 {
724 struct
725 {
726 /** Address of memory range to free. */
727 RTR3PTR pvR3;
728 } In;
729 } u;
730} SUPPAGEFREE, *PSUPPAGEFREE;
731/** @} */
732
733
734
735
736/** @name SUP_IOCTL_PAGE_LOCK
737 * Pin down physical pages.
738 * @{
739 */
740#define SUP_IOCTL_PAGE_LOCK SUP_CTL_CODE_BIG(14)
741#define SUP_IOCTL_PAGE_LOCK_SIZE(cPages) (RT_MAX((size_t)SUP_IOCTL_PAGE_LOCK_SIZE_IN, (size_t)SUP_IOCTL_PAGE_LOCK_SIZE_OUT(cPages)))
742#define SUP_IOCTL_PAGE_LOCK_SIZE_IN (sizeof(SUPREQHDR) + RT_SIZEOFMEMB(SUPPAGELOCK, u.In))
743#define SUP_IOCTL_PAGE_LOCK_SIZE_OUT(cPages) RT_UOFFSETOF(SUPPAGELOCK, u.Out.aPages[cPages])
744typedef struct SUPPAGELOCK
745{
746 /** The header. */
747 SUPREQHDR Hdr;
748 union
749 {
750 struct
751 {
752 /** Start of page range. Must be PAGE aligned. */
753 RTR3PTR pvR3;
754 /** The range size given as a page count. */
755 uint32_t cPages;
756 } In;
757
758 struct
759 {
760 /** Array of pages. */
761 RTHCPHYS aPages[1];
762 } Out;
763 } u;
764} SUPPAGELOCK, *PSUPPAGELOCK;
765/** @} */
766
767
768/** @name SUP_IOCTL_PAGE_UNLOCK
769 * Unpin physical pages.
770 * @{ */
771#define SUP_IOCTL_PAGE_UNLOCK SUP_CTL_CODE_SIZE(15, SUP_IOCTL_PAGE_UNLOCK_SIZE)
772#define SUP_IOCTL_PAGE_UNLOCK_SIZE sizeof(SUPPAGEUNLOCK)
773#define SUP_IOCTL_PAGE_UNLOCK_SIZE_IN sizeof(SUPPAGEUNLOCK)
774#define SUP_IOCTL_PAGE_UNLOCK_SIZE_OUT sizeof(SUPREQHDR)
775typedef struct SUPPAGEUNLOCK
776{
777 /** The header. */
778 SUPREQHDR Hdr;
779 union
780 {
781 struct
782 {
783 /** Start of page range of a range previously pinned. */
784 RTR3PTR pvR3;
785 } In;
786 } u;
787} SUPPAGEUNLOCK, *PSUPPAGEUNLOCK;
788/** @} */
789
790
791/** @name SUP_IOCTL_CONT_ALLOC
792 * Allocate continuous memory.
793 * @{
794 */
795#define SUP_IOCTL_CONT_ALLOC SUP_CTL_CODE_SIZE(16, SUP_IOCTL_CONT_ALLOC_SIZE)
796#define SUP_IOCTL_CONT_ALLOC_SIZE sizeof(SUPCONTALLOC)
797#define SUP_IOCTL_CONT_ALLOC_SIZE_IN (sizeof(SUPREQHDR) + RT_SIZEOFMEMB(SUPCONTALLOC, u.In))
798#define SUP_IOCTL_CONT_ALLOC_SIZE_OUT sizeof(SUPCONTALLOC)
799typedef struct SUPCONTALLOC
800{
801 /** The header. */
802 SUPREQHDR Hdr;
803 union
804 {
805 struct
806 {
807 /** The allocation size given as a page count. */
808 uint32_t cPages;
809 } In;
810
811 struct
812 {
813 /** The address of the ring-0 mapping of the allocated memory. */
814 RTR0PTR pvR0;
815 /** The address of the ring-3 mapping of the allocated memory. */
816 RTR3PTR pvR3;
817 /** The physical address of the allocation. */
818 RTHCPHYS HCPhys;
819 } Out;
820 } u;
821} SUPCONTALLOC, *PSUPCONTALLOC;
822/** @} */
823
824
825/** @name SUP_IOCTL_CONT_FREE Input.
826 * @{
827 */
828/** Free continuous memory. */
829#define SUP_IOCTL_CONT_FREE SUP_CTL_CODE_SIZE(17, SUP_IOCTL_CONT_FREE_SIZE)
830#define SUP_IOCTL_CONT_FREE_SIZE sizeof(SUPCONTFREE)
831#define SUP_IOCTL_CONT_FREE_SIZE_IN sizeof(SUPCONTFREE)
832#define SUP_IOCTL_CONT_FREE_SIZE_OUT sizeof(SUPREQHDR)
833typedef struct SUPCONTFREE
834{
835 /** The header. */
836 SUPREQHDR Hdr;
837 union
838 {
839 struct
840 {
841 /** The ring-3 address of the memory to free. */
842 RTR3PTR pvR3;
843 } In;
844 } u;
845} SUPCONTFREE, *PSUPCONTFREE;
846/** @} */
847
848
849/** @name SUP_IOCTL_GET_PAGING_MODE
850 * Get the host paging mode.
851 * @{
852 */
853#define SUP_IOCTL_GET_PAGING_MODE SUP_CTL_CODE_SIZE(18, SUP_IOCTL_GET_PAGING_MODE_SIZE)
854#define SUP_IOCTL_GET_PAGING_MODE_SIZE sizeof(SUPGETPAGINGMODE)
855#define SUP_IOCTL_GET_PAGING_MODE_SIZE_IN sizeof(SUPREQHDR)
856#define SUP_IOCTL_GET_PAGING_MODE_SIZE_OUT sizeof(SUPGETPAGINGMODE)
857typedef struct SUPGETPAGINGMODE
858{
859 /** The header. */
860 SUPREQHDR Hdr;
861 union
862 {
863 struct
864 {
865 /** The paging mode. */
866 SUPPAGINGMODE enmMode;
867 } Out;
868 } u;
869} SUPGETPAGINGMODE, *PSUPGETPAGINGMODE;
870/** @} */
871
872
873/** @name SUP_IOCTL_SET_VM_FOR_FAST
874 * Set the VM handle for doing fast call ioctl calls.
875 * @{
876 */
877#define SUP_IOCTL_SET_VM_FOR_FAST SUP_CTL_CODE_SIZE(19, SUP_IOCTL_SET_VM_FOR_FAST_SIZE)
878#define SUP_IOCTL_SET_VM_FOR_FAST_SIZE sizeof(SUPSETVMFORFAST)
879#define SUP_IOCTL_SET_VM_FOR_FAST_SIZE_IN sizeof(SUPSETVMFORFAST)
880#define SUP_IOCTL_SET_VM_FOR_FAST_SIZE_OUT sizeof(SUPREQHDR)
881typedef struct SUPSETVMFORFAST
882{
883 /** The header. */
884 SUPREQHDR Hdr;
885 union
886 {
887 struct
888 {
889 /** The ring-0 VM handle (pointer). */
890 PVMR0 pVMR0;
891 } In;
892 } u;
893} SUPSETVMFORFAST, *PSUPSETVMFORFAST;
894/** @} */
895
896
897/** @name SUP_IOCTL_GIP_MAP
898 * Map the GIP into user space.
899 * @{
900 */
901#define SUP_IOCTL_GIP_MAP SUP_CTL_CODE_SIZE(20, SUP_IOCTL_GIP_MAP_SIZE)
902#define SUP_IOCTL_GIP_MAP_SIZE sizeof(SUPGIPMAP)
903#define SUP_IOCTL_GIP_MAP_SIZE_IN sizeof(SUPREQHDR)
904#define SUP_IOCTL_GIP_MAP_SIZE_OUT sizeof(SUPGIPMAP)
905typedef struct SUPGIPMAP
906{
907 /** The header. */
908 SUPREQHDR Hdr;
909 union
910 {
911 struct
912 {
913 /** The physical address of the GIP. */
914 RTHCPHYS HCPhysGip;
915 /** Pointer to the read-only usermode GIP mapping for this session. */
916 R3PTRTYPE(PSUPGLOBALINFOPAGE) pGipR3;
917 /** Pointer to the supervisor mode GIP mapping. */
918 R0PTRTYPE(PSUPGLOBALINFOPAGE) pGipR0;
919 } Out;
920 } u;
921} SUPGIPMAP, *PSUPGIPMAP;
922/** @} */
923
924
925/** @name SUP_IOCTL_GIP_UNMAP
926 * Unmap the GIP.
927 * @{
928 */
929#define SUP_IOCTL_GIP_UNMAP SUP_CTL_CODE_SIZE(21, SUP_IOCTL_GIP_UNMAP_SIZE)
930#define SUP_IOCTL_GIP_UNMAP_SIZE sizeof(SUPGIPUNMAP)
931#define SUP_IOCTL_GIP_UNMAP_SIZE_IN sizeof(SUPGIPUNMAP)
932#define SUP_IOCTL_GIP_UNMAP_SIZE_OUT sizeof(SUPGIPUNMAP)
933typedef struct SUPGIPUNMAP
934{
935 /** The header. */
936 SUPREQHDR Hdr;
937} SUPGIPUNMAP, *PSUPGIPUNMAP;
938/** @} */
939
940
941/** @name SUP_IOCTL_CALL_SERVICE
942 * Call the a ring-0 service.
943 *
944 * @todo Might have to convert this to a big request, just like
945 * SUP_IOCTL_CALL_VMMR0
946 * @{
947 */
948#define SUP_IOCTL_CALL_SERVICE(cbReq) SUP_CTL_CODE_SIZE(22, SUP_IOCTL_CALL_SERVICE_SIZE(cbReq))
949#define SUP_IOCTL_CALL_SERVICE_SIZE(cbReq) RT_UOFFSETOF(SUPCALLSERVICE, abReqPkt[cbReq])
950#define SUP_IOCTL_CALL_SERVICE_SIZE_IN(cbReq) SUP_IOCTL_CALL_SERVICE_SIZE(cbReq)
951#define SUP_IOCTL_CALL_SERVICE_SIZE_OUT(cbReq) SUP_IOCTL_CALL_SERVICE_SIZE(cbReq)
952typedef struct SUPCALLSERVICE
953{
954 /** The header. */
955 SUPREQHDR Hdr;
956 union
957 {
958 struct
959 {
960 /** The service name. */
961 char szName[28];
962 /** Which operation to execute. */
963 uint32_t uOperation;
964 /** Argument to use when no request packet is supplied. */
965 uint64_t u64Arg;
966 } In;
967 } u;
968 /** The request packet passed to SUP. */
969 uint8_t abReqPkt[1];
970} SUPCALLSERVICE, *PSUPCALLSERVICE;
971/** @} */
972
973
974/** @name SUP_IOCTL_LOGGER_SETTINGS
975 * Changes the ring-0 release or debug logger settings.
976 * @{
977 */
978#define SUP_IOCTL_LOGGER_SETTINGS(cbStrTab) SUP_CTL_CODE_SIZE(23, SUP_IOCTL_LOGGER_SETTINGS_SIZE(cbStrTab))
979#define SUP_IOCTL_LOGGER_SETTINGS_SIZE(cbStrTab) RT_UOFFSETOF(SUPLOGGERSETTINGS, u.In.szStrings[cbStrTab])
980#define SUP_IOCTL_LOGGER_SETTINGS_SIZE_IN(cbStrTab) RT_UOFFSETOF(SUPLOGGERSETTINGS, u.In.szStrings[cbStrTab])
981#define SUP_IOCTL_LOGGER_SETTINGS_SIZE_OUT sizeof(SUPREQHDR)
982typedef struct SUPLOGGERSETTINGS
983{
984 /** The header. */
985 SUPREQHDR Hdr;
986 union
987 {
988 struct
989 {
990 /** Which logger. */
991 uint32_t fWhich;
992 /** What to do with it. */
993 uint32_t fWhat;
994 /** Offset of the flags setting string. */
995 uint32_t offFlags;
996 /** Offset of the groups setting string. */
997 uint32_t offGroups;
998 /** Offset of the destination setting string. */
999 uint32_t offDestination;
1000 /** The string table. */
1001 char szStrings[1];
1002 } In;
1003 } u;
1004} SUPLOGGERSETTINGS, *PSUPLOGGERSETTINGS;
1005
1006/** Debug logger. */
1007#define SUPLOGGERSETTINGS_WHICH_DEBUG 0
1008/** Release logger. */
1009#define SUPLOGGERSETTINGS_WHICH_RELEASE 1
1010
1011/** Change the settings. */
1012#define SUPLOGGERSETTINGS_WHAT_SETTINGS 0
1013/** Create the logger instance. */
1014#define SUPLOGGERSETTINGS_WHAT_CREATE 1
1015/** Destroy the logger instance. */
1016#define SUPLOGGERSETTINGS_WHAT_DESTROY 2
1017
1018/** @} */
1019
1020
1021/** @name Semaphore Types
1022 * @{ */
1023#define SUP_SEM_TYPE_EVENT 0
1024#define SUP_SEM_TYPE_EVENT_MULTI 1
1025/** @} */
1026
1027
1028/** @name SUP_IOCTL_SEM_OP2
1029 * Semaphore operations.
1030 * @remarks This replaces the old SUP_IOCTL_SEM_OP interface.
1031 * @{
1032 */
1033#define SUP_IOCTL_SEM_OP2 SUP_CTL_CODE_SIZE(24, SUP_IOCTL_SEM_OP2_SIZE)
1034#define SUP_IOCTL_SEM_OP2_SIZE sizeof(SUPSEMOP2)
1035#define SUP_IOCTL_SEM_OP2_SIZE_IN sizeof(SUPSEMOP2)
1036#define SUP_IOCTL_SEM_OP2_SIZE_OUT sizeof(SUPREQHDR)
1037typedef struct SUPSEMOP2
1038{
1039 /** The header. */
1040 SUPREQHDR Hdr;
1041 union
1042 {
1043 struct
1044 {
1045 /** The semaphore type. */
1046 uint32_t uType;
1047 /** The semaphore handle. */
1048 uint32_t hSem;
1049 /** The operation. */
1050 uint32_t uOp;
1051 /** Reserved, must be zero. */
1052 uint32_t uReserved;
1053 /** The number of milliseconds to wait if it's a wait operation. */
1054 union
1055 {
1056 /** Absolute timeout (RTTime[System]NanoTS).
1057 * Used by SUPSEMOP2_WAIT_NS_ABS. */
1058 uint64_t uAbsNsTimeout;
1059 /** Relative nanosecond timeout.
1060 * Used by SUPSEMOP2_WAIT_NS_REL. */
1061 uint64_t cRelNsTimeout;
1062 /** Relative millisecond timeout.
1063 * Used by SUPSEMOP2_WAIT_MS_REL. */
1064 uint32_t cRelMsTimeout;
1065 /** Generic 64-bit accessor.
1066 * ASSUMES little endian! */
1067 uint64_t u64;
1068 } uArg;
1069 } In;
1070 } u;
1071} SUPSEMOP2, *PSUPSEMOP2;
1072
1073/** Wait for a number of milliseconds. */
1074#define SUPSEMOP2_WAIT_MS_REL 0
1075/** Wait until the specified deadline is reached. */
1076#define SUPSEMOP2_WAIT_NS_ABS 1
1077/** Wait for a number of nanoseconds. */
1078#define SUPSEMOP2_WAIT_NS_REL 2
1079/** Signal the semaphore. */
1080#define SUPSEMOP2_SIGNAL 3
1081/** Reset the semaphore (only applicable to SUP_SEM_TYPE_EVENT_MULTI). */
1082#define SUPSEMOP2_RESET 4
1083/** Close the semaphore handle. */
1084#define SUPSEMOP2_CLOSE 5
1085/** @} */
1086
1087/** @name SUP_IOCTL_SEM_OP3
1088 * Semaphore operations.
1089 * @{
1090 */
1091#define SUP_IOCTL_SEM_OP3 SUP_CTL_CODE_SIZE(25, SUP_IOCTL_SEM_OP3_SIZE)
1092#define SUP_IOCTL_SEM_OP3_SIZE sizeof(SUPSEMOP3)
1093#define SUP_IOCTL_SEM_OP3_SIZE_IN sizeof(SUPSEMOP3)
1094#define SUP_IOCTL_SEM_OP3_SIZE_OUT sizeof(SUPSEMOP3)
1095typedef struct SUPSEMOP3
1096{
1097 /** The header. */
1098 SUPREQHDR Hdr;
1099 union
1100 {
1101 struct
1102 {
1103 /** The semaphore type. */
1104 uint32_t uType;
1105 /** The semaphore handle. */
1106 uint32_t hSem;
1107 /** The operation. */
1108 uint32_t uOp;
1109 /** Reserved, must be zero. */
1110 uint32_t u32Reserved;
1111 /** Reserved for future use. */
1112 uint64_t u64Reserved;
1113 } In;
1114 union
1115 {
1116 /** The handle of the created semaphore.
1117 * Used by SUPSEMOP3_CREATE. */
1118 uint32_t hSem;
1119 /** The semaphore resolution in nano seconds.
1120 * Used by SUPSEMOP3_GET_RESOLUTION. */
1121 uint32_t cNsResolution;
1122 /** The 32-bit view. */
1123 uint32_t u32;
1124 /** Reserved some space for later expansion. */
1125 uint64_t u64Reserved;
1126 } Out;
1127 } u;
1128} SUPSEMOP3, *PSUPSEMOP3;
1129
1130/** Get the wait resolution. */
1131#define SUPSEMOP3_CREATE 0
1132/** Get the wait resolution. */
1133#define SUPSEMOP3_GET_RESOLUTION 1
1134/** @} */
1135
1136/** @name SUP_IOCTL_VT_CAPS
1137 * Get the VT-x/AMD-V capabilities.
1138 *
1139 * @todo Intended for main, which means we need to relax the privilege requires
1140 * when accessing certain vboxdrv functions.
1141 *
1142 * @{
1143 */
1144#define SUP_IOCTL_VT_CAPS SUP_CTL_CODE_SIZE(26, SUP_IOCTL_VT_CAPS_SIZE)
1145#define SUP_IOCTL_VT_CAPS_SIZE sizeof(SUPVTCAPS)
1146#define SUP_IOCTL_VT_CAPS_SIZE_IN sizeof(SUPREQHDR)
1147#define SUP_IOCTL_VT_CAPS_SIZE_OUT sizeof(SUPVTCAPS)
1148typedef struct SUPVTCAPS
1149{
1150 /** The header. */
1151 SUPREQHDR Hdr;
1152 union
1153 {
1154 struct
1155 {
1156 /** The VT capability dword. */
1157 uint32_t Caps;
1158 } Out;
1159 } u;
1160} SUPVTCAPS, *PSUPVTCAPS;
1161/** @} */
1162
1163#pragma pack() /* paranoia */
1164
1165#endif
1166
Note: See TracBrowser for help on using the repository browser.

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