VirtualBox

source: vbox/trunk/include/VBox/sup.h@ 25275

Last change on this file since 25275 was 25275, checked in by vboxsync, 15 years ago

SUPDrv: Added SUPGetGIP and added a fNativeLoader indicator to SUPLDROPEN (VBOX_WITH_NATIVE_R0_LOADER).

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 40.2 KB
Line 
1/** @file
2 * SUP - Support Library. (HDrv)
3 */
4
5/*
6 * Copyright (C) 2006-2007 Sun Microsystems, Inc.
7 *
8 * This file is part of VirtualBox Open Source Edition (OSE), as
9 * available from http://www.virtualbox.org. This file is free software;
10 * you can redistribute it and/or modify it under the terms of the GNU
11 * General Public License (GPL) as published by the Free Software
12 * Foundation, in version 2 as it comes in the "COPYING" file of the
13 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
14 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
15 *
16 * The contents of this file may alternatively be used under the terms
17 * of the Common Development and Distribution License Version 1.0
18 * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
19 * VirtualBox OSE distribution, in which case the provisions of the
20 * CDDL are applicable instead of those of the GPL.
21 *
22 * You may elect to license modified versions of this file under the
23 * terms and conditions of either the GPL or the CDDL or both.
24 *
25 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
26 * Clara, CA 95054 USA or visit http://www.sun.com if you need
27 * additional information or have any questions.
28 */
29
30#ifndef ___VBox_sup_h
31#define ___VBox_sup_h
32
33#include <VBox/cdefs.h>
34#include <VBox/types.h>
35#include <iprt/assert.h>
36#include <iprt/stdarg.h>
37#include <iprt/asm.h>
38
39RT_C_DECLS_BEGIN
40
41/** @defgroup grp_sup The Support Library API
42 * @{
43 */
44
45/**
46 * Physical page descriptor.
47 */
48#pragma pack(4) /* space is more important. */
49typedef struct SUPPAGE
50{
51 /** Physical memory address. */
52 RTHCPHYS Phys;
53 /** Reserved entry for internal use by the caller. */
54 RTHCUINTPTR uReserved;
55} SUPPAGE;
56#pragma pack()
57/** Pointer to a page descriptor. */
58typedef SUPPAGE *PSUPPAGE;
59/** Pointer to a const page descriptor. */
60typedef const SUPPAGE *PCSUPPAGE;
61
62/**
63 * The paging mode.
64 *
65 * @remarks Users are making assumptions about the order here!
66 */
67typedef enum SUPPAGINGMODE
68{
69 /** The usual invalid entry.
70 * This is returned by SUPR3GetPagingMode() */
71 SUPPAGINGMODE_INVALID = 0,
72 /** Normal 32-bit paging, no global pages */
73 SUPPAGINGMODE_32_BIT,
74 /** Normal 32-bit paging with global pages. */
75 SUPPAGINGMODE_32_BIT_GLOBAL,
76 /** PAE mode, no global pages, no NX. */
77 SUPPAGINGMODE_PAE,
78 /** PAE mode with global pages. */
79 SUPPAGINGMODE_PAE_GLOBAL,
80 /** PAE mode with NX, no global pages. */
81 SUPPAGINGMODE_PAE_NX,
82 /** PAE mode with global pages and NX. */
83 SUPPAGINGMODE_PAE_GLOBAL_NX,
84 /** AMD64 mode, no global pages. */
85 SUPPAGINGMODE_AMD64,
86 /** AMD64 mode with global pages, no NX. */
87 SUPPAGINGMODE_AMD64_GLOBAL,
88 /** AMD64 mode with NX, no global pages. */
89 SUPPAGINGMODE_AMD64_NX,
90 /** AMD64 mode with global pages and NX. */
91 SUPPAGINGMODE_AMD64_GLOBAL_NX
92} SUPPAGINGMODE;
93
94
95#pragma pack(1) /* paranoia */
96
97/**
98 * Per CPU data.
99 * This is only used when
100 */
101typedef struct SUPGIPCPU
102{
103 /** Update transaction number.
104 * This number is incremented at the start and end of each update. It follows
105 * thusly that odd numbers indicates update in progress, while even numbers
106 * indicate stable data. Use this to make sure that the data items you fetch
107 * are consistent. */
108 volatile uint32_t u32TransactionId;
109 /** The interval in TSC ticks between two NanoTS updates.
110 * This is the average interval over the last 2, 4 or 8 updates + a little slack.
111 * The slack makes the time go a tiny tiny bit slower and extends the interval enough
112 * to avoid ending up with too many 1ns increments. */
113 volatile uint32_t u32UpdateIntervalTSC;
114 /** Current nanosecond timestamp. */
115 volatile uint64_t u64NanoTS;
116 /** The TSC at the time of u64NanoTS. */
117 volatile uint64_t u64TSC;
118 /** Current CPU Frequency. */
119 volatile uint64_t u64CpuHz;
120 /** Number of errors during updating.
121 * Typical errors are under/overflows. */
122 volatile uint32_t cErrors;
123 /** Index of the head item in au32TSCHistory. */
124 volatile uint32_t iTSCHistoryHead;
125 /** Array of recent TSC interval deltas.
126 * The most recent item is at index iTSCHistoryHead.
127 * This history is used to calculate u32UpdateIntervalTSC.
128 */
129 volatile uint32_t au32TSCHistory[8];
130 /** The interval between the last two NanoTS updates. (experiment for now) */
131 volatile uint32_t u32UpdateIntervalNS;
132 /** Reserved for future per processor data. */
133 volatile uint32_t au32Reserved[5];
134} SUPGIPCPU;
135AssertCompileSize(SUPGIPCPU, 96);
136/*AssertCompileMemberAlignment(SUPGIPCPU, u64TSC, 8); -fixme */
137
138/** Pointer to per cpu data.
139 * @remark there is no const version of this typedef, see g_pSUPGlobalInfoPage for details. */
140typedef SUPGIPCPU *PSUPGIPCPU;
141
142/**
143 * Global Information Page.
144 *
145 * This page contains useful information and can be mapped into any
146 * process or VM. It can be accessed thru the g_pSUPGlobalInfoPage
147 * pointer when a session is open.
148 */
149typedef struct SUPGLOBALINFOPAGE
150{
151 /** Magic (SUPGLOBALINFOPAGE_MAGIC). */
152 uint32_t u32Magic;
153 /** The GIP version. */
154 uint32_t u32Version;
155
156 /** The GIP update mode, see SUPGIPMODE. */
157 uint32_t u32Mode;
158 /** Reserved / padding. */
159 uint32_t u32Padding0;
160 /** The update frequency of the of the NanoTS. */
161 volatile uint32_t u32UpdateHz;
162 /** The update interval in nanoseconds. (10^9 / u32UpdateHz) */
163 volatile uint32_t u32UpdateIntervalNS;
164 /** The timestamp of the last time we update the update frequency. */
165 volatile uint64_t u64NanoTSLastUpdateHz;
166
167 /** Padding / reserved space for future data. */
168 uint32_t au32Padding1[56];
169
170 /** Array of per-cpu data.
171 * If u32Mode == SUPGIPMODE_SYNC_TSC then only the first entry is used.
172 * If u32Mode == SUPGIPMODE_ASYNC_TSC then the CPU ACPI ID is used as an
173 * index into the array. */
174 SUPGIPCPU aCPUs[32];
175} SUPGLOBALINFOPAGE;
176AssertCompile(sizeof(SUPGLOBALINFOPAGE) <= 0x1000);
177/* AssertCompileMemberAlignment(SUPGLOBALINFOPAGE, aCPU, 32); - fixme */
178
179/** Pointer to the global info page.
180 * @remark there is no const version of this typedef, see g_pSUPGlobalInfoPage for details. */
181typedef SUPGLOBALINFOPAGE *PSUPGLOBALINFOPAGE;
182
183#pragma pack() /* end of paranoia */
184
185/** The value of the SUPGLOBALINFOPAGE::u32Magic field. (Soryo Fuyumi) */
186#define SUPGLOBALINFOPAGE_MAGIC 0x19590106
187/** The GIP version.
188 * Upper 16 bits is the major version. Major version is only changed with
189 * incompatible changes in the GIP. */
190#define SUPGLOBALINFOPAGE_VERSION 0x00020000
191
192/**
193 * SUPGLOBALINFOPAGE::u32Mode values.
194 */
195typedef enum SUPGIPMODE
196{
197 /** The usual invalid null entry. */
198 SUPGIPMODE_INVALID = 0,
199 /** The TSC of the cores and cpus in the system is in sync. */
200 SUPGIPMODE_SYNC_TSC,
201 /** Each core has it's own TSC. */
202 SUPGIPMODE_ASYNC_TSC,
203 /** The usual 32-bit hack. */
204 SUPGIPMODE_32BIT_HACK = 0x7fffffff
205} SUPGIPMODE;
206
207/** Pointer to the Global Information Page.
208 *
209 * This pointer is valid as long as SUPLib has a open session. Anyone using
210 * the page must treat this pointer as higly volatile and not trust it beyond
211 * one transaction.
212 *
213 * @remark The GIP page is read-only to everyone but the support driver and
214 * is actually mapped read only everywhere but in ring-0. However
215 * it is not marked 'const' as this might confuse compilers into
216 * thinking that values doesn't change even if members are marked
217 * as volatile. Thus, there is no PCSUPGLOBALINFOPAGE type.
218 */
219#if defined(IN_SUP_R0) || defined(IN_SUP_R3) || defined(IN_SUP_GC)
220extern DECLEXPORT(PSUPGLOBALINFOPAGE) g_pSUPGlobalInfoPage;
221#elif defined(IN_RING0)
222# if 0 /* VBOX_WITH_NATIVE_R0_LOADER */
223# define g_pSUPGlobalInfoPage (SUPGetGIP())
224# else
225extern DECLIMPORT(SUPGLOBALINFOPAGE) g_SUPGlobalInfoPage;
226# if defined(__GNUC__) && !defined(RT_OS_DARWIN) && defined(RT_ARCH_AMD64)
227/** Workaround for ELF+GCC problem on 64-bit hosts.
228 * (GCC emits a mov with a R_X86_64_32 reloc, we need R_X86_64_64.) */
229DECLINLINE(PSUPGLOBALINFOPAGE) SUPGetGIPHlp(void)
230{
231 PSUPGLOBALINFOPAGE pGIP;
232 __asm__ __volatile__ ("movabs $g_SUPGlobalInfoPage,%0\n\t"
233 : "=a" (pGIP));
234 return pGIP;
235}
236# define g_pSUPGlobalInfoPage (SUPGetGIPHlp())
237# else
238# define g_pSUPGlobalInfoPage (&g_SUPGlobalInfoPage)
239# endif
240# endif
241#else
242extern DECLIMPORT(PSUPGLOBALINFOPAGE) g_pSUPGlobalInfoPage;
243#endif
244
245/**
246 * Gets the GIP pointer.
247 *
248 * @returns Pointer to the GIP or NULL.
249 */
250SUPDECL(PSUPGLOBALINFOPAGE) SUPGetGIP(void);
251
252/**
253 * Gets the TSC frequency of the calling CPU.
254 *
255 * @returns TSC frequency.
256 * @param pGip The GIP pointer.
257 */
258DECLINLINE(uint64_t) SUPGetCpuHzFromGIP(PSUPGLOBALINFOPAGE pGip)
259{
260 unsigned iCpu;
261
262 if (RT_UNLIKELY(!pGip || pGip->u32Magic != SUPGLOBALINFOPAGE_MAGIC))
263 return ~(uint64_t)0;
264
265 if (pGip->u32Mode != SUPGIPMODE_ASYNC_TSC)
266 iCpu = 0;
267 else
268 {
269 iCpu = ASMGetApicId();
270 if (RT_UNLIKELY(iCpu >= RT_ELEMENTS(pGip->aCPUs)))
271 return ~(uint64_t)0;
272 }
273
274 return pGip->aCPUs[iCpu].u64CpuHz;
275}
276
277
278/**
279 * Request for generic VMMR0Entry calls.
280 */
281typedef struct SUPVMMR0REQHDR
282{
283 /** The magic. (SUPVMMR0REQHDR_MAGIC) */
284 uint32_t u32Magic;
285 /** The size of the request. */
286 uint32_t cbReq;
287} SUPVMMR0REQHDR;
288/** Pointer to a ring-0 request header. */
289typedef SUPVMMR0REQHDR *PSUPVMMR0REQHDR;
290/** the SUPVMMR0REQHDR::u32Magic value (Ethan Iverson - The Bad Plus). */
291#define SUPVMMR0REQHDR_MAGIC UINT32_C(0x19730211)
292
293
294/** For the fast ioctl path.
295 * @{
296 */
297/** @see VMMR0_DO_RAW_RUN. */
298#define SUP_VMMR0_DO_RAW_RUN 0
299/** @see VMMR0_DO_HWACC_RUN. */
300#define SUP_VMMR0_DO_HWACC_RUN 1
301/** @see VMMR0_DO_NOP */
302#define SUP_VMMR0_DO_NOP 2
303/** @} */
304
305/** SUPR3QueryVTCaps capability flags
306 * @{
307 */
308#define SUPVTCAPS_AMD_V RT_BIT(0)
309#define SUPVTCAPS_VT_X RT_BIT(1)
310#define SUPVTCAPS_NESTED_PAGING RT_BIT(2)
311/** @} */
312
313/**
314 * Request for generic FNSUPR0SERVICEREQHANDLER calls.
315 */
316typedef struct SUPR0SERVICEREQHDR
317{
318 /** The magic. (SUPR0SERVICEREQHDR_MAGIC) */
319 uint32_t u32Magic;
320 /** The size of the request. */
321 uint32_t cbReq;
322} SUPR0SERVICEREQHDR;
323/** Pointer to a ring-0 service request header. */
324typedef SUPR0SERVICEREQHDR *PSUPR0SERVICEREQHDR;
325/** the SUPVMMR0REQHDR::u32Magic value (Esbjoern Svensson - E.S.P.). */
326#define SUPR0SERVICEREQHDR_MAGIC UINT32_C(0x19640416)
327
328
329/** Event semaphore handle. Ring-0 / ring-3. */
330typedef R0PTRTYPE(struct SUPSEMEVENTHANDLE *) SUPSEMEVENT;
331/** Pointer to an event semaphore handle. */
332typedef SUPSEMEVENT *PSUPSEMEVENT;
333/** Nil event semaphore handle. */
334#define NIL_SUPSEMEVENT ((SUPSEMEVENT)0)
335
336/**
337 * Creates a single release event semaphore.
338 *
339 * @returns VBox status code.
340 * @param pSession The session handle of the caller.
341 * @param phEvent Where to return the handle to the event semaphore.
342 */
343SUPDECL(int) SUPSemEventCreate(PSUPDRVSESSION pSession, PSUPSEMEVENT phEvent);
344
345/**
346 * Closes a single release event semaphore handle.
347 *
348 * @returns VBox status code.
349 * @retval VINF_OBJECT_DESTROYED if the semaphore was destroyed.
350 * @retval VINF_SUCCESS if the handle was successfully closed but the sempahore
351 * object remained alive because of other references.
352 *
353 * @param pSession The session handle of the caller.
354 * @param hEvent The handle. Nil is quietly ignored.
355 */
356SUPDECL(int) SUPSemEventClose(PSUPDRVSESSION pSession, SUPSEMEVENT hEvent);
357
358/**
359 * Signals a single release event semaphore.
360 *
361 * @returns VBox status code.
362 * @param pSession The session handle of the caller.
363 * @param hEvent The semaphore handle.
364 */
365SUPDECL(int) SUPSemEventSignal(PSUPDRVSESSION pSession, SUPSEMEVENT hEvent);
366
367#ifdef IN_RING0
368/**
369 * Waits on a single release event semaphore, not interruptible.
370 *
371 * @returns VBox status code.
372 * @param pSession The session handle of the caller.
373 * @param hEvent The semaphore handle.
374 * @param cMillies The number of milliseconds to wait.
375 * @remarks Not available in ring-3.
376 */
377SUPDECL(int) SUPSemEventWait(PSUPDRVSESSION pSession, SUPSEMEVENT hEvent, uint32_t cMillies);
378#endif
379
380/**
381 * Waits on a single release event semaphore, interruptible.
382 *
383 * @returns VBox status code.
384 * @param pSession The session handle of the caller.
385 * @param hEvent The semaphore handle.
386 * @param cMillies The number of milliseconds to wait.
387 */
388SUPDECL(int) SUPSemEventWaitNoResume(PSUPDRVSESSION pSession, SUPSEMEVENT hEvent, uint32_t cMillies);
389
390
391/** Multiple release event semaphore handle. Ring-0 / ring-3. */
392typedef R0PTRTYPE(struct SUPSEMEVENTMULTIHANDLE *) SUPSEMEVENTMULTI;
393/** Pointer to an multiple release event semaphore handle. */
394typedef SUPSEMEVENTMULTI *PSUPSEMEVENTMULTI;
395/** Nil multiple release event semaphore handle. */
396#define NIL_SUPSEMEVENTMULTI ((SUPSEMEVENTMULTI)0)
397
398/**
399 * Creates a multiple release event semaphore.
400 *
401 * @returns VBox status code.
402 * @param pSession The session handle of the caller.
403 * @param phEventMulti Where to return the handle to the event semaphore.
404 */
405SUPDECL(int) SUPSemEventMultiCreate(PSUPDRVSESSION pSession, PSUPSEMEVENTMULTI phEventMulti);
406
407/**
408 * Closes a multiple release event semaphore handle.
409 *
410 * @returns VBox status code.
411 * @retval VINF_OBJECT_DESTROYED if the semaphore was destroyed.
412 * @retval VINF_SUCCESS if the handle was successfully closed but the sempahore
413 * object remained alive because of other references.
414 *
415 * @param pSession The session handle of the caller.
416 * @param hEventMulti The handle. Nil is quietly ignored.
417 */
418SUPDECL(int) SUPSemEventMultiClose(PSUPDRVSESSION pSession, SUPSEMEVENTMULTI hEventMulti);
419
420/**
421 * Signals a multiple release event semaphore.
422 *
423 * @returns VBox status code.
424 * @param pSession The session handle of the caller.
425 * @param hEventMulti The semaphore handle.
426 */
427SUPDECL(int) SUPSemEventMultiSignal(PSUPDRVSESSION pSession, SUPSEMEVENTMULTI hEventMulti);
428
429/**
430 * Resets a multiple release event semaphore.
431 *
432 * @returns VBox status code.
433 * @param pSession The session handle of the caller.
434 * @param hEventMulti The semaphore handle.
435 */
436SUPDECL(int) SUPSemEventMultiReset(PSUPDRVSESSION pSession, SUPSEMEVENTMULTI hEventMulti);
437
438#ifdef IN_RING0
439/**
440 * Waits on a multiple release event semaphore, not interruptible.
441 *
442 * @returns VBox status code.
443 * @param pSession The session handle of the caller.
444 * @param hEventMulti The semaphore handle.
445 * @param cMillies The number of milliseconds to wait.
446 * @remarks Not available in ring-3.
447 */
448SUPDECL(int) SUPSemEventMultiWait(PSUPDRVSESSION pSession, SUPSEMEVENTMULTI hEventMulti, uint32_t cMillies);
449#endif
450
451/**
452 * Waits on a multiple release event semaphore, interruptible.
453 *
454 * @returns VBox status code.
455 * @param pSession The session handle of the caller.
456 * @param hEventMulti The semaphore handle.
457 * @param cMillies The number of milliseconds to wait.
458 */
459SUPDECL(int) SUPSemEventMultiWaitNoResume(PSUPDRVSESSION pSession, SUPSEMEVENTMULTI hEventMulti, uint32_t cMillies);
460
461
462#ifdef IN_RING3
463
464/** @defgroup grp_sup_r3 SUP Host Context Ring 3 API
465 * @ingroup grp_sup
466 * @{
467 */
468
469/**
470 * Installs the support library.
471 *
472 * @returns VBox status code.
473 */
474SUPR3DECL(int) SUPR3Install(void);
475
476/**
477 * Uninstalls the support library.
478 *
479 * @returns VBox status code.
480 */
481SUPR3DECL(int) SUPR3Uninstall(void);
482
483/**
484 * Trusted main entry point.
485 *
486 * This is exported as "TrustedMain" by the dynamic libraries which contains the
487 * "real" application binary for which the hardened stub is built. The entry
488 * point is invoked upon successfull initialization of the support library and
489 * runtime.
490 *
491 * @returns main kind of exit code.
492 * @param argc The argument count.
493 * @param argv The argument vector.
494 * @param envp The environment vector.
495 */
496typedef DECLCALLBACK(int) FNSUPTRUSTEDMAIN(int argc, char **argv, char **envp);
497/** Pointer to FNSUPTRUSTEDMAIN(). */
498typedef FNSUPTRUSTEDMAIN *PFNSUPTRUSTEDMAIN;
499
500/** Which operation failed. */
501typedef enum SUPINITOP
502{
503 /** Invalid. */
504 kSupInitOp_Invalid = 0,
505 /** Installation integrity error. */
506 kSupInitOp_Integrity,
507 /** Setuid related. */
508 kSupInitOp_RootCheck,
509 /** Driver related. */
510 kSupInitOp_Driver,
511 /** IPRT init related. */
512 kSupInitOp_IPRT,
513 /** Place holder. */
514 kSupInitOp_End
515} SUPINITOP;
516
517/**
518 * Trusted error entry point, optional.
519 *
520 * This is exported as "TrustedError" by the dynamic libraries which contains
521 * the "real" application binary for which the hardened stub is built.
522 *
523 * @param pszWhere Where the error occured (function name).
524 * @param enmWhat Which operation went wrong.
525 * @param rc The status code.
526 * @param pszMsgFmt Error message format string.
527 * @param va The message format arguments.
528 */
529typedef DECLCALLBACK(void) FNSUPTRUSTEDERROR(const char *pszWhere, SUPINITOP enmWhat, int rc, const char *pszMsgFmt, va_list va);
530/** Pointer to FNSUPTRUSTEDERROR. */
531typedef FNSUPTRUSTEDERROR *PFNSUPTRUSTEDERROR;
532
533/**
534 * Secure main.
535 *
536 * This is used for the set-user-ID-on-execute binaries on unixy systems
537 * and when using the open-vboxdrv-via-root-service setup on Windows.
538 *
539 * This function will perform the integrity checks of the VirtualBox
540 * installation, open the support driver, open the root service (later),
541 * and load the DLL corresponding to \a pszProgName and execute its main
542 * function.
543 *
544 * @returns Return code appropriate for main().
545 *
546 * @param pszProgName The program name. This will be used to figure out which
547 * DLL/SO/DYLIB to load and execute.
548 * @param fFlags Flags.
549 * @param argc The argument count.
550 * @param argv The argument vector.
551 * @param envp The environment vector.
552 */
553DECLHIDDEN(int) SUPR3HardenedMain(const char *pszProgName, uint32_t fFlags, int argc, char **argv, char **envp);
554
555/** @name SUPR3SecureMain flags.
556 * @{ */
557/** Don't open the device. (Intended for VirtualBox without -startvm.) */
558#define SUPSECMAIN_FLAGS_DONT_OPEN_DEV RT_BIT_32(0)
559/** @} */
560
561/**
562 * Initializes the support library.
563 * Each succesful call to SUPR3Init() must be countered by a
564 * call to SUPR3Term(false).
565 *
566 * @returns VBox status code.
567 * @param ppSession Where to store the session handle. Defaults to NULL.
568 */
569SUPR3DECL(int) SUPR3Init(PSUPDRVSESSION *ppSession);
570
571/**
572 * Terminates the support library.
573 *
574 * @returns VBox status code.
575 * @param fForced Forced termination. This means to ignore the
576 * init call count and just terminated.
577 */
578#ifdef __cplusplus
579SUPR3DECL(int) SUPR3Term(bool fForced = false);
580#else
581SUPR3DECL(int) SUPR3Term(int fForced);
582#endif
583
584/**
585 * Sets the ring-0 VM handle for use with fast IOCtls.
586 *
587 * @returns VBox status code.
588 * @param pVMR0 The ring-0 VM handle.
589 * NIL_RTR0PTR can be used to unset the handle when the
590 * VM is about to be destroyed.
591 */
592SUPR3DECL(int) SUPR3SetVMForFastIOCtl(PVMR0 pVMR0);
593
594/**
595 * Calls the HC R0 VMM entry point.
596 * See VMMR0Entry() for more details.
597 *
598 * @returns error code specific to uFunction.
599 * @param pVMR0 Pointer to the Ring-0 (Host Context) mapping of the VM structure.
600 * @param idCpu The virtual CPU ID.
601 * @param uOperation Operation to execute.
602 * @param pvArg Argument.
603 */
604SUPR3DECL(int) SUPR3CallVMMR0(PVMR0 pVMR0, VMCPUID idCpu, unsigned uOperation, void *pvArg);
605
606/**
607 * Variant of SUPR3CallVMMR0, except that this takes the fast ioclt path
608 * regardsless of compile-time defaults.
609 *
610 * @returns VBox status code.
611 * @param pVMR0 The ring-0 VM handle.
612 * @param uOperation The operation; only the SUP_VMMR0_DO_* ones are valid.
613 * @param idCpu The virtual CPU ID.
614 */
615SUPR3DECL(int) SUPR3CallVMMR0Fast(PVMR0 pVMR0, unsigned uOperation, VMCPUID idCpu);
616
617/**
618 * Calls the HC R0 VMM entry point, in a safer but slower manner than
619 * SUPR3CallVMMR0. When entering using this call the R0 components can call
620 * into the host kernel (i.e. use the SUPR0 and RT APIs).
621 *
622 * See VMMR0Entry() for more details.
623 *
624 * @returns error code specific to uFunction.
625 * @param pVMR0 Pointer to the Ring-0 (Host Context) mapping of the VM structure.
626 * @param idCpu The virtual CPU ID.
627 * @param uOperation Operation to execute.
628 * @param u64Arg Constant argument.
629 * @param pReqHdr Pointer to a request header. Optional.
630 * This will be copied in and out of kernel space. There currently is a size
631 * limit on this, just below 4KB.
632 */
633SUPR3DECL(int) SUPR3CallVMMR0Ex(PVMR0 pVMR0, VMCPUID idCpu, unsigned uOperation, uint64_t u64Arg, PSUPVMMR0REQHDR pReqHdr);
634
635/**
636 * Calls a ring-0 service.
637 *
638 * The operation and the request packet is specific to the service.
639 *
640 * @returns error code specific to uFunction.
641 * @param pszService The service name.
642 * @param cchService The length of the service name.
643 * @param uReq The request number.
644 * @param u64Arg Constant argument.
645 * @param pReqHdr Pointer to a request header. Optional.
646 * This will be copied in and out of kernel space. There currently is a size
647 * limit on this, just below 4KB.
648 */
649SUPR3DECL(int) SUPR3CallR0Service(const char *pszService, size_t cchService, uint32_t uOperation, uint64_t u64Arg, PSUPR0SERVICEREQHDR pReqHdr);
650
651/** Which logger. */
652typedef enum SUPLOGGER
653{
654 SUPLOGGER_DEBUG = 1,
655 SUPLOGGER_RELEASE
656} SUPLOGGER;
657
658/**
659 * Changes the settings of the specified ring-0 logger.
660 *
661 * @returns VBox status code.
662 * @param enmWhich Which logger.
663 * @param pszFlags The flags settings.
664 * @param pszGroups The groups settings.
665 * @param pszDest The destionation specificier.
666 */
667SUPR3DECL(int) SUPR3LoggerSettings(SUPLOGGER enmWhich, const char *pszFlags, const char *pszGroups, const char *pszDest);
668
669/**
670 * Creates a ring-0 logger instance.
671 *
672 * @returns VBox status code.
673 * @param enmWhich Which logger to create.
674 * @param pszFlags The flags settings.
675 * @param pszGroups The groups settings.
676 * @param pszDest The destionation specificier.
677 */
678SUPR3DECL(int) SUPR3LoggerCreate(SUPLOGGER enmWhich, const char *pszFlags, const char *pszGroups, const char *pszDest);
679
680/**
681 * Destroys a ring-0 logger instance.
682 *
683 * @returns VBox status code.
684 * @param enmWhich Which logger.
685 */
686SUPR3DECL(int) SUPR3LoggerDestroy(SUPLOGGER enmWhich);
687
688/**
689 * Queries the paging mode of the host OS.
690 *
691 * @returns The paging mode.
692 */
693SUPR3DECL(SUPPAGINGMODE) SUPR3GetPagingMode(void);
694
695/**
696 * Allocate zero-filled pages.
697 *
698 * Use this to allocate a number of pages suitable for seeding / locking.
699 * Call SUPR3PageFree() to free the pages once done with them.
700 *
701 * @returns VBox status.
702 * @param cPages Number of pages to allocate.
703 * @param ppvPages Where to store the base pointer to the allocated pages.
704 */
705SUPR3DECL(int) SUPR3PageAlloc(size_t cPages, void **ppvPages);
706
707/**
708 * Frees pages allocated with SUPR3PageAlloc().
709 *
710 * @returns VBox status.
711 * @param pvPages Pointer returned by SUPR3PageAlloc().
712 * @param cPages Number of pages that was allocated.
713 */
714SUPR3DECL(int) SUPR3PageFree(void *pvPages, size_t cPages);
715
716/**
717 * Allocate non-zeroed, locked, pages with user and, optionally, kernel
718 * mappings.
719 *
720 * Use SUPR3PageFreeEx() to free memory allocated with this function.
721 *
722 * @returns VBox status code.
723 * @param cPages The number of pages to allocate.
724 * @param fFlags Flags, reserved. Must be zero.
725 * @param ppvPages Where to store the address of the user mapping.
726 * @param pR0Ptr Where to store the address of the kernel mapping.
727 * NULL if no kernel mapping is desired.
728 * @param paPages Where to store the physical addresses of each page.
729 * Optional.
730 */
731SUPR3DECL(int) SUPR3PageAllocEx(size_t cPages, uint32_t fFlags, void **ppvPages, PRTR0PTR pR0Ptr, PSUPPAGE paPages);
732
733/**
734 * Maps a portion of a ring-3 only allocation into kernel space.
735 *
736 * @returns VBox status code.
737 *
738 * @param pvR3 The address SUPR3PageAllocEx return.
739 * @param off Offset to start mapping at. Must be page aligned.
740 * @param cb Number of bytes to map. Must be page aligned.
741 * @param fFlags Flags, must be zero.
742 * @param pR0Ptr Where to store the address on success.
743 *
744 */
745SUPR3DECL(int) SUPR3PageMapKernel(void *pvR3, uint32_t off, uint32_t cb, uint32_t fFlags, PRTR0PTR pR0Ptr);
746
747/**
748 * Changes the protection of
749 *
750 * @returns VBox status code.
751 * @retval VERR_NOT_SUPPORTED if the OS doesn't allow us to change page level
752 * protection. See also RTR0MemObjProtect.
753 *
754 * @param pvR3 The ring-3 address SUPR3PageAllocEx returned.
755 * @param R0Ptr The ring-0 address SUPR3PageAllocEx returned if it
756 * is desired that the corresponding ring-0 page
757 * mappings should change protection as well. Pass
758 * NIL_RTR0PTR if the ring-0 pages should remain
759 * unaffected.
760 * @param off Offset to start at which to start chagning the page
761 * level protection. Must be page aligned.
762 * @param cb Number of bytes to change. Must be page aligned.
763 * @param fProt The new page level protection, either a combination
764 * of RTMEM_PROT_READ, RTMEM_PROT_WRITE and
765 * RTMEM_PROT_EXEC, or just RTMEM_PROT_NONE.
766 */
767SUPR3DECL(int) SUPR3PageProtect(void *pvR3, RTR0PTR R0Ptr, uint32_t off, uint32_t cb, uint32_t fProt);
768
769/**
770 * Free pages allocated by SUPR3PageAllocEx.
771 *
772 * @returns VBox status code.
773 * @param pvPages The address of the user mapping.
774 * @param cPages The number of pages.
775 */
776SUPR3DECL(int) SUPR3PageFreeEx(void *pvPages, size_t cPages);
777
778/**
779 * Allocated memory with page aligned memory with a contiguous and locked physical
780 * memory backing below 4GB.
781 *
782 * @returns Pointer to the allocated memory (virtual address).
783 * *pHCPhys is set to the physical address of the memory.
784 * If ppvR0 isn't NULL, *ppvR0 is set to the ring-0 mapping.
785 * The returned memory must be freed using SUPR3ContFree().
786 * @returns NULL on failure.
787 * @param cPages Number of pages to allocate.
788 * @param pR0Ptr Where to store the ring-0 mapping of the allocation. (optional)
789 * @param pHCPhys Where to store the physical address of the memory block.
790 *
791 * @remark This 2nd version of this API exists because we're not able to map the
792 * ring-3 mapping executable on WIN64. This is a serious problem in regard to
793 * the world switchers.
794 */
795SUPR3DECL(void *) SUPR3ContAlloc(size_t cPages, PRTR0PTR pR0Ptr, PRTHCPHYS pHCPhys);
796
797/**
798 * Frees memory allocated with SUPR3ContAlloc().
799 *
800 * @returns VBox status code.
801 * @param pv Pointer to the memory block which should be freed.
802 * @param cPages Number of pages to be freed.
803 */
804SUPR3DECL(int) SUPR3ContFree(void *pv, size_t cPages);
805
806/**
807 * Allocated non contiguous physical memory below 4GB.
808 *
809 * The memory isn't zeroed.
810 *
811 * @returns VBox status code.
812 * @returns NULL on failure.
813 * @param cPages Number of pages to allocate.
814 * @param ppvPages Where to store the pointer to the allocated memory.
815 * The pointer stored here on success must be passed to
816 * SUPR3LowFree when the memory should be released.
817 * @param ppvPagesR0 Where to store the ring-0 pointer to the allocated memory. optional.
818 * @param paPages Where to store the physical addresses of the individual pages.
819 */
820SUPR3DECL(int) SUPR3LowAlloc(size_t cPages, void **ppvPages, PRTR0PTR ppvPagesR0, PSUPPAGE paPages);
821
822/**
823 * Frees memory allocated with SUPR3LowAlloc().
824 *
825 * @returns VBox status code.
826 * @param pv Pointer to the memory block which should be freed.
827 * @param cPages Number of pages that was allocated.
828 */
829SUPR3DECL(int) SUPR3LowFree(void *pv, size_t cPages);
830
831/**
832 * Load a module into R0 HC.
833 *
834 * This will verify the file integrity in a similar manner as
835 * SUPR3HardenedVerifyFile before loading it.
836 *
837 * @returns VBox status code.
838 * @param pszFilename The path to the image file.
839 * @param pszModule The module name. Max 32 bytes.
840 * @param ppvImageBase Where to store the image address.
841 */
842SUPR3DECL(int) SUPR3LoadModule(const char *pszFilename, const char *pszModule, void **ppvImageBase);
843
844/**
845 * Load a module into R0 HC.
846 *
847 * This will verify the file integrity in a similar manner as
848 * SUPR3HardenedVerifyFile before loading it.
849 *
850 * @returns VBox status code.
851 * @param pszFilename The path to the image file.
852 * @param pszModule The module name. Max 32 bytes.
853 * @param pszSrvReqHandler The name of the service request handler entry
854 * point. See FNSUPR0SERVICEREQHANDLER.
855 * @param ppvImageBase Where to store the image address.
856 */
857SUPR3DECL(int) SUPR3LoadServiceModule(const char *pszFilename, const char *pszModule,
858 const char *pszSrvReqHandler, void **ppvImageBase);
859
860/**
861 * Frees a R0 HC module.
862 *
863 * @returns VBox status code.
864 * @param pszModule The module to free.
865 * @remark This will not actually 'free' the module, there are of course usage counting.
866 */
867SUPR3DECL(int) SUPR3FreeModule(void *pvImageBase);
868
869/**
870 * Get the address of a symbol in a ring-0 module.
871 *
872 * @returns VBox status code.
873 * @param pszModule The module name.
874 * @param pszSymbol Symbol name. If it's value is less than 64k it's treated like a
875 * ordinal value rather than a string pointer.
876 * @param ppvValue Where to store the symbol value.
877 */
878SUPR3DECL(int) SUPR3GetSymbolR0(void *pvImageBase, const char *pszSymbol, void **ppvValue);
879
880/**
881 * Load R0 HC VMM code.
882 *
883 * @returns VBox status code.
884 * @deprecated Use SUPR3LoadModule(pszFilename, "VMMR0.r0", &pvImageBase)
885 */
886SUPR3DECL(int) SUPR3LoadVMM(const char *pszFilename);
887
888/**
889 * Unloads R0 HC VMM code.
890 *
891 * @returns VBox status code.
892 * @deprecated Use SUPR3FreeModule().
893 */
894SUPR3DECL(int) SUPR3UnloadVMM(void);
895
896/**
897 * Get the physical address of the GIP.
898 *
899 * @returns VBox status code.
900 * @param pHCPhys Where to store the physical address of the GIP.
901 */
902SUPR3DECL(int) SUPR3GipGetPhys(PRTHCPHYS pHCPhys);
903
904/**
905 * Verifies the integrity of a file, and optionally opens it.
906 *
907 * The integrity check is for whether the file is suitable for loading into
908 * the hypervisor or VM process. The integrity check may include verifying
909 * the authenticode/elfsign/whatever signature of the file, which can take
910 * a little while.
911 *
912 * @returns VBox status code. On failure it will have printed a LogRel message.
913 *
914 * @param pszFilename The file.
915 * @param pszWhat For the LogRel on failure.
916 * @param phFile Where to store the handle to the opened file. This is optional, pass NULL
917 * if the file should not be opened.
918 */
919SUPR3DECL(int) SUPR3HardenedVerifyFile(const char *pszFilename, const char *pszWhat, PRTFILE phFile);
920
921/**
922 * Same as RTLdrLoad() but will verify the files it loads (hardened builds).
923 *
924 * Will add dll suffix if missing and try load the file.
925 *
926 * @returns iprt status code.
927 * @param pszFilename Image filename. This must have a path.
928 * @param phLdrMod Where to store the handle to the loaded module.
929 */
930SUPR3DECL(int) SUPR3HardenedLdrLoad(const char *pszFilename, PRTLDRMOD phLdrMod);
931
932/**
933 * Same as RTLdrLoadAppPriv() but it will verify the files it loads (hardened
934 * builds).
935 *
936 * Will add dll suffix to the file if missing, then look for it in the
937 * architecture dependent application directory.
938 *
939 * @returns iprt status code.
940 * @param pszFilename Image filename.
941 * @param phLdrMod Where to store the handle to the loaded module.
942 */
943SUPR3DECL(int) SUPR3HardenedLdrLoadAppPriv(const char *pszFilename, PRTLDRMOD phLdrMod);
944
945
946/**
947 * Check if the host kernel can run in VMX root mode.
948 *
949 * @returns VINF_SUCCESS if supported, error code indicating why if not.
950 */
951SUPR3DECL(int) SUPR3QueryVTxSupported(void);
952
953
954/**
955 * Return VT-x/AMD-V capabilities.
956 *
957 * @returns VINF_SUCCESS if supported, error code indicating why if not.
958 * @param pfCaps Pointer to capability dword (out).
959 */
960SUPR3DECL(int) SUPR3QueryVTCaps(uint32_t *pfCaps);
961
962/** @} */
963#endif /* IN_RING3 */
964
965
966#ifdef IN_RING0
967/** @defgroup grp_sup_r0 SUP Host Context Ring 0 API
968 * @ingroup grp_sup
969 * @{
970 */
971
972/**
973 * Security objectype.
974 */
975typedef enum SUPDRVOBJTYPE
976{
977 /** The usual invalid object. */
978 SUPDRVOBJTYPE_INVALID = 0,
979 /** A Virtual Machine instance. */
980 SUPDRVOBJTYPE_VM,
981 /** Internal network. */
982 SUPDRVOBJTYPE_INTERNAL_NETWORK,
983 /** Internal network interface. */
984 SUPDRVOBJTYPE_INTERNAL_NETWORK_INTERFACE,
985 /** Single release event semaphore. */
986 SUPDRVOBJTYPE_SEM_EVENT,
987 /** Multiple release event semaphore. */
988 SUPDRVOBJTYPE_SEM_EVENT_MULTI,
989 /** The first invalid object type in this end. */
990 SUPDRVOBJTYPE_END,
991 /** The usual 32-bit type size hack. */
992 SUPDRVOBJTYPE_32_BIT_HACK = 0x7ffffff
993} SUPDRVOBJTYPE;
994
995/**
996 * Object destructor callback.
997 * This is called for reference counted objectes when the count reaches 0.
998 *
999 * @param pvObj The object pointer.
1000 * @param pvUser1 The first user argument.
1001 * @param pvUser2 The second user argument.
1002 */
1003typedef DECLCALLBACK(void) FNSUPDRVDESTRUCTOR(void *pvObj, void *pvUser1, void *pvUser2);
1004/** Pointer to a FNSUPDRVDESTRUCTOR(). */
1005typedef FNSUPDRVDESTRUCTOR *PFNSUPDRVDESTRUCTOR;
1006
1007SUPR0DECL(void *) SUPR0ObjRegister(PSUPDRVSESSION pSession, SUPDRVOBJTYPE enmType, PFNSUPDRVDESTRUCTOR pfnDestructor, void *pvUser1, void *pvUser2);
1008SUPR0DECL(int) SUPR0ObjAddRef(void *pvObj, PSUPDRVSESSION pSession);
1009SUPR0DECL(int) SUPR0ObjAddRefEx(void *pvObj, PSUPDRVSESSION pSession, bool fNoBlocking);
1010SUPR0DECL(int) SUPR0ObjRelease(void *pvObj, PSUPDRVSESSION pSession);
1011SUPR0DECL(int) SUPR0ObjVerifyAccess(void *pvObj, PSUPDRVSESSION pSession, const char *pszObjName);
1012
1013SUPR0DECL(int) SUPR0LockMem(PSUPDRVSESSION pSession, RTR3PTR pvR3, uint32_t cPages, PRTHCPHYS paPages);
1014SUPR0DECL(int) SUPR0UnlockMem(PSUPDRVSESSION pSession, RTR3PTR pvR3);
1015SUPR0DECL(int) SUPR0ContAlloc(PSUPDRVSESSION pSession, uint32_t cPages, PRTR0PTR ppvR0, PRTR3PTR ppvR3, PRTHCPHYS pHCPhys);
1016SUPR0DECL(int) SUPR0ContFree(PSUPDRVSESSION pSession, RTHCUINTPTR uPtr);
1017SUPR0DECL(int) SUPR0LowAlloc(PSUPDRVSESSION pSession, uint32_t cPages, PRTR0PTR ppvR0, PRTR3PTR ppvR3, PRTHCPHYS paPages);
1018SUPR0DECL(int) SUPR0LowFree(PSUPDRVSESSION pSession, RTHCUINTPTR uPtr);
1019SUPR0DECL(int) SUPR0MemAlloc(PSUPDRVSESSION pSession, uint32_t cb, PRTR0PTR ppvR0, PRTR3PTR ppvR3);
1020SUPR0DECL(int) SUPR0MemGetPhys(PSUPDRVSESSION pSession, RTHCUINTPTR uPtr, PSUPPAGE paPages);
1021SUPR0DECL(int) SUPR0MemFree(PSUPDRVSESSION pSession, RTHCUINTPTR uPtr);
1022SUPR0DECL(int) SUPR0PageAllocEx(PSUPDRVSESSION pSession, uint32_t cPages, uint32_t fFlags, PRTR3PTR ppvR3, PRTR0PTR ppvR0, PRTHCPHYS paPages);
1023SUPR0DECL(int) SUPR0PageMapKernel(PSUPDRVSESSION pSession, RTR3PTR pvR3, uint32_t offSub, uint32_t cbSub, uint32_t fFlags, PRTR0PTR ppvR0);
1024SUPR0DECL(int) SUPR0PageProtect(PSUPDRVSESSION pSession, RTR3PTR pvR3, RTR0PTR pvR0, uint32_t offSub, uint32_t cbSub, uint32_t fProt);
1025SUPR0DECL(int) SUPR0PageFree(PSUPDRVSESSION pSession, RTR3PTR pvR3);
1026SUPR0DECL(int) SUPR0GipMap(PSUPDRVSESSION pSession, PRTR3PTR ppGipR3, PRTHCPHYS pHCPhysGip);
1027SUPR0DECL(int) SUPR0QueryVTCaps(PSUPDRVSESSION pSession, uint32_t *pfCaps);
1028SUPR0DECL(int) SUPR0GipUnmap(PSUPDRVSESSION pSession);
1029SUPR0DECL(int) SUPR0Printf(const char *pszFormat, ...);
1030SUPR0DECL(SUPPAGINGMODE) SUPR0GetPagingMode(void);
1031SUPR0DECL(int) SUPR0EnableVTx(bool fEnable);
1032
1033/** @name Absolute symbols
1034 * Take the address of these, don't try call them.
1035 * @{ */
1036SUPR0DECL(void) SUPR0AbsIs64bit(void);
1037SUPR0DECL(void) SUPR0Abs64bitKernelCS(void);
1038SUPR0DECL(void) SUPR0Abs64bitKernelSS(void);
1039SUPR0DECL(void) SUPR0Abs64bitKernelDS(void);
1040SUPR0DECL(void) SUPR0AbsKernelCS(void);
1041SUPR0DECL(void) SUPR0AbsKernelSS(void);
1042SUPR0DECL(void) SUPR0AbsKernelDS(void);
1043SUPR0DECL(void) SUPR0AbsKernelES(void);
1044SUPR0DECL(void) SUPR0AbsKernelFS(void);
1045SUPR0DECL(void) SUPR0AbsKernelGS(void);
1046/** @} */
1047
1048/**
1049 * Support driver component factory.
1050 *
1051 * Component factories are registered by drivers that provides services
1052 * such as the host network interface filtering and access to the host
1053 * TCP/IP stack.
1054 *
1055 * @remark Module dependencies and making sure that a component doesn't
1056 * get unloaded while in use, is the sole responsibility of the
1057 * driver/kext/whatever implementing the component.
1058 */
1059typedef struct SUPDRVFACTORY
1060{
1061 /** The (unique) name of the component factory. */
1062 char szName[56];
1063 /**
1064 * Queries a factory interface.
1065 *
1066 * The factory interface is specific to each component and will be be
1067 * found in the header(s) for the component alongside its UUID.
1068 *
1069 * @returns Pointer to the factory interfaces on success, NULL on failure.
1070 *
1071 * @param pSupDrvFactory Pointer to this structure.
1072 * @param pSession The SUPDRV session making the query.
1073 * @param pszInterfaceUuid The UUID of the factory interface.
1074 */
1075 DECLR0CALLBACKMEMBER(void *, pfnQueryFactoryInterface,(struct SUPDRVFACTORY const *pSupDrvFactory, PSUPDRVSESSION pSession, const char *pszInterfaceUuid));
1076} SUPDRVFACTORY;
1077/** Pointer to a support driver factory. */
1078typedef SUPDRVFACTORY *PSUPDRVFACTORY;
1079/** Pointer to a const support driver factory. */
1080typedef SUPDRVFACTORY const *PCSUPDRVFACTORY;
1081
1082SUPR0DECL(int) SUPR0ComponentRegisterFactory(PSUPDRVSESSION pSession, PCSUPDRVFACTORY pFactory);
1083SUPR0DECL(int) SUPR0ComponentDeregisterFactory(PSUPDRVSESSION pSession, PCSUPDRVFACTORY pFactory);
1084SUPR0DECL(int) SUPR0ComponentQueryFactory(PSUPDRVSESSION pSession, const char *pszName, const char *pszInterfaceUuid, void **ppvFactoryIf);
1085
1086
1087/**
1088 * Service request callback function.
1089 *
1090 * @returns VBox status code.
1091 * @param pSession The caller's session.
1092 * @param u64Arg 64-bit integer argument.
1093 * @param pReqHdr The request header. Input / Output. Optional.
1094 */
1095typedef DECLCALLBACK(int) FNSUPR0SERVICEREQHANDLER(PSUPDRVSESSION pSession, uint32_t uOperation,
1096 uint64_t u64Arg, PSUPR0SERVICEREQHDR pReqHdr);
1097/** Pointer to a FNR0SERVICEREQHANDLER(). */
1098typedef R0PTRTYPE(FNSUPR0SERVICEREQHANDLER *) PFNSUPR0SERVICEREQHANDLER;
1099
1100
1101/** @defgroup grp_sup_r0_idc The IDC Interface
1102 * @ingroup grp_sup_r0
1103 * @{
1104 */
1105
1106/** The current SUPDRV IDC version.
1107 * This follows the usual high word / low word rules, i.e. high word is the
1108 * major number and it signifies incompatible interface changes. */
1109#define SUPDRV_IDC_VERSION UINT32_C(0x00010000)
1110
1111/**
1112 * Inter-Driver Communcation Handle.
1113 */
1114typedef union SUPDRVIDCHANDLE
1115{
1116 /** Padding for opaque usage.
1117 * Must be greater or equal in size than the private struct. */
1118 void *apvPadding[4];
1119#ifdef SUPDRVIDCHANDLEPRIVATE_DECLARED
1120 /** The private view. */
1121 struct SUPDRVIDCHANDLEPRIVATE s;
1122#endif
1123} SUPDRVIDCHANDLE;
1124/** Pointer to a handle. */
1125typedef SUPDRVIDCHANDLE *PSUPDRVIDCHANDLE;
1126
1127SUPR0DECL(int) SUPR0IdcOpen(PSUPDRVIDCHANDLE pHandle, uint32_t uReqVersion, uint32_t uMinVersion,
1128 uint32_t *puSessionVersion, uint32_t *puDriverVersion, uint32_t *puDriverRevision);
1129SUPR0DECL(int) SUPR0IdcCall(PSUPDRVIDCHANDLE pHandle, uint32_t iReq, void *pvReq, uint32_t cbReq);
1130SUPR0DECL(int) SUPR0IdcClose(PSUPDRVIDCHANDLE pHandle);
1131SUPR0DECL(PSUPDRVSESSION) SUPR0IdcGetSession(PSUPDRVIDCHANDLE pHandle);
1132SUPR0DECL(int) SUPR0IdcComponentRegisterFactory(PSUPDRVIDCHANDLE pHandle, PCSUPDRVFACTORY pFactory);
1133SUPR0DECL(int) SUPR0IdcComponentDeregisterFactory(PSUPDRVIDCHANDLE pHandle, PCSUPDRVFACTORY pFactory);
1134
1135/** @} */
1136
1137/** @} */
1138#endif
1139
1140/** @} */
1141
1142RT_C_DECLS_END
1143
1144#endif
1145
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