VirtualBox

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

Last change on this file since 41086 was 40983, checked in by vboxsync, 13 years ago

warnings.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 60.0 KB
Line 
1/** @file
2 * SUP - Support Library. (HDrv)
3 */
4
5/*
6 * Copyright (C) 2006-2007 Oracle Corporation
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
26#ifndef ___VBox_sup_h
27#define ___VBox_sup_h
28
29#include <VBox/cdefs.h>
30#include <VBox/types.h>
31#include <iprt/assert.h>
32#include <iprt/stdarg.h>
33#include <iprt/cpuset.h>
34
35RT_C_DECLS_BEGIN
36
37struct VTGOBJHDR;
38struct VTGPROBELOC;
39
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/**
96 * The CPU state.
97 */
98typedef enum SUPGIPCPUSTATE
99{
100 /** Invalid CPU state / unused CPU entry. */
101 SUPGIPCPUSTATE_INVALID = 0,
102 /** The CPU is not present. */
103 SUPGIPCPUSTATE_ABSENT,
104 /** The CPU is offline. */
105 SUPGIPCPUSTATE_OFFLINE,
106 /** The CPU is online. */
107 SUPGIPCPUSTATE_ONLINE,
108 /** Force 32-bit enum type. */
109 SUPGIPCPUSTATE_32_BIT_HACK = 0x7fffffff
110} SUPGIPCPUSTATE;
111
112/**
113 * Per CPU data.
114 */
115typedef struct SUPGIPCPU
116{
117 /** Update transaction number.
118 * This number is incremented at the start and end of each update. It follows
119 * thusly that odd numbers indicates update in progress, while even numbers
120 * indicate stable data. Use this to make sure that the data items you fetch
121 * are consistent. */
122 volatile uint32_t u32TransactionId;
123 /** The interval in TSC ticks between two NanoTS updates.
124 * This is the average interval over the last 2, 4 or 8 updates + a little slack.
125 * The slack makes the time go a tiny tiny bit slower and extends the interval enough
126 * to avoid ending up with too many 1ns increments. */
127 volatile uint32_t u32UpdateIntervalTSC;
128 /** Current nanosecond timestamp. */
129 volatile uint64_t u64NanoTS;
130 /** The TSC at the time of u64NanoTS. */
131 volatile uint64_t u64TSC;
132 /** Current CPU Frequency. */
133 volatile uint64_t u64CpuHz;
134 /** Number of errors during updating.
135 * Typical errors are under/overflows. */
136 volatile uint32_t cErrors;
137 /** Index of the head item in au32TSCHistory. */
138 volatile uint32_t iTSCHistoryHead;
139 /** Array of recent TSC interval deltas.
140 * The most recent item is at index iTSCHistoryHead.
141 * This history is used to calculate u32UpdateIntervalTSC.
142 */
143 volatile uint32_t au32TSCHistory[8];
144 /** The interval between the last two NanoTS updates. (experiment for now) */
145 volatile uint32_t u32PrevUpdateIntervalNS;
146
147 /** Reserved for future per processor data. */
148 volatile uint32_t au32Reserved[5+5];
149
150 /** @todo Add topology/NUMA info. */
151 /** The CPU state. */
152 SUPGIPCPUSTATE volatile enmState;
153 /** The host CPU ID of this CPU (the SUPGIPCPU is indexed by APIC ID). */
154 RTCPUID idCpu;
155 /** The CPU set index of this CPU. */
156 int16_t iCpuSet;
157 /** The APIC ID of this CPU. */
158 uint16_t idApic;
159} SUPGIPCPU;
160AssertCompileSize(RTCPUID, 4);
161AssertCompileSize(SUPGIPCPU, 128);
162AssertCompileMemberAlignment(SUPGIPCPU, u64NanoTS, 8);
163AssertCompileMemberAlignment(SUPGIPCPU, u64TSC, 8);
164
165/** Pointer to per cpu data.
166 * @remark there is no const version of this typedef, see g_pSUPGlobalInfoPage for details. */
167typedef SUPGIPCPU *PSUPGIPCPU;
168
169
170
171/**
172 * Global Information Page.
173 *
174 * This page contains useful information and can be mapped into any
175 * process or VM. It can be accessed thru the g_pSUPGlobalInfoPage
176 * pointer when a session is open.
177 */
178typedef struct SUPGLOBALINFOPAGE
179{
180 /** Magic (SUPGLOBALINFOPAGE_MAGIC). */
181 uint32_t u32Magic;
182 /** The GIP version. */
183 uint32_t u32Version;
184
185 /** The GIP update mode, see SUPGIPMODE. */
186 uint32_t u32Mode;
187 /** The number of entries in the CPU table.
188 * (This can work as RTMpGetArraySize().) */
189 uint16_t cCpus;
190 /** The size of the GIP in pages. */
191 uint16_t cPages;
192 /** The update frequency of the of the NanoTS. */
193 volatile uint32_t u32UpdateHz;
194 /** The update interval in nanoseconds. (10^9 / u32UpdateHz) */
195 volatile uint32_t u32UpdateIntervalNS;
196 /** The timestamp of the last time we update the update frequency. */
197 volatile uint64_t u64NanoTSLastUpdateHz;
198 /** The set of online CPUs. */
199 RTCPUSET OnlineCpuSet;
200 /** The set of present CPUs. */
201 RTCPUSET PresentCpuSet;
202 /** The set of possible CPUs. */
203 RTCPUSET PossibleCpuSet;
204 /** The number of CPUs that are online. */
205 volatile uint16_t cOnlineCpus;
206 /** The number of CPUs present in the system. */
207 volatile uint16_t cPresentCpus;
208 /** The highest number of CPUs possible. */
209 uint16_t cPossibleCpus;
210 /** The highest number of CPUs possible. */
211 uint16_t u16Padding0;
212 /** The max CPU ID (RTMpGetMaxCpuId). */
213 RTCPUID idCpuMax;
214
215 /** Padding / reserved space for future data. */
216 uint32_t au32Padding1[29];
217
218 /** Table indexed by the CPU APIC ID to get the CPU table index. */
219 uint16_t aiCpuFromApicId[256];
220 /** CPU set index to CPU table index. */
221 uint16_t aiCpuFromCpuSetIdx[RTCPUSET_MAX_CPUS];
222
223 /** Array of per-cpu data.
224 * This is index by ApicId via the aiCpuFromApicId table.
225 *
226 * The clock and frequency information is updated for all CPUs if u32Mode
227 * is SUPGIPMODE_ASYNC_TSC, otherwise (SUPGIPMODE_SYNC_TSC) only the first
228 * entry is updated. */
229 SUPGIPCPU aCPUs[1];
230} SUPGLOBALINFOPAGE;
231AssertCompileMemberAlignment(SUPGLOBALINFOPAGE, u64NanoTSLastUpdateHz, 8);
232#if defined(RT_ARCH_SPARC) || defined(RT_ARCH_SPARC64)
233AssertCompileMemberAlignment(SUPGLOBALINFOPAGE, aCPUs, 32);
234#else
235AssertCompileMemberAlignment(SUPGLOBALINFOPAGE, aCPUs, 256);
236#endif
237
238/** Pointer to the global info page.
239 * @remark there is no const version of this typedef, see g_pSUPGlobalInfoPage for details. */
240typedef SUPGLOBALINFOPAGE *PSUPGLOBALINFOPAGE;
241
242
243/** The value of the SUPGLOBALINFOPAGE::u32Magic field. (Soryo Fuyumi) */
244#define SUPGLOBALINFOPAGE_MAGIC 0x19590106
245/** The GIP version.
246 * Upper 16 bits is the major version. Major version is only changed with
247 * incompatible changes in the GIP. */
248#define SUPGLOBALINFOPAGE_VERSION 0x00030000
249
250/**
251 * SUPGLOBALINFOPAGE::u32Mode values.
252 */
253typedef enum SUPGIPMODE
254{
255 /** The usual invalid null entry. */
256 SUPGIPMODE_INVALID = 0,
257 /** The TSC of the cores and cpus in the system is in sync. */
258 SUPGIPMODE_SYNC_TSC,
259 /** Each core has it's own TSC. */
260 SUPGIPMODE_ASYNC_TSC,
261 /** The usual 32-bit hack. */
262 SUPGIPMODE_32BIT_HACK = 0x7fffffff
263} SUPGIPMODE;
264
265/** Pointer to the Global Information Page.
266 *
267 * This pointer is valid as long as SUPLib has a open session. Anyone using
268 * the page must treat this pointer as highly volatile and not trust it beyond
269 * one transaction.
270 *
271 * @remark The GIP page is read-only to everyone but the support driver and
272 * is actually mapped read only everywhere but in ring-0. However
273 * it is not marked 'const' as this might confuse compilers into
274 * thinking that values doesn't change even if members are marked
275 * as volatile. Thus, there is no PCSUPGLOBALINFOPAGE type.
276 */
277#if defined(IN_SUP_R0) || defined(IN_SUP_R3) || defined(IN_SUP_RC)
278extern DECLEXPORT(PSUPGLOBALINFOPAGE) g_pSUPGlobalInfoPage;
279
280#elif !defined(IN_RING0) || defined(RT_OS_WINDOWS) || defined(RT_OS_SOLARIS)
281extern DECLIMPORT(PSUPGLOBALINFOPAGE) g_pSUPGlobalInfoPage;
282
283#else /* IN_RING0 && !RT_OS_WINDOWS */
284# if !defined(__GNUC__) || defined(RT_OS_DARWIN) || !defined(RT_ARCH_AMD64)
285# define g_pSUPGlobalInfoPage (&g_SUPGlobalInfoPage)
286# else
287# define g_pSUPGlobalInfoPage (SUPGetGIPHlp())
288/** Workaround for ELF+GCC problem on 64-bit hosts.
289 * (GCC emits a mov with a R_X86_64_32 reloc, we need R_X86_64_64.) */
290DECLINLINE(PSUPGLOBALINFOPAGE) SUPGetGIPHlp(void)
291{
292 PSUPGLOBALINFOPAGE pGIP;
293 __asm__ __volatile__ ("movabs $g_SUPGlobalInfoPage,%0\n\t"
294 : "=a" (pGIP));
295 return pGIP;
296}
297# endif
298/** The GIP.
299 * We save a level of indirection by exporting the GIP instead of a variable
300 * pointing to it. */
301extern DECLIMPORT(SUPGLOBALINFOPAGE) g_SUPGlobalInfoPage;
302#endif
303
304/**
305 * Gets the GIP pointer.
306 *
307 * @returns Pointer to the GIP or NULL.
308 */
309SUPDECL(PSUPGLOBALINFOPAGE) SUPGetGIP(void);
310
311#ifdef ___iprt_asm_amd64_x86_h
312/**
313 * Gets the TSC frequency of the calling CPU.
314 *
315 * @returns TSC frequency, UINT64_MAX on failure.
316 * @param pGip The GIP pointer.
317 */
318DECLINLINE(uint64_t) SUPGetCpuHzFromGIP(PSUPGLOBALINFOPAGE pGip)
319{
320 unsigned iCpu;
321
322 if (RT_UNLIKELY(!pGip || pGip->u32Magic != SUPGLOBALINFOPAGE_MAGIC))
323 return UINT64_MAX;
324
325 if (pGip->u32Mode != SUPGIPMODE_ASYNC_TSC)
326 iCpu = 0;
327 else
328 {
329 iCpu = pGip->aiCpuFromApicId[ASMGetApicId()];
330 if (iCpu >= pGip->cCpus)
331 return UINT64_MAX;
332 }
333
334 return pGip->aCPUs[iCpu].u64CpuHz;
335}
336#endif
337
338/**
339 * Request for generic VMMR0Entry calls.
340 */
341typedef struct SUPVMMR0REQHDR
342{
343 /** The magic. (SUPVMMR0REQHDR_MAGIC) */
344 uint32_t u32Magic;
345 /** The size of the request. */
346 uint32_t cbReq;
347} SUPVMMR0REQHDR;
348/** Pointer to a ring-0 request header. */
349typedef SUPVMMR0REQHDR *PSUPVMMR0REQHDR;
350/** the SUPVMMR0REQHDR::u32Magic value (Ethan Iverson - The Bad Plus). */
351#define SUPVMMR0REQHDR_MAGIC UINT32_C(0x19730211)
352
353
354/** For the fast ioctl path.
355 * @{
356 */
357/** @see VMMR0_DO_RAW_RUN. */
358#define SUP_VMMR0_DO_RAW_RUN 0
359/** @see VMMR0_DO_HWACC_RUN. */
360#define SUP_VMMR0_DO_HWACC_RUN 1
361/** @see VMMR0_DO_NOP */
362#define SUP_VMMR0_DO_NOP 2
363/** @} */
364
365/** SUPR3QueryVTCaps capability flags
366 * @{
367 */
368#define SUPVTCAPS_AMD_V RT_BIT(0)
369#define SUPVTCAPS_VT_X RT_BIT(1)
370#define SUPVTCAPS_NESTED_PAGING RT_BIT(2)
371/** @} */
372
373/**
374 * Request for generic FNSUPR0SERVICEREQHANDLER calls.
375 */
376typedef struct SUPR0SERVICEREQHDR
377{
378 /** The magic. (SUPR0SERVICEREQHDR_MAGIC) */
379 uint32_t u32Magic;
380 /** The size of the request. */
381 uint32_t cbReq;
382} SUPR0SERVICEREQHDR;
383/** Pointer to a ring-0 service request header. */
384typedef SUPR0SERVICEREQHDR *PSUPR0SERVICEREQHDR;
385/** the SUPVMMR0REQHDR::u32Magic value (Esbjoern Svensson - E.S.P.). */
386#define SUPR0SERVICEREQHDR_MAGIC UINT32_C(0x19640416)
387
388
389/** Event semaphore handle. Ring-0 / ring-3. */
390typedef R0PTRTYPE(struct SUPSEMEVENTHANDLE *) SUPSEMEVENT;
391/** Pointer to an event semaphore handle. */
392typedef SUPSEMEVENT *PSUPSEMEVENT;
393/** Nil event semaphore handle. */
394#define NIL_SUPSEMEVENT ((SUPSEMEVENT)0)
395
396/**
397 * Creates a single release event semaphore.
398 *
399 * @returns VBox status code.
400 * @param pSession The session handle of the caller.
401 * @param phEvent Where to return the handle to the event semaphore.
402 */
403SUPDECL(int) SUPSemEventCreate(PSUPDRVSESSION pSession, PSUPSEMEVENT phEvent);
404
405/**
406 * Closes a single release event semaphore handle.
407 *
408 * @returns VBox status code.
409 * @retval VINF_OBJECT_DESTROYED if the semaphore was destroyed.
410 * @retval VINF_SUCCESS if the handle was successfully closed but the semaphore
411 * object remained alive because of other references.
412 *
413 * @param pSession The session handle of the caller.
414 * @param hEvent The handle. Nil is quietly ignored.
415 */
416SUPDECL(int) SUPSemEventClose(PSUPDRVSESSION pSession, SUPSEMEVENT hEvent);
417
418/**
419 * Signals a single release event semaphore.
420 *
421 * @returns VBox status code.
422 * @param pSession The session handle of the caller.
423 * @param hEvent The semaphore handle.
424 */
425SUPDECL(int) SUPSemEventSignal(PSUPDRVSESSION pSession, SUPSEMEVENT hEvent);
426
427#ifdef IN_RING0
428/**
429 * Waits on a single release event semaphore, not interruptible.
430 *
431 * @returns VBox status code.
432 * @param pSession The session handle of the caller.
433 * @param hEvent The semaphore handle.
434 * @param cMillies The number of milliseconds to wait.
435 * @remarks Not available in ring-3.
436 */
437SUPDECL(int) SUPSemEventWait(PSUPDRVSESSION pSession, SUPSEMEVENT hEvent, uint32_t cMillies);
438#endif
439
440/**
441 * Waits on a single release event semaphore, interruptible.
442 *
443 * @returns VBox status code.
444 * @param pSession The session handle of the caller.
445 * @param hEvent The semaphore handle.
446 * @param cMillies The number of milliseconds to wait.
447 */
448SUPDECL(int) SUPSemEventWaitNoResume(PSUPDRVSESSION pSession, SUPSEMEVENT hEvent, uint32_t cMillies);
449
450/**
451 * Waits on a single release event semaphore, interruptible.
452 *
453 * @returns VBox status code.
454 * @param pSession The session handle of the caller.
455 * @param hEvent The semaphore handle.
456 * @param uNsTimeout The deadline given on the RTTimeNanoTS() clock.
457 */
458SUPDECL(int) SUPSemEventWaitNsAbsIntr(PSUPDRVSESSION pSession, SUPSEMEVENT hEvent, uint64_t uNsTimeout);
459
460/**
461 * Waits on a single release event semaphore, interruptible.
462 *
463 * @returns VBox status code.
464 * @param pSession The session handle of the caller.
465 * @param hEvent The semaphore handle.
466 * @param cNsTimeout The number of nanoseconds to wait.
467 */
468SUPDECL(int) SUPSemEventWaitNsRelIntr(PSUPDRVSESSION pSession, SUPSEMEVENT hEvent, uint64_t cNsTimeout);
469
470/**
471 * Gets the best timeout resolution that SUPSemEventWaitNsAbsIntr and
472 * SUPSemEventWaitNsAbsIntr can do.
473 *
474 * @returns The resolution in nanoseconds.
475 * @param pSession The session handle of the caller.
476 */
477SUPDECL(uint32_t) SUPSemEventGetResolution(PSUPDRVSESSION pSession);
478
479
480/** Multiple release event semaphore handle. Ring-0 / ring-3. */
481typedef R0PTRTYPE(struct SUPSEMEVENTMULTIHANDLE *) SUPSEMEVENTMULTI;
482/** Pointer to an multiple release event semaphore handle. */
483typedef SUPSEMEVENTMULTI *PSUPSEMEVENTMULTI;
484/** Nil multiple release event semaphore handle. */
485#define NIL_SUPSEMEVENTMULTI ((SUPSEMEVENTMULTI)0)
486
487/**
488 * Creates a multiple release event semaphore.
489 *
490 * @returns VBox status code.
491 * @param pSession The session handle of the caller.
492 * @param phEventMulti Where to return the handle to the event semaphore.
493 */
494SUPDECL(int) SUPSemEventMultiCreate(PSUPDRVSESSION pSession, PSUPSEMEVENTMULTI phEventMulti);
495
496/**
497 * Closes a multiple release event semaphore handle.
498 *
499 * @returns VBox status code.
500 * @retval VINF_OBJECT_DESTROYED if the semaphore was destroyed.
501 * @retval VINF_SUCCESS if the handle was successfully closed but the semaphore
502 * object remained alive because of other references.
503 *
504 * @param pSession The session handle of the caller.
505 * @param hEventMulti The handle. Nil is quietly ignored.
506 */
507SUPDECL(int) SUPSemEventMultiClose(PSUPDRVSESSION pSession, SUPSEMEVENTMULTI hEventMulti);
508
509/**
510 * Signals a multiple release event semaphore.
511 *
512 * @returns VBox status code.
513 * @param pSession The session handle of the caller.
514 * @param hEventMulti The semaphore handle.
515 */
516SUPDECL(int) SUPSemEventMultiSignal(PSUPDRVSESSION pSession, SUPSEMEVENTMULTI hEventMulti);
517
518/**
519 * Resets a multiple release event semaphore.
520 *
521 * @returns VBox status code.
522 * @param pSession The session handle of the caller.
523 * @param hEventMulti The semaphore handle.
524 */
525SUPDECL(int) SUPSemEventMultiReset(PSUPDRVSESSION pSession, SUPSEMEVENTMULTI hEventMulti);
526
527#ifdef IN_RING0
528/**
529 * Waits on a multiple release event semaphore, not interruptible.
530 *
531 * @returns VBox status code.
532 * @param pSession The session handle of the caller.
533 * @param hEventMulti The semaphore handle.
534 * @param cMillies The number of milliseconds to wait.
535 * @remarks Not available in ring-3.
536 */
537SUPDECL(int) SUPSemEventMultiWait(PSUPDRVSESSION pSession, SUPSEMEVENTMULTI hEventMulti, uint32_t cMillies);
538#endif
539
540/**
541 * Waits on a multiple release event semaphore, interruptible.
542 *
543 * @returns VBox status code.
544 * @param pSession The session handle of the caller.
545 * @param hEventMulti The semaphore handle.
546 * @param cMillies The number of milliseconds to wait.
547 */
548SUPDECL(int) SUPSemEventMultiWaitNoResume(PSUPDRVSESSION pSession, SUPSEMEVENTMULTI hEventMulti, uint32_t cMillies);
549
550/**
551 * Waits on a multiple release event semaphore, interruptible.
552 *
553 * @returns VBox status code.
554 * @param pSession The session handle of the caller.
555 * @param hEventMulti The semaphore handle.
556 * @param uNsTimeout The deadline given on the RTTimeNanoTS() clock.
557 */
558SUPDECL(int) SUPSemEventMultiWaitNsAbsIntr(PSUPDRVSESSION pSession, SUPSEMEVENTMULTI hEventMulti, uint64_t uNsTimeout);
559
560/**
561 * Waits on a multiple release event semaphore, interruptible.
562 *
563 * @returns VBox status code.
564 * @param pSession The session handle of the caller.
565 * @param hEventMulti The semaphore handle.
566 * @param cNsTimeout The number of nanoseconds to wait.
567 */
568SUPDECL(int) SUPSemEventMultiWaitNsRelIntr(PSUPDRVSESSION pSession, SUPSEMEVENTMULTI hEventMulti, uint64_t cNsTimeout);
569
570/**
571 * Gets the best timeout resolution that SUPSemEventMultiWaitNsAbsIntr and
572 * SUPSemEventMultiWaitNsRelIntr can do.
573 *
574 * @returns The resolution in nanoseconds.
575 * @param pSession The session handle of the caller.
576 */
577SUPDECL(uint32_t) SUPSemEventMultiGetResolution(PSUPDRVSESSION pSession);
578
579
580#ifdef IN_RING3
581
582/** @defgroup grp_sup_r3 SUP Host Context Ring-3 API
583 * @ingroup grp_sup
584 * @{
585 */
586
587/**
588 * Installs the support library.
589 *
590 * @returns VBox status code.
591 */
592SUPR3DECL(int) SUPR3Install(void);
593
594/**
595 * Uninstalls the support library.
596 *
597 * @returns VBox status code.
598 */
599SUPR3DECL(int) SUPR3Uninstall(void);
600
601/**
602 * Trusted main entry point.
603 *
604 * This is exported as "TrustedMain" by the dynamic libraries which contains the
605 * "real" application binary for which the hardened stub is built. The entry
606 * point is invoked upon successful initialization of the support library and
607 * runtime.
608 *
609 * @returns main kind of exit code.
610 * @param argc The argument count.
611 * @param argv The argument vector.
612 * @param envp The environment vector.
613 */
614typedef DECLCALLBACK(int) FNSUPTRUSTEDMAIN(int argc, char **argv, char **envp);
615/** Pointer to FNSUPTRUSTEDMAIN(). */
616typedef FNSUPTRUSTEDMAIN *PFNSUPTRUSTEDMAIN;
617
618/** Which operation failed. */
619typedef enum SUPINITOP
620{
621 /** Invalid. */
622 kSupInitOp_Invalid = 0,
623 /** Installation integrity error. */
624 kSupInitOp_Integrity,
625 /** Setuid related. */
626 kSupInitOp_RootCheck,
627 /** Driver related. */
628 kSupInitOp_Driver,
629 /** IPRT init related. */
630 kSupInitOp_IPRT,
631 /** Place holder. */
632 kSupInitOp_End
633} SUPINITOP;
634
635/**
636 * Trusted error entry point, optional.
637 *
638 * This is exported as "TrustedError" by the dynamic libraries which contains
639 * the "real" application binary for which the hardened stub is built.
640 *
641 * @param pszWhere Where the error occurred (function name).
642 * @param enmWhat Which operation went wrong.
643 * @param rc The status code.
644 * @param pszMsgFmt Error message format string.
645 * @param va The message format arguments.
646 */
647typedef DECLCALLBACK(void) FNSUPTRUSTEDERROR(const char *pszWhere, SUPINITOP enmWhat, int rc, const char *pszMsgFmt, va_list va);
648/** Pointer to FNSUPTRUSTEDERROR. */
649typedef FNSUPTRUSTEDERROR *PFNSUPTRUSTEDERROR;
650
651/**
652 * Secure main.
653 *
654 * This is used for the set-user-ID-on-execute binaries on unixy systems
655 * and when using the open-vboxdrv-via-root-service setup on Windows.
656 *
657 * This function will perform the integrity checks of the VirtualBox
658 * installation, open the support driver, open the root service (later),
659 * and load the DLL corresponding to \a pszProgName and execute its main
660 * function.
661 *
662 * @returns Return code appropriate for main().
663 *
664 * @param pszProgName The program name. This will be used to figure out which
665 * DLL/SO/DYLIB to load and execute.
666 * @param fFlags Flags.
667 * @param argc The argument count.
668 * @param argv The argument vector.
669 * @param envp The environment vector.
670 */
671DECLHIDDEN(int) SUPR3HardenedMain(const char *pszProgName, uint32_t fFlags, int argc, char **argv, char **envp);
672
673/** @name SUPR3SecureMain flags.
674 * @{ */
675/** Don't open the device. (Intended for VirtualBox without -startvm.) */
676#define SUPSECMAIN_FLAGS_DONT_OPEN_DEV RT_BIT_32(0)
677/** @} */
678
679/**
680 * Initializes the support library.
681 * Each successful call to SUPR3Init() must be countered by a
682 * call to SUPR3Term(false).
683 *
684 * @returns VBox status code.
685 * @param ppSession Where to store the session handle. Defaults to NULL.
686 */
687SUPR3DECL(int) SUPR3Init(PSUPDRVSESSION *ppSession);
688
689/**
690 * Terminates the support library.
691 *
692 * @returns VBox status code.
693 * @param fForced Forced termination. This means to ignore the
694 * init call count and just terminated.
695 */
696#ifdef __cplusplus
697SUPR3DECL(int) SUPR3Term(bool fForced = false);
698#else
699SUPR3DECL(int) SUPR3Term(int fForced);
700#endif
701
702/**
703 * Sets the ring-0 VM handle for use with fast IOCtls.
704 *
705 * @returns VBox status code.
706 * @param pVMR0 The ring-0 VM handle.
707 * NIL_RTR0PTR can be used to unset the handle when the
708 * VM is about to be destroyed.
709 */
710SUPR3DECL(int) SUPR3SetVMForFastIOCtl(PVMR0 pVMR0);
711
712/**
713 * Calls the HC R0 VMM entry point.
714 * See VMMR0Entry() for more details.
715 *
716 * @returns error code specific to uFunction.
717 * @param pVMR0 Pointer to the Ring-0 (Host Context) mapping of the VM structure.
718 * @param idCpu The virtual CPU ID.
719 * @param uOperation Operation to execute.
720 * @param pvArg Argument.
721 */
722SUPR3DECL(int) SUPR3CallVMMR0(PVMR0 pVMR0, VMCPUID idCpu, unsigned uOperation, void *pvArg);
723
724/**
725 * Variant of SUPR3CallVMMR0, except that this takes the fast ioclt path
726 * regardsless of compile-time defaults.
727 *
728 * @returns VBox status code.
729 * @param pVMR0 The ring-0 VM handle.
730 * @param uOperation The operation; only the SUP_VMMR0_DO_* ones are valid.
731 * @param idCpu The virtual CPU ID.
732 */
733SUPR3DECL(int) SUPR3CallVMMR0Fast(PVMR0 pVMR0, unsigned uOperation, VMCPUID idCpu);
734
735/**
736 * Calls the HC R0 VMM entry point, in a safer but slower manner than
737 * SUPR3CallVMMR0. When entering using this call the R0 components can call
738 * into the host kernel (i.e. use the SUPR0 and RT APIs).
739 *
740 * See VMMR0Entry() for more details.
741 *
742 * @returns error code specific to uFunction.
743 * @param pVMR0 Pointer to the Ring-0 (Host Context) mapping of the VM structure.
744 * @param idCpu The virtual CPU ID.
745 * @param uOperation Operation to execute.
746 * @param u64Arg Constant argument.
747 * @param pReqHdr Pointer to a request header. Optional.
748 * This will be copied in and out of kernel space. There currently is a size
749 * limit on this, just below 4KB.
750 */
751SUPR3DECL(int) SUPR3CallVMMR0Ex(PVMR0 pVMR0, VMCPUID idCpu, unsigned uOperation, uint64_t u64Arg, PSUPVMMR0REQHDR pReqHdr);
752
753/**
754 * Calls a ring-0 service.
755 *
756 * The operation and the request packet is specific to the service.
757 *
758 * @returns error code specific to uFunction.
759 * @param pszService The service name.
760 * @param cchService The length of the service name.
761 * @param uReq The request number.
762 * @param u64Arg Constant argument.
763 * @param pReqHdr Pointer to a request header. Optional.
764 * This will be copied in and out of kernel space. There currently is a size
765 * limit on this, just below 4KB.
766 */
767SUPR3DECL(int) SUPR3CallR0Service(const char *pszService, size_t cchService, uint32_t uOperation, uint64_t u64Arg, PSUPR0SERVICEREQHDR pReqHdr);
768
769/** Which logger. */
770typedef enum SUPLOGGER
771{
772 SUPLOGGER_DEBUG = 1,
773 SUPLOGGER_RELEASE
774} SUPLOGGER;
775
776/**
777 * Changes the settings of the specified ring-0 logger.
778 *
779 * @returns VBox status code.
780 * @param enmWhich Which logger.
781 * @param pszFlags The flags settings.
782 * @param pszGroups The groups settings.
783 * @param pszDest The destination specificier.
784 */
785SUPR3DECL(int) SUPR3LoggerSettings(SUPLOGGER enmWhich, const char *pszFlags, const char *pszGroups, const char *pszDest);
786
787/**
788 * Creates a ring-0 logger instance.
789 *
790 * @returns VBox status code.
791 * @param enmWhich Which logger to create.
792 * @param pszFlags The flags settings.
793 * @param pszGroups The groups settings.
794 * @param pszDest The destination specificier.
795 */
796SUPR3DECL(int) SUPR3LoggerCreate(SUPLOGGER enmWhich, const char *pszFlags, const char *pszGroups, const char *pszDest);
797
798/**
799 * Destroys a ring-0 logger instance.
800 *
801 * @returns VBox status code.
802 * @param enmWhich Which logger.
803 */
804SUPR3DECL(int) SUPR3LoggerDestroy(SUPLOGGER enmWhich);
805
806/**
807 * Queries the paging mode of the host OS.
808 *
809 * @returns The paging mode.
810 */
811SUPR3DECL(SUPPAGINGMODE) SUPR3GetPagingMode(void);
812
813/**
814 * Allocate zero-filled pages.
815 *
816 * Use this to allocate a number of pages suitable for seeding / locking.
817 * Call SUPR3PageFree() to free the pages once done with them.
818 *
819 * @returns VBox status.
820 * @param cPages Number of pages to allocate.
821 * @param ppvPages Where to store the base pointer to the allocated pages.
822 */
823SUPR3DECL(int) SUPR3PageAlloc(size_t cPages, void **ppvPages);
824
825/**
826 * Frees pages allocated with SUPR3PageAlloc().
827 *
828 * @returns VBox status.
829 * @param pvPages Pointer returned by SUPR3PageAlloc().
830 * @param cPages Number of pages that was allocated.
831 */
832SUPR3DECL(int) SUPR3PageFree(void *pvPages, size_t cPages);
833
834/**
835 * Allocate non-zeroed, locked, pages with user and, optionally, kernel
836 * mappings.
837 *
838 * Use SUPR3PageFreeEx() to free memory allocated with this function.
839 *
840 * @returns VBox status code.
841 * @param cPages The number of pages to allocate.
842 * @param fFlags Flags, reserved. Must be zero.
843 * @param ppvPages Where to store the address of the user mapping.
844 * @param pR0Ptr Where to store the address of the kernel mapping.
845 * NULL if no kernel mapping is desired.
846 * @param paPages Where to store the physical addresses of each page.
847 * Optional.
848 */
849SUPR3DECL(int) SUPR3PageAllocEx(size_t cPages, uint32_t fFlags, void **ppvPages, PRTR0PTR pR0Ptr, PSUPPAGE paPages);
850
851/**
852 * Maps a portion of a ring-3 only allocation into kernel space.
853 *
854 * @returns VBox status code.
855 *
856 * @param pvR3 The address SUPR3PageAllocEx return.
857 * @param off Offset to start mapping at. Must be page aligned.
858 * @param cb Number of bytes to map. Must be page aligned.
859 * @param fFlags Flags, must be zero.
860 * @param pR0Ptr Where to store the address on success.
861 *
862 */
863SUPR3DECL(int) SUPR3PageMapKernel(void *pvR3, uint32_t off, uint32_t cb, uint32_t fFlags, PRTR0PTR pR0Ptr);
864
865/**
866 * Changes the protection of
867 *
868 * @returns VBox status code.
869 * @retval VERR_NOT_SUPPORTED if the OS doesn't allow us to change page level
870 * protection. See also RTR0MemObjProtect.
871 *
872 * @param pvR3 The ring-3 address SUPR3PageAllocEx returned.
873 * @param R0Ptr The ring-0 address SUPR3PageAllocEx returned if it
874 * is desired that the corresponding ring-0 page
875 * mappings should change protection as well. Pass
876 * NIL_RTR0PTR if the ring-0 pages should remain
877 * unaffected.
878 * @param off Offset to start at which to start chagning the page
879 * level protection. Must be page aligned.
880 * @param cb Number of bytes to change. Must be page aligned.
881 * @param fProt The new page level protection, either a combination
882 * of RTMEM_PROT_READ, RTMEM_PROT_WRITE and
883 * RTMEM_PROT_EXEC, or just RTMEM_PROT_NONE.
884 */
885SUPR3DECL(int) SUPR3PageProtect(void *pvR3, RTR0PTR R0Ptr, uint32_t off, uint32_t cb, uint32_t fProt);
886
887/**
888 * Free pages allocated by SUPR3PageAllocEx.
889 *
890 * @returns VBox status code.
891 * @param pvPages The address of the user mapping.
892 * @param cPages The number of pages.
893 */
894SUPR3DECL(int) SUPR3PageFreeEx(void *pvPages, size_t cPages);
895
896/**
897 * Allocated memory with page aligned memory with a contiguous and locked physical
898 * memory backing below 4GB.
899 *
900 * @returns Pointer to the allocated memory (virtual address).
901 * *pHCPhys is set to the physical address of the memory.
902 * If ppvR0 isn't NULL, *ppvR0 is set to the ring-0 mapping.
903 * The returned memory must be freed using SUPR3ContFree().
904 * @returns NULL on failure.
905 * @param cPages Number of pages to allocate.
906 * @param pR0Ptr Where to store the ring-0 mapping of the allocation. (optional)
907 * @param pHCPhys Where to store the physical address of the memory block.
908 *
909 * @remark This 2nd version of this API exists because we're not able to map the
910 * ring-3 mapping executable on WIN64. This is a serious problem in regard to
911 * the world switchers.
912 */
913SUPR3DECL(void *) SUPR3ContAlloc(size_t cPages, PRTR0PTR pR0Ptr, PRTHCPHYS pHCPhys);
914
915/**
916 * Frees memory allocated with SUPR3ContAlloc().
917 *
918 * @returns VBox status code.
919 * @param pv Pointer to the memory block which should be freed.
920 * @param cPages Number of pages to be freed.
921 */
922SUPR3DECL(int) SUPR3ContFree(void *pv, size_t cPages);
923
924/**
925 * Allocated non contiguous physical memory below 4GB.
926 *
927 * The memory isn't zeroed.
928 *
929 * @returns VBox status code.
930 * @returns NULL on failure.
931 * @param cPages Number of pages to allocate.
932 * @param ppvPages Where to store the pointer to the allocated memory.
933 * The pointer stored here on success must be passed to
934 * SUPR3LowFree when the memory should be released.
935 * @param ppvPagesR0 Where to store the ring-0 pointer to the allocated memory. optional.
936 * @param paPages Where to store the physical addresses of the individual pages.
937 */
938SUPR3DECL(int) SUPR3LowAlloc(size_t cPages, void **ppvPages, PRTR0PTR ppvPagesR0, PSUPPAGE paPages);
939
940/**
941 * Frees memory allocated with SUPR3LowAlloc().
942 *
943 * @returns VBox status code.
944 * @param pv Pointer to the memory block which should be freed.
945 * @param cPages Number of pages that was allocated.
946 */
947SUPR3DECL(int) SUPR3LowFree(void *pv, size_t cPages);
948
949/**
950 * Load a module into R0 HC.
951 *
952 * This will verify the file integrity in a similar manner as
953 * SUPR3HardenedVerifyFile before loading it.
954 *
955 * @returns VBox status code.
956 * @param pszFilename The path to the image file.
957 * @param pszModule The module name. Max 32 bytes.
958 * @param ppvImageBase Where to store the image address.
959 * @param pErrInfo Where to return extended error information.
960 * Optional.
961 */
962SUPR3DECL(int) SUPR3LoadModule(const char *pszFilename, const char *pszModule, void **ppvImageBase, PRTERRINFO pErrInfo);
963
964/**
965 * Load a module into R0 HC.
966 *
967 * This will verify the file integrity in a similar manner as
968 * SUPR3HardenedVerifyFile before loading it.
969 *
970 * @returns VBox status code.
971 * @param pszFilename The path to the image file.
972 * @param pszModule The module name. Max 32 bytes.
973 * @param pszSrvReqHandler The name of the service request handler entry
974 * point. See FNSUPR0SERVICEREQHANDLER.
975 * @param ppvImageBase Where to store the image address.
976 */
977SUPR3DECL(int) SUPR3LoadServiceModule(const char *pszFilename, const char *pszModule,
978 const char *pszSrvReqHandler, void **ppvImageBase);
979
980/**
981 * Frees a R0 HC module.
982 *
983 * @returns VBox status code.
984 * @param pszModule The module to free.
985 * @remark This will not actually 'free' the module, there are of course usage counting.
986 */
987SUPR3DECL(int) SUPR3FreeModule(void *pvImageBase);
988
989/**
990 * Get the address of a symbol in a ring-0 module.
991 *
992 * @returns VBox status code.
993 * @param pszModule The module name.
994 * @param pszSymbol Symbol name. If it's value is less than 64k it's treated like a
995 * ordinal value rather than a string pointer.
996 * @param ppvValue Where to store the symbol value.
997 */
998SUPR3DECL(int) SUPR3GetSymbolR0(void *pvImageBase, const char *pszSymbol, void **ppvValue);
999
1000/**
1001 * Load R0 HC VMM code.
1002 *
1003 * @returns VBox status code.
1004 * @deprecated Use SUPR3LoadModule(pszFilename, "VMMR0.r0", &pvImageBase)
1005 */
1006SUPR3DECL(int) SUPR3LoadVMM(const char *pszFilename);
1007
1008/**
1009 * Unloads R0 HC VMM code.
1010 *
1011 * @returns VBox status code.
1012 * @deprecated Use SUPR3FreeModule().
1013 */
1014SUPR3DECL(int) SUPR3UnloadVMM(void);
1015
1016/**
1017 * Get the physical address of the GIP.
1018 *
1019 * @returns VBox status code.
1020 * @param pHCPhys Where to store the physical address of the GIP.
1021 */
1022SUPR3DECL(int) SUPR3GipGetPhys(PRTHCPHYS pHCPhys);
1023
1024/**
1025 * Verifies the integrity of a file, and optionally opens it.
1026 *
1027 * The integrity check is for whether the file is suitable for loading into
1028 * the hypervisor or VM process. The integrity check may include verifying
1029 * the authenticode/elfsign/whatever signature of the file, which can take
1030 * a little while.
1031 *
1032 * @returns VBox status code. On failure it will have printed a LogRel message.
1033 *
1034 * @param pszFilename The file.
1035 * @param pszWhat For the LogRel on failure.
1036 * @param phFile Where to store the handle to the opened file. This is optional, pass NULL
1037 * if the file should not be opened.
1038 * @deprecated Write a new one.
1039 */
1040SUPR3DECL(int) SUPR3HardenedVerifyFile(const char *pszFilename, const char *pszWhat, PRTFILE phFile);
1041
1042/**
1043 * Verifies the integrity of a the current process, including the image
1044 * location and that the invocation was absolute.
1045 *
1046 * This must currently be called after initializing the runtime. The intended
1047 * audience is set-uid-to-root applications, root services and similar.
1048 *
1049 * @returns VBox status code. On failure
1050 * message.
1051 * @param pszArgv0 The first argument to main().
1052 * @param fInternal Set this to @c true if this is an internal
1053 * VirtualBox application. Otherwise pass @c false.
1054 * @param pErrInfo Where to return extended error information.
1055 */
1056SUPR3DECL(int) SUPR3HardenedVerifySelf(const char *pszArgv0, bool fInternal, PRTERRINFO pErrInfo);
1057
1058/**
1059 * Verifies the integrity of an installation directory.
1060 *
1061 * The integrity check verifies that the directory cannot be tampered with by
1062 * normal users on the system. On Unix this translates to root ownership and
1063 * no symbolic linking.
1064 *
1065 * @returns VBox status code. On failure a message will be stored in @a pszErr.
1066 *
1067 * @param pszDirPath The directory path.
1068 * @param fRecursive Whether the check should be recursive or
1069 * not. When set, all sub-directores will be checked,
1070 * including files (@a fCheckFiles is ignored).
1071 * @param fCheckFiles Whether to apply the same basic integrity check to
1072 * the files in the directory as the directory itself.
1073 * @param pErrInfo Where to return extended error information.
1074 * Optional.
1075 */
1076SUPR3DECL(int) SUPR3HardenedVerifyDir(const char *pszDirPath, bool fRecursive, bool fCheckFiles, PRTERRINFO pErrInfo);
1077
1078/**
1079 * Verifies the integrity of a plug-in module.
1080 *
1081 * This is similar to SUPR3HardenedLdrLoad, except it does not load the module
1082 * and that the module does not have to be shipped with VirtualBox.
1083 *
1084 * @returns VBox status code. On failure a message will be stored in @a pszErr.
1085 *
1086 * @param pszFilename The filename of the plug-in module (nothing can be
1087 * omitted here).
1088 * @param pErrInfo Where to return extended error information.
1089 * Optional.
1090 */
1091SUPR3DECL(int) SUPR3HardenedVerifyPlugIn(const char *pszFilename, PRTERRINFO pErrInfo);
1092
1093/**
1094 * Same as RTLdrLoad() but will verify the files it loads (hardened builds).
1095 *
1096 * Will add dll suffix if missing and try load the file.
1097 *
1098 * @returns iprt status code.
1099 * @param pszFilename Image filename. This must have a path.
1100 * @param phLdrMod Where to store the handle to the loaded module.
1101 * @param fFlags See RTLDRLOAD_FLAGS_XXX.
1102 * @param pErrInfo Where to return extended error information.
1103 * Optional.
1104 */
1105SUPR3DECL(int) SUPR3HardenedLdrLoad(const char *pszFilename, PRTLDRMOD phLdrMod, uint32_t fFlags, PRTERRINFO pErrInfo);
1106
1107/**
1108 * Same as RTLdrLoadAppPriv() but it will verify the files it loads (hardened
1109 * builds).
1110 *
1111 * Will add dll suffix to the file if missing, then look for it in the
1112 * architecture dependent application directory.
1113 *
1114 * @returns iprt status code.
1115 * @param pszFilename Image filename.
1116 * @param phLdrMod Where to store the handle to the loaded module.
1117 * @param fFlags See RTLDRLOAD_FLAGS_XXX.
1118 * @param pErrInfo Where to return extended error information.
1119 * Optional.
1120 */
1121SUPR3DECL(int) SUPR3HardenedLdrLoadAppPriv(const char *pszFilename, PRTLDRMOD phLdrMod, uint32_t fFlags, PRTERRINFO pErrInfo);
1122
1123/**
1124 * Same as RTLdrLoad() but will verify the files it loads (hardened builds).
1125 *
1126 * This differs from SUPR3HardenedLdrLoad() in that it can load modules from
1127 * extension packs and anything else safely installed on the system, provided
1128 * they pass the hardening tests.
1129 *
1130 * @returns iprt status code.
1131 * @param pszFilename The full path to the module, with extension.
1132 * @param phLdrMod Where to store the handle to the loaded module.
1133 * @param pErrInfo Where to return extended error information.
1134 * Optional.
1135 */
1136SUPR3DECL(int) SUPR3HardenedLdrLoadPlugIn(const char *pszFilename, PRTLDRMOD phLdrMod, PRTERRINFO pErrInfo);
1137
1138/**
1139 * Check if the host kernel can run in VMX root mode.
1140 *
1141 * @returns VINF_SUCCESS if supported, error code indicating why if not.
1142 */
1143SUPR3DECL(int) SUPR3QueryVTxSupported(void);
1144
1145/**
1146 * Return VT-x/AMD-V capabilities.
1147 *
1148 * @returns VINF_SUCCESS if supported, error code indicating why if not.
1149 * @param pfCaps Pointer to capability dword (out).
1150 * @todo Intended for main, which means we need to relax the privilege requires
1151 * when accessing certain vboxdrv functions.
1152 */
1153SUPR3DECL(int) SUPR3QueryVTCaps(uint32_t *pfCaps);
1154
1155/**
1156 * Open the tracer.
1157 *
1158 * @returns VBox status code.
1159 * @param uCookie Cookie identifying the tracer we expect to talk to.
1160 * @param uArg Tracer specific open argument.
1161 */
1162SUPR3DECL(int) SUPR3TracerOpen(uint32_t uCookie, uintptr_t uArg);
1163
1164/**
1165 * Closes the tracer.
1166 *
1167 * @returns VBox status code.
1168 */
1169SUPR3DECL(int) SUPR3TracerClose(void);
1170
1171/**
1172 * Perform an I/O request on the tracer.
1173 *
1174 * @returns VBox status.
1175 * @param uCmd The tracer command.
1176 * @param uArg The argument.
1177 * @param piRetVal Where to store the tracer return value.
1178 */
1179SUPR3DECL(int) SUPR3TracerIoCtl(uintptr_t uCmd, uintptr_t uArg, int32_t *piRetVal);
1180
1181/**
1182 * Registers the user module with the tracer.
1183 *
1184 * @returns VBox status code.
1185 * @param hModNative Native module handle. Pass ~(uintptr_t)0 if not
1186 * at hand.
1187 * @param pszModule The module name.
1188 * @param pVtgHdr The VTG header.
1189 * @param fFlags See SUP_TRACER_UMOD_FLAGS_XXX
1190 */
1191SUPR3DECL(int) SUPR3TracerRegisterModule(uintptr_t hModNative, const char *pszModule, struct VTGOBJHDR *pVtgHdr, uint32_t fFlags);
1192
1193/**
1194 * Deregisters the user module.
1195 *
1196 * @returns VBox status code.
1197 * @param pVtgHdr The VTG header.
1198 */
1199SUPR3DECL(int) SUPR3TracerDeregisterModule(struct VTGOBJHDR *pVtgHdr);
1200
1201/**
1202 * Fire the probe.
1203 *
1204 * @param pVtgProbeLoc The probe location record.
1205 * @param uArg0 Raw probe argument 0.
1206 * @param uArg1 Raw probe argument 1.
1207 * @param uArg2 Raw probe argument 2.
1208 * @param uArg3 Raw probe argument 3.
1209 * @param uArg4 Raw probe argument 4.
1210 */
1211SUPDECL(void) SUPTracerFireProbe(struct VTGPROBELOC *pVtgProbeLoc, uintptr_t uArg0, uintptr_t uArg1, uintptr_t uArg2,
1212 uintptr_t uArg3, uintptr_t uArg4);
1213/** @} */
1214#endif /* IN_RING3 */
1215
1216/** @name User mode module flags (SUPR3TracerRegisterModule & SUP_IOCTL_TRACER_UMOD_REG).
1217 * @{ */
1218/** Executable image. */
1219#define SUP_TRACER_UMOD_FLAGS_EXE UINT32_C(1)
1220/** Shared library (DLL, DYLIB, SO, etc). */
1221#define SUP_TRACER_UMOD_FLAGS_SHARED UINT32_C(2)
1222/** Image type mask. */
1223#define SUP_TRACER_UMOD_FLAGS_TYPE_MASK UINT32_C(3)
1224/** @} */
1225
1226
1227#ifdef IN_RING0
1228/** @defgroup grp_sup_r0 SUP Host Context Ring-0 API
1229 * @ingroup grp_sup
1230 * @{
1231 */
1232
1233/**
1234 * Security objectype.
1235 */
1236typedef enum SUPDRVOBJTYPE
1237{
1238 /** The usual invalid object. */
1239 SUPDRVOBJTYPE_INVALID = 0,
1240 /** A Virtual Machine instance. */
1241 SUPDRVOBJTYPE_VM,
1242 /** Internal network. */
1243 SUPDRVOBJTYPE_INTERNAL_NETWORK,
1244 /** Internal network interface. */
1245 SUPDRVOBJTYPE_INTERNAL_NETWORK_INTERFACE,
1246 /** Single release event semaphore. */
1247 SUPDRVOBJTYPE_SEM_EVENT,
1248 /** Multiple release event semaphore. */
1249 SUPDRVOBJTYPE_SEM_EVENT_MULTI,
1250 /** Raw PCI device. */
1251 SUPDRVOBJTYPE_RAW_PCI_DEVICE,
1252 /** The first invalid object type in this end. */
1253 SUPDRVOBJTYPE_END,
1254 /** The usual 32-bit type size hack. */
1255 SUPDRVOBJTYPE_32_BIT_HACK = 0x7ffffff
1256} SUPDRVOBJTYPE;
1257
1258/**
1259 * Object destructor callback.
1260 * This is called for reference counted objectes when the count reaches 0.
1261 *
1262 * @param pvObj The object pointer.
1263 * @param pvUser1 The first user argument.
1264 * @param pvUser2 The second user argument.
1265 */
1266typedef DECLCALLBACK(void) FNSUPDRVDESTRUCTOR(void *pvObj, void *pvUser1, void *pvUser2);
1267/** Pointer to a FNSUPDRVDESTRUCTOR(). */
1268typedef FNSUPDRVDESTRUCTOR *PFNSUPDRVDESTRUCTOR;
1269
1270SUPR0DECL(void *) SUPR0ObjRegister(PSUPDRVSESSION pSession, SUPDRVOBJTYPE enmType, PFNSUPDRVDESTRUCTOR pfnDestructor, void *pvUser1, void *pvUser2);
1271SUPR0DECL(int) SUPR0ObjAddRef(void *pvObj, PSUPDRVSESSION pSession);
1272SUPR0DECL(int) SUPR0ObjAddRefEx(void *pvObj, PSUPDRVSESSION pSession, bool fNoBlocking);
1273SUPR0DECL(int) SUPR0ObjRelease(void *pvObj, PSUPDRVSESSION pSession);
1274SUPR0DECL(int) SUPR0ObjVerifyAccess(void *pvObj, PSUPDRVSESSION pSession, const char *pszObjName);
1275
1276SUPR0DECL(int) SUPR0LockMem(PSUPDRVSESSION pSession, RTR3PTR pvR3, uint32_t cPages, PRTHCPHYS paPages);
1277SUPR0DECL(int) SUPR0UnlockMem(PSUPDRVSESSION pSession, RTR3PTR pvR3);
1278SUPR0DECL(int) SUPR0ContAlloc(PSUPDRVSESSION pSession, uint32_t cPages, PRTR0PTR ppvR0, PRTR3PTR ppvR3, PRTHCPHYS pHCPhys);
1279SUPR0DECL(int) SUPR0ContFree(PSUPDRVSESSION pSession, RTHCUINTPTR uPtr);
1280SUPR0DECL(int) SUPR0LowAlloc(PSUPDRVSESSION pSession, uint32_t cPages, PRTR0PTR ppvR0, PRTR3PTR ppvR3, PRTHCPHYS paPages);
1281SUPR0DECL(int) SUPR0LowFree(PSUPDRVSESSION pSession, RTHCUINTPTR uPtr);
1282SUPR0DECL(int) SUPR0MemAlloc(PSUPDRVSESSION pSession, uint32_t cb, PRTR0PTR ppvR0, PRTR3PTR ppvR3);
1283SUPR0DECL(int) SUPR0MemGetPhys(PSUPDRVSESSION pSession, RTHCUINTPTR uPtr, PSUPPAGE paPages);
1284SUPR0DECL(int) SUPR0MemFree(PSUPDRVSESSION pSession, RTHCUINTPTR uPtr);
1285SUPR0DECL(int) SUPR0PageAllocEx(PSUPDRVSESSION pSession, uint32_t cPages, uint32_t fFlags, PRTR3PTR ppvR3, PRTR0PTR ppvR0, PRTHCPHYS paPages);
1286SUPR0DECL(int) SUPR0PageMapKernel(PSUPDRVSESSION pSession, RTR3PTR pvR3, uint32_t offSub, uint32_t cbSub, uint32_t fFlags, PRTR0PTR ppvR0);
1287SUPR0DECL(int) SUPR0PageProtect(PSUPDRVSESSION pSession, RTR3PTR pvR3, RTR0PTR pvR0, uint32_t offSub, uint32_t cbSub, uint32_t fProt);
1288SUPR0DECL(int) SUPR0PageFree(PSUPDRVSESSION pSession, RTR3PTR pvR3);
1289SUPR0DECL(int) SUPR0GipMap(PSUPDRVSESSION pSession, PRTR3PTR ppGipR3, PRTHCPHYS pHCPhysGip);
1290SUPR0DECL(int) SUPR0QueryVTCaps(PSUPDRVSESSION pSession, uint32_t *pfCaps);
1291SUPR0DECL(int) SUPR0GipUnmap(PSUPDRVSESSION pSession);
1292SUPR0DECL(int) SUPR0Printf(const char *pszFormat, ...);
1293SUPR0DECL(SUPPAGINGMODE) SUPR0GetPagingMode(void);
1294SUPR0DECL(int) SUPR0EnableVTx(bool fEnable);
1295
1296/** @name Absolute symbols
1297 * Take the address of these, don't try call them.
1298 * @{ */
1299SUPR0DECL(void) SUPR0AbsIs64bit(void);
1300SUPR0DECL(void) SUPR0Abs64bitKernelCS(void);
1301SUPR0DECL(void) SUPR0Abs64bitKernelSS(void);
1302SUPR0DECL(void) SUPR0Abs64bitKernelDS(void);
1303SUPR0DECL(void) SUPR0AbsKernelCS(void);
1304SUPR0DECL(void) SUPR0AbsKernelSS(void);
1305SUPR0DECL(void) SUPR0AbsKernelDS(void);
1306SUPR0DECL(void) SUPR0AbsKernelES(void);
1307SUPR0DECL(void) SUPR0AbsKernelFS(void);
1308SUPR0DECL(void) SUPR0AbsKernelGS(void);
1309/** @} */
1310
1311/**
1312 * Support driver component factory.
1313 *
1314 * Component factories are registered by drivers that provides services
1315 * such as the host network interface filtering and access to the host
1316 * TCP/IP stack.
1317 *
1318 * @remark Module dependencies and making sure that a component doesn't
1319 * get unloaded while in use, is the sole responsibility of the
1320 * driver/kext/whatever implementing the component.
1321 */
1322typedef struct SUPDRVFACTORY
1323{
1324 /** The (unique) name of the component factory. */
1325 char szName[56];
1326 /**
1327 * Queries a factory interface.
1328 *
1329 * The factory interface is specific to each component and will be be
1330 * found in the header(s) for the component alongside its UUID.
1331 *
1332 * @returns Pointer to the factory interfaces on success, NULL on failure.
1333 *
1334 * @param pSupDrvFactory Pointer to this structure.
1335 * @param pSession The SUPDRV session making the query.
1336 * @param pszInterfaceUuid The UUID of the factory interface.
1337 */
1338 DECLR0CALLBACKMEMBER(void *, pfnQueryFactoryInterface,(struct SUPDRVFACTORY const *pSupDrvFactory, PSUPDRVSESSION pSession, const char *pszInterfaceUuid));
1339} SUPDRVFACTORY;
1340/** Pointer to a support driver factory. */
1341typedef SUPDRVFACTORY *PSUPDRVFACTORY;
1342/** Pointer to a const support driver factory. */
1343typedef SUPDRVFACTORY const *PCSUPDRVFACTORY;
1344
1345SUPR0DECL(int) SUPR0ComponentRegisterFactory(PSUPDRVSESSION pSession, PCSUPDRVFACTORY pFactory);
1346SUPR0DECL(int) SUPR0ComponentDeregisterFactory(PSUPDRVSESSION pSession, PCSUPDRVFACTORY pFactory);
1347SUPR0DECL(int) SUPR0ComponentQueryFactory(PSUPDRVSESSION pSession, const char *pszName, const char *pszInterfaceUuid, void **ppvFactoryIf);
1348
1349
1350/** @name Tracing
1351 * @{ */
1352
1353/**
1354 * Tracer data associated with a provider.
1355 */
1356typedef union SUPDRVTRACERDATA
1357{
1358 /** Generic */
1359 uint64_t au64[2];
1360
1361 /** DTrace data. */
1362 struct
1363 {
1364 /** Provider ID. */
1365 uintptr_t idProvider;
1366 /** The number of trace points provided. */
1367 uint32_t volatile cProvidedProbes;
1368 /** Whether we've invalidated this bugger. */
1369 bool fZombie;
1370 } DTrace;
1371} SUPDRVTRACERDATA;
1372/** Pointer to the tracer data associated with a provider. */
1373typedef SUPDRVTRACERDATA *PSUPDRVTRACERDATA;
1374
1375/**
1376 * Support driver tracepoint provider core.
1377 */
1378typedef struct SUPDRVVDTPROVIDERCORE
1379{
1380 /** The tracer data member. */
1381 SUPDRVTRACERDATA TracerData;
1382 /** The provider descriptor. */
1383 struct VTGDESCPROVIDER *pDesc;
1384 /** The VTG header. */
1385 struct VTGOBJHDR *pHdr;
1386 /** Pointer to the provider name (a copy that's always available). */
1387 const char *pszName;
1388 /** Pointer to the module name. */
1389 const char *pszModName;
1390} SUPDRVVDTPROVIDERCORE;
1391/** Pointer to a tracepoint provider core structure. */
1392typedef SUPDRVVDTPROVIDERCORE *PSUPDRVVDTPROVIDERCORE;
1393
1394
1395/**
1396 * Usermode probe context information.
1397 */
1398typedef struct SUPDRVTRACERUSRCTX
1399{
1400 /** The probe ID from the VTG location record. */
1401 uint32_t idProbe;
1402 /** 32 if X86, 64 if AMD64. */
1403 uint8_t cBits;
1404 /** Reserved padding. */
1405 uint8_t abReserved[3];
1406 /** Data which format is dictated by the cBits member. */
1407 union
1408 {
1409 /** X86 context info. */
1410 struct
1411 {
1412 uint32_t uVtgProbeLoc; /**< Location record address. */
1413 uint32_t aArgs[20]; /**< Raw arguments. */
1414 uint32_t eip;
1415 uint32_t eflags;
1416 uint32_t eax;
1417 uint32_t ecx;
1418 uint32_t edx;
1419 uint32_t ebx;
1420 uint32_t esp;
1421 uint32_t ebp;
1422 uint32_t esi;
1423 uint32_t edi;
1424 uint16_t cs;
1425 uint16_t ss;
1426 uint16_t ds;
1427 uint16_t es;
1428 uint16_t fs;
1429 uint16_t gs;
1430 } X86;
1431
1432 /** AMD64 context info. */
1433 struct
1434 {
1435 uint64_t uVtgProbeLoc; /**< Location record address. */
1436 uint64_t aArgs[10]; /**< Raw arguments. */
1437 uint64_t rip;
1438 uint64_t rflags;
1439 uint64_t rax;
1440 uint64_t rcx;
1441 uint64_t rdx;
1442 uint64_t rbx;
1443 uint64_t rsp;
1444 uint64_t rbp;
1445 uint64_t rsi;
1446 uint64_t rdi;
1447 uint64_t r8;
1448 uint64_t r9;
1449 uint64_t r10;
1450 uint64_t r11;
1451 uint64_t r12;
1452 uint64_t r13;
1453 uint64_t r14;
1454 } Amd64;
1455 } u;
1456} SUPDRVTRACERUSRCTX;
1457/** Pointer to the usermode probe context information. */
1458typedef SUPDRVTRACERUSRCTX const *PCSUPDRVTRACERUSRCTX;
1459
1460
1461/** Pointer to a tracer registration record. */
1462typedef struct SUPDRVTRACERREG const *PCSUPDRVTRACERREG;
1463/**
1464 * Support driver tracer registration record.
1465 */
1466typedef struct SUPDRVTRACERREG
1467{
1468 /** Magic value (SUPDRVTRACERREG_MAGIC). */
1469 uint32_t u32Magic;
1470 /** Version (SUPDRVTRACERREG_VERSION). */
1471 uint32_t u32Version;
1472
1473 /**
1474 * Fire off a kernel probe.
1475 *
1476 * @param pVtgProbeLoc The probe location record.
1477 * @param uArg0 The first raw probe argument.
1478 * @param uArg1 The second raw probe argument.
1479 * @param uArg2 The third raw probe argument.
1480 * @param uArg3 The fourth raw probe argument.
1481 * @param uArg4 The fifth raw probe argument.
1482 *
1483 * @remarks SUPR0TracerFireProbe will do a tail jump thru this member, so
1484 * no extra stack frames will be added.
1485 * @remarks This does not take a 'this' pointer argument because it doesn't map
1486 * well onto VTG or DTrace.
1487 *
1488 */
1489 DECLR0CALLBACKMEMBER(void, pfnProbeFireKernel, (struct VTGPROBELOC *pVtgProbeLoc, uintptr_t uArg0, uintptr_t uArg1, uintptr_t uArg2,
1490 uintptr_t uArg3, uintptr_t uArg4));
1491
1492 /**
1493 * Fire off a user-mode probe.
1494 *
1495 * @param pThis Pointer to the registration record.
1496 *
1497 * @param pVtgProbeLoc The probe location record.
1498 * @param pSession The user session.
1499 * @param pCtx The usermode context info.
1500 */
1501 DECLR0CALLBACKMEMBER(void, pfnProbeFireUser, (PCSUPDRVTRACERREG pThis, PSUPDRVSESSION pSession, PCSUPDRVTRACERUSRCTX pCtx));
1502
1503 /**
1504 * Opens up the tracer.
1505 *
1506 * @returns VBox status code.
1507 * @param pThis Pointer to the registration record.
1508 * @param pSession The session doing the opening.
1509 * @param uCookie A cookie (magic) unique to the tracer, so it can
1510 * fend off incompatible clients.
1511 * @param uArg Tracer specific argument.
1512 * @param puSessionData Pointer to the session data variable. This must be
1513 * set to a non-zero value on success.
1514 */
1515 DECLR0CALLBACKMEMBER(int, pfnTracerOpen, (PCSUPDRVTRACERREG pThis, PSUPDRVSESSION pSession, uint32_t uCookie, uintptr_t uArg,
1516 uintptr_t *puSessionData));
1517
1518 /**
1519 * I/O control style tracer communication method.
1520 *
1521 *
1522 * @returns VBox status code.
1523 * @param pThis Pointer to the registration record.
1524 * @param pSession The session.
1525 * @param uSessionData The session data value.
1526 * @param uCmd The tracer specific command.
1527 * @param uArg The tracer command specific argument.
1528 * @param piRetVal The tracer specific return value.
1529 */
1530 DECLR0CALLBACKMEMBER(int, pfnTracerIoCtl, (PCSUPDRVTRACERREG pThis, PSUPDRVSESSION pSession, uintptr_t uSessionData,
1531 uintptr_t uCmd, uintptr_t uArg, int32_t *piRetVal));
1532
1533 /**
1534 * Cleans up data the tracer has associated with a session.
1535 *
1536 * @param pThis Pointer to the registration record.
1537 * @param pSession The session handle.
1538 * @param uSessionData The data assoicated with the session.
1539 */
1540 DECLR0CALLBACKMEMBER(void, pfnTracerClose, (PCSUPDRVTRACERREG pThis, PSUPDRVSESSION pSession, uintptr_t uSessionData));
1541
1542 /**
1543 * Registers a provider.
1544 *
1545 * @returns VBox status code.
1546 * @param pThis Pointer to the registration record.
1547 * @param pCore The provider core data.
1548 *
1549 * @todo Kernel vs. Userland providers.
1550 */
1551 DECLR0CALLBACKMEMBER(int, pfnProviderRegister, (PCSUPDRVTRACERREG pThis, PSUPDRVVDTPROVIDERCORE pCore));
1552
1553 /**
1554 * Attempts to deregisters a provider.
1555 *
1556 * @returns VINF_SUCCESS or VERR_TRY_AGAIN. If the latter, the provider
1557 * should be made as harmless as possible before returning as the
1558 * VTG object and associated code will be unloaded upon return.
1559 *
1560 * @param pThis Pointer to the registration record.
1561 * @param pCore The provider core data.
1562 */
1563 DECLR0CALLBACKMEMBER(int, pfnProviderDeregister, (PCSUPDRVTRACERREG pThis, PSUPDRVVDTPROVIDERCORE pCore));
1564
1565 /**
1566 * Make another attempt at unregister a busy provider.
1567 *
1568 * @returns VINF_SUCCESS or VERR_TRY_AGAIN.
1569 * @param pThis Pointer to the registration record.
1570 * @param pCore The provider core data.
1571 */
1572 DECLR0CALLBACKMEMBER(int, pfnProviderDeregisterZombie, (PCSUPDRVTRACERREG pThis, PSUPDRVVDTPROVIDERCORE pCore));
1573
1574 /** End marker (SUPDRVTRACERREG_MAGIC). */
1575 uintptr_t uEndMagic;
1576} SUPDRVTRACERREG;
1577
1578/** Tracer magic (Kenny Garrett). */
1579#define SUPDRVTRACERREG_MAGIC UINT32_C(0x19601009)
1580/** Tracer registration structure version. */
1581#define SUPDRVTRACERREG_VERSION RT_MAKE_U32(0, 1)
1582
1583/** Pointer to a trace helper structure. */
1584typedef struct SUPDRVTRACERHLP const *PCSUPDRVTRACERHLP;
1585/**
1586 * Helper structure.
1587 */
1588typedef struct SUPDRVTRACERHLP
1589{
1590 /** The structure version (SUPDRVTRACERHLP_VERSION). */
1591 uintptr_t uVersion;
1592
1593 /** @todo ... */
1594
1595 /** End marker (SUPDRVTRACERHLP_VERSION) */
1596 uintptr_t uEndVersion;
1597} SUPDRVTRACERHLP;
1598/** Tracer helper structure version. */
1599#define SUPDRVTRACERHLP_VERSION RT_MAKE_U32(0, 1)
1600
1601SUPR0DECL(int) SUPR0TracerRegisterImpl(void *hMod, PSUPDRVSESSION pSession, PCSUPDRVTRACERREG pReg, PCSUPDRVTRACERHLP *ppHlp);
1602SUPR0DECL(int) SUPR0TracerDeregisterImpl(void *hMod, PSUPDRVSESSION pSession);
1603SUPR0DECL(int) SUPR0TracerRegisterDrv(PSUPDRVSESSION pSession, struct VTGOBJHDR *pVtgHdr, const char *pszName);
1604SUPR0DECL(void) SUPR0TracerDeregisterDrv(PSUPDRVSESSION pSession);
1605SUPR0DECL(int) SUPR0TracerRegisterModule(void *hMod, struct VTGOBJHDR *pVtgHdr);
1606SUPR0DECL(void) SUPR0TracerFireProbe(struct VTGPROBELOC *pVtgProbeLoc, uintptr_t uArg0, uintptr_t uArg1, uintptr_t uArg2,
1607 uintptr_t uArg3, uintptr_t uArg4);
1608/** @} */
1609
1610
1611/**
1612 * Service request callback function.
1613 *
1614 * @returns VBox status code.
1615 * @param pSession The caller's session.
1616 * @param u64Arg 64-bit integer argument.
1617 * @param pReqHdr The request header. Input / Output. Optional.
1618 */
1619typedef DECLCALLBACK(int) FNSUPR0SERVICEREQHANDLER(PSUPDRVSESSION pSession, uint32_t uOperation,
1620 uint64_t u64Arg, PSUPR0SERVICEREQHDR pReqHdr);
1621/** Pointer to a FNR0SERVICEREQHANDLER(). */
1622typedef R0PTRTYPE(FNSUPR0SERVICEREQHANDLER *) PFNSUPR0SERVICEREQHANDLER;
1623
1624
1625/** @defgroup grp_sup_r0_idc The IDC Interface
1626 * @ingroup grp_sup_r0
1627 * @{
1628 */
1629
1630/** The current SUPDRV IDC version.
1631 * This follows the usual high word / low word rules, i.e. high word is the
1632 * major number and it signifies incompatible interface changes. */
1633#define SUPDRV_IDC_VERSION UINT32_C(0x00010000)
1634
1635/**
1636 * Inter-Driver Communication Handle.
1637 */
1638typedef union SUPDRVIDCHANDLE
1639{
1640 /** Padding for opaque usage.
1641 * Must be greater or equal in size than the private struct. */
1642 void *apvPadding[4];
1643#ifdef SUPDRVIDCHANDLEPRIVATE_DECLARED
1644 /** The private view. */
1645 struct SUPDRVIDCHANDLEPRIVATE s;
1646#endif
1647} SUPDRVIDCHANDLE;
1648/** Pointer to a handle. */
1649typedef SUPDRVIDCHANDLE *PSUPDRVIDCHANDLE;
1650
1651SUPR0DECL(int) SUPR0IdcOpen(PSUPDRVIDCHANDLE pHandle, uint32_t uReqVersion, uint32_t uMinVersion,
1652 uint32_t *puSessionVersion, uint32_t *puDriverVersion, uint32_t *puDriverRevision);
1653SUPR0DECL(int) SUPR0IdcCall(PSUPDRVIDCHANDLE pHandle, uint32_t iReq, void *pvReq, uint32_t cbReq);
1654SUPR0DECL(int) SUPR0IdcClose(PSUPDRVIDCHANDLE pHandle);
1655SUPR0DECL(PSUPDRVSESSION) SUPR0IdcGetSession(PSUPDRVIDCHANDLE pHandle);
1656SUPR0DECL(int) SUPR0IdcComponentRegisterFactory(PSUPDRVIDCHANDLE pHandle, PCSUPDRVFACTORY pFactory);
1657SUPR0DECL(int) SUPR0IdcComponentDeregisterFactory(PSUPDRVIDCHANDLE pHandle, PCSUPDRVFACTORY pFactory);
1658
1659/** @} */
1660
1661/** @name Ring-0 module entry points.
1662 *
1663 * These can be exported by ring-0 modules SUP are told to load.
1664 *
1665 * @{ */
1666DECLEXPORT(int) ModuleInit(void *hMod);
1667DECLEXPORT(void) ModuleTerm(void *hMod);
1668/** @} */
1669
1670
1671/** @} */
1672#endif
1673
1674
1675/** @} */
1676
1677RT_C_DECLS_END
1678
1679#endif
1680
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