VirtualBox

source: vbox/trunk/src/VBox/HostDrivers/Support/SUPDrvInternal.h@ 11836

Last change on this file since 11836 was 10935, checked in by vboxsync, 16 years ago

More moving around of files in Linux 2.6.27

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 21.9 KB
Line 
1/* $Revision: 10935 $ */
2/** @file
3 * VirtualBox Support Driver - Internal header.
4 */
5
6/*
7 * Copyright (C) 2006-2007 Sun Microsystems, Inc.
8 *
9 * This file is part of VirtualBox Open Source Edition (OSE), as
10 * available from http://www.virtualbox.org. This file is free software;
11 * you can redistribute it and/or modify it under the terms of the GNU
12 * General Public License (GPL) as published by the Free Software
13 * Foundation, in version 2 as it comes in the "COPYING" file of the
14 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
15 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
16 *
17 * The contents of this file may alternatively be used under the terms
18 * of the Common Development and Distribution License Version 1.0
19 * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
20 * VirtualBox OSE distribution, in which case the provisions of the
21 * CDDL are applicable instead of those of the GPL.
22 *
23 * You may elect to license modified versions of this file under the
24 * terms and conditions of either the GPL or the CDDL or both.
25 *
26 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
27 * Clara, CA 95054 USA or visit http://www.sun.com if you need
28 * additional information or have any questions.
29 */
30
31#ifndef ___SUPDrvInternal_h
32#define ___SUPDrvInternal_h
33
34
35/*******************************************************************************
36* Header Files *
37*******************************************************************************/
38#include <VBox/cdefs.h>
39#include <VBox/types.h>
40#include <iprt/assert.h>
41#include <iprt/asm.h>
42#include <VBox/sup.h>
43#include <iprt/memobj.h>
44#include <iprt/time.h>
45#include <iprt/timer.h>
46#include <iprt/string.h>
47#include <iprt/err.h>
48
49
50#if defined(RT_OS_WINDOWS)
51 __BEGIN_DECLS
52# if (_MSC_VER >= 1400) && !defined(VBOX_WITH_PATCHED_DDK)
53# define _InterlockedExchange _InterlockedExchange_StupidDDKVsCompilerCrap
54# define _InterlockedExchangeAdd _InterlockedExchangeAdd_StupidDDKVsCompilerCrap
55# define _InterlockedCompareExchange _InterlockedCompareExchange_StupidDDKVsCompilerCrap
56# define _InterlockedAddLargeStatistic _InterlockedAddLargeStatistic_StupidDDKVsCompilerCrap
57# define _interlockedbittestandset _interlockedbittestandset_StupidDDKVsCompilerCrap
58# define _interlockedbittestandreset _interlockedbittestandreset_StupidDDKVsCompilerCrap
59# define _interlockedbittestandset64 _interlockedbittestandset64_StupidDDKVsCompilerCrap
60# define _interlockedbittestandreset64 _interlockedbittestandreset64_StupidDDKVsCompilerCrap
61# include <ntddk.h>
62# undef _InterlockedExchange
63# undef _InterlockedExchangeAdd
64# undef _InterlockedCompareExchange
65# undef _InterlockedAddLargeStatistic
66# undef _interlockedbittestandset
67# undef _interlockedbittestandreset
68# undef _interlockedbittestandset64
69# undef _interlockedbittestandreset64
70# else
71# include <ntddk.h>
72# endif
73# include <memory.h>
74# define memcmp(a,b,c) mymemcmp(a,b,c)
75 int VBOXCALL mymemcmp(const void *, const void *, size_t);
76 __END_DECLS
77
78#elif defined(RT_OS_LINUX)
79# include <linux/autoconf.h>
80# include <linux/version.h>
81# if defined(CONFIG_MODVERSIONS) && !defined(MODVERSIONS)
82# define MODVERSIONS
83# if LINUX_VERSION_CODE < KERNEL_VERSION(2, 5, 71)
84# include <linux/modversions.h>
85# endif
86# endif
87# if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 0)
88# undef ALIGN
89# endif
90# ifndef KBUILD_STR
91# if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 16)
92# define KBUILD_STR(s) s
93# else
94# define KBUILD_STR(s) #s
95# endif
96# endif
97# include <linux/string.h>
98# include <linux/spinlock.h>
99# include <linux/slab.h>
100# if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27)
101# include <linux/semaphore.h>
102# else /* older kernels */
103# include <asm/semaphore.h>
104# endif /* older kernels */
105# include <linux/timer.h>
106
107# if 0
108# include <linux/hrtimer.h>
109# define VBOX_HRTIMER
110# endif
111
112#elif defined(RT_OS_DARWIN)
113# include <libkern/libkern.h>
114# include <iprt/string.h>
115
116#elif defined(RT_OS_OS2)
117
118#elif defined(RT_OS_FREEBSD)
119# include <sys/libkern.h>
120# include <iprt/string.h>
121
122#elif defined(RT_OS_SOLARIS)
123# include <sys/cmn_err.h>
124# include <iprt/string.h>
125
126#else
127# error "unsupported OS."
128#endif
129
130#include "SUPDrvIOC.h"
131#include "SUPDrvIDC.h"
132
133
134
135/*******************************************************************************
136* Defined Constants And Macros *
137*******************************************************************************/
138/*
139 * Hardcoded cookies.
140 */
141#define BIRD 0x64726962 /* 'bird' */
142#define BIRD_INV 0x62697264 /* 'drib' */
143
144
145/*
146 * Win32
147 */
148#if defined(RT_OS_WINDOWS)
149
150/* debug printf */
151# define OSDBGPRINT(a) DbgPrint a
152
153/** Maximum number of bytes we try to lock down in one go.
154 * This is supposed to have a limit right below 256MB, but this appears
155 * to actually be much lower. The values here have been determined experimentally.
156 */
157#ifdef RT_ARCH_X86
158# define MAX_LOCK_MEM_SIZE (32*1024*1024) /* 32mb */
159#endif
160#ifdef RT_ARCH_AMD64
161# define MAX_LOCK_MEM_SIZE (24*1024*1024) /* 24mb */
162#endif
163
164
165/*
166 * Linux
167 */
168#elif defined(RT_OS_LINUX)
169
170/* check kernel version */
171#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 4, 0)
172# error Unsupported kernel version!
173#endif
174
175__BEGIN_DECLS
176int linux_dprintf(const char *format, ...);
177__END_DECLS
178
179/* debug printf */
180# define OSDBGPRINT(a) printk a
181
182
183/*
184 * Darwin
185 */
186#elif defined(RT_OS_DARWIN)
187
188/* debug printf */
189# define OSDBGPRINT(a) printf a
190
191
192/*
193 * OS/2
194 */
195#elif defined(RT_OS_OS2)
196
197/* No log API in OS/2 only COM port. */
198# define OSDBGPRINT(a) SUPR0Printf a
199
200
201/*
202 * FreeBSD
203 */
204#elif defined(RT_OS_FREEBSD)
205
206/* debug printf */
207# define OSDBGPRINT(a) printf a
208
209
210/*
211 * Solaris
212 */
213#elif defined(RT_OS_SOLARIS)
214# define OSDBGPRINT(a) SUPR0Printf a
215
216
217#else
218/** @todo other os'es */
219# error "OS interface defines is not done for this OS!"
220#endif
221
222
223/* dprintf */
224#if (defined(DEBUG) && !defined(NO_LOGGING)) || defined(RT_OS_FREEBSD)
225# ifdef LOG_TO_COM
226# include <VBox/log.h>
227# define dprintf(a) RTLogComPrintf a
228# else
229# define dprintf(a) OSDBGPRINT(a)
230# endif
231#else
232# define dprintf(a) do {} while (0)
233#endif
234
235/* dprintf2 - extended logging. */
236#if defined(RT_OS_DARWIN) || defined(RT_OS_OS2) || defined(RT_OS_FREEBSD)
237# define dprintf2 dprintf
238#else
239# define dprintf2(a) do { } while (0)
240#endif
241
242
243/*
244 * Error codes.
245 */
246/** @todo retire the SUPDRV_ERR_* stuff, we ship err.h now. */
247/** Invalid parameter. */
248#define SUPDRV_ERR_GENERAL_FAILURE (-1)
249/** Invalid parameter. */
250#define SUPDRV_ERR_INVALID_PARAM (-2)
251/** Invalid magic or cookie. */
252#define SUPDRV_ERR_INVALID_MAGIC (-3)
253/** Invalid loader handle. */
254#define SUPDRV_ERR_INVALID_HANDLE (-4)
255/** Failed to lock the address range. */
256#define SUPDRV_ERR_LOCK_FAILED (-5)
257/** Invalid memory pointer. */
258#define SUPDRV_ERR_INVALID_POINTER (-6)
259/** Failed to patch the IDT. */
260#define SUPDRV_ERR_IDT_FAILED (-7)
261/** Memory allocation failed. */
262#define SUPDRV_ERR_NO_MEMORY (-8)
263/** Already loaded. */
264#define SUPDRV_ERR_ALREADY_LOADED (-9)
265/** Permission denied. */
266#define SUPDRV_ERR_PERMISSION_DENIED (-10)
267/** Version mismatch. */
268#define SUPDRV_ERR_VERSION_MISMATCH (-11)
269
270
271
272/*******************************************************************************
273* Structures and Typedefs *
274*******************************************************************************/
275/** Pointer to the device extension. */
276typedef struct SUPDRVDEVEXT *PSUPDRVDEVEXT;
277
278#ifdef VBOX_WITH_IDT_PATCHING
279
280/**
281 * An IDT Entry.
282 */
283typedef struct SUPDRVIDTE
284{
285 /** Low offset word. */
286 uint32_t u16OffsetLow : 16;
287 /** Segment Selector. */
288 uint32_t u16SegSel : 16;
289#ifdef RT_ARCH_AMD64
290 /** Interrupt Stack Table index. */
291 uint32_t u3IST : 3;
292 /** Reserved, ignored. */
293 uint32_t u5Reserved : 5;
294#else
295 /** Reserved. */
296 uint32_t u5Reserved : 5;
297 /** IDT Type part one (not used for task gate). */
298 uint32_t u3Type1 : 3;
299#endif
300 /** IDT Type part two. */
301 uint32_t u5Type2 : 5;
302 /** Descriptor Privilege level. */
303 uint32_t u2DPL : 2;
304 /** Present flag. */
305 uint32_t u1Present : 1;
306 /** High offset word. */
307 uint32_t u16OffsetHigh : 16;
308#ifdef RT_ARCH_AMD64
309 /** The upper top part of the address. */
310 uint32_t u32OffsetTop;
311 /** Reserved dword for qword (aligning the struct), ignored. */
312 uint32_t u32Reserved;
313#endif
314} SUPDRVIDTE, *PSUPDRVIDTE;
315
316/** The u5Type2 value for an interrupt gate. */
317#define SUPDRV_IDTE_TYPE2_INTERRUPT_GATE 0x0e
318
319
320/**
321 * Patch code.
322 */
323typedef struct SUPDRVPATCH
324{
325#define SUPDRV_PATCH_CODE_SIZE 0x50
326 /** Patch code. */
327 uint8_t auCode[SUPDRV_PATCH_CODE_SIZE];
328 /** Changed IDT entry (for parnoid UnpatchIdt()). */
329 SUPDRVIDTE ChangedIdt;
330 /** Saved IDT entry. */
331 SUPDRVIDTE SavedIdt;
332 /** Pointer to the IDT.
333 * We ASSUME the IDT is not re(al)located after bootup and use this as key
334 * for the patches rather than processor number. This prevents some
335 * stupid nesting stuff from happening in case of processors sharing the
336 * IDT.
337 * We're fucked if the processors have different physical mapping for
338 * the(se) page(s), but we'll find that out soon enough in VBOX_STRICT mode.
339 */
340 void *pvIdt;
341 /** Pointer to the IDT entry. */
342 SUPDRVIDTE volatile *pIdtEntry;
343 /** Usage counter. */
344 uint32_t volatile cUsage;
345 /** The offset into auCode of the VMMR0Entry fixup. */
346 uint16_t offVMMR0EntryFixup;
347 /** The offset into auCode of the stub function. */
348 uint16_t offStub;
349 /** Pointer to the next patch. */
350 struct SUPDRVPATCH * volatile pNext;
351} SUPDRVPATCH, *PSUPDRVPATCH;
352
353/**
354 * Usage record for a patch.
355 */
356typedef struct SUPDRVPATCHUSAGE
357{
358 /** Next in the chain. */
359 struct SUPDRVPATCHUSAGE * volatile pNext;
360 /** The patch this usage applies to. */
361 PSUPDRVPATCH pPatch;
362 /** Usage count. */
363 uint32_t volatile cUsage;
364} SUPDRVPATCHUSAGE, *PSUPDRVPATCHUSAGE;
365
366#endif /* VBOX_WITH_IDT_PATCHING */
367
368
369/**
370 * Memory reference types.
371 */
372typedef enum
373{
374 /** Unused entry */
375 MEMREF_TYPE_UNUSED = 0,
376 /** Locked memory (r3 mapping only). */
377 MEMREF_TYPE_LOCKED,
378 /** Continous memory block (r3 and r0 mapping). */
379 MEMREF_TYPE_CONT,
380 /** Low memory block (r3 and r0 mapping). */
381 MEMREF_TYPE_LOW,
382 /** Memory block (r3 and r0 mapping). */
383 MEMREF_TYPE_MEM,
384 /** Locked memory (r3 mapping only) allocated by the support driver. */
385 MEMREF_TYPE_LOCKED_SUP,
386 /** Blow the type up to 32-bit and mark the end. */
387 MEMREG_TYPE_32BIT_HACK = 0x7fffffff
388} SUPDRVMEMREFTYPE, *PSUPDRVMEMREFTYPE;
389
390
391/**
392 * Structure used for tracking memory a session
393 * references in one way or another.
394 */
395typedef struct SUPDRVMEMREF
396{
397 /** The memory object handle. */
398 RTR0MEMOBJ MemObj;
399 /** The ring-3 mapping memory object handle. */
400 RTR0MEMOBJ MapObjR3;
401 /** Type of memory. */
402 SUPDRVMEMREFTYPE eType;
403} SUPDRVMEMREF, *PSUPDRVMEMREF;
404
405
406/**
407 * Bundle of locked memory ranges.
408 */
409typedef struct SUPDRVBUNDLE
410{
411 /** Pointer to the next bundle. */
412 struct SUPDRVBUNDLE * volatile pNext;
413 /** Referenced memory. */
414 SUPDRVMEMREF aMem[64];
415 /** Number of entries used. */
416 uint32_t volatile cUsed;
417} SUPDRVBUNDLE, *PSUPDRVBUNDLE;
418
419
420/**
421 * Loaded image.
422 */
423typedef struct SUPDRVLDRIMAGE
424{
425 /** Next in chain. */
426 struct SUPDRVLDRIMAGE * volatile pNext;
427 /** Pointer to the image. */
428 void *pvImage;
429 /** Pointer to the optional module initialization callback. */
430 PFNR0MODULEINIT pfnModuleInit;
431 /** Pointer to the optional module termination callback. */
432 PFNR0MODULETERM pfnModuleTerm;
433 /** Size of the image. */
434 uint32_t cbImage;
435 /** The offset of the symbol table. */
436 uint32_t offSymbols;
437 /** The number of entries in the symbol table. */
438 uint32_t cSymbols;
439 /** The offset of the string table. */
440 uint32_t offStrTab;
441 /** Size of the string table. */
442 uint32_t cbStrTab;
443 /** The ldr image state. (IOCtl code of last opration.) */
444 uint32_t uState;
445 /** Usage count. */
446 uint32_t volatile cUsage;
447 /** Image name. */
448 char szName[32];
449} SUPDRVLDRIMAGE, *PSUPDRVLDRIMAGE;
450
451
452/** Image usage record. */
453typedef struct SUPDRVLDRUSAGE
454{
455 /** Next in chain. */
456 struct SUPDRVLDRUSAGE * volatile pNext;
457 /** The image. */
458 PSUPDRVLDRIMAGE pImage;
459 /** Load count. */
460 uint32_t volatile cUsage;
461} SUPDRVLDRUSAGE, *PSUPDRVLDRUSAGE;
462
463
464/**
465 * Component factory registration record.
466 */
467typedef struct SUPDRVFACTORYREG
468{
469 /** Pointer to the next registration. */
470 struct SUPDRVFACTORYREG *pNext;
471 /** Pointer to the registered factory. */
472 PCSUPDRVFACTORY pFactory;
473 /** The session owning the factory.
474 * Used for deregistration and session cleanup. */
475 PSUPDRVSESSION pSession;
476 /** Length of the name. */
477 size_t cchName;
478} SUPDRVFACTORYREG;
479/** Pointer to a component factory registration record. */
480typedef SUPDRVFACTORYREG *PSUPDRVFACTORYREG;
481/** Pointer to a const component factory registration record. */
482typedef SUPDRVFACTORYREG const *PCSUPDRVFACTORYREG;
483
484
485/**
486 * Registered object.
487 * This takes care of reference counting and tracking data for access checks.
488 */
489typedef struct SUPDRVOBJ
490{
491 /** Magic value (SUPDRVOBJ_MAGIC). */
492 uint32_t u32Magic;
493 /** The object type. */
494 SUPDRVOBJTYPE enmType;
495 /** Pointer to the next in the global list. */
496 struct SUPDRVOBJ * volatile pNext;
497 /** Pointer to the object destructor.
498 * This may be set to NULL if the image containing the destructor get unloaded. */
499 PFNSUPDRVDESTRUCTOR pfnDestructor;
500 /** User argument 1. */
501 void *pvUser1;
502 /** User argument 2. */
503 void *pvUser2;
504 /** The total sum of all per-session usage. */
505 uint32_t volatile cUsage;
506 /** The creator user id. */
507 RTUID CreatorUid;
508 /** The creator group id. */
509 RTGID CreatorGid;
510 /** The creator process id. */
511 RTPROCESS CreatorProcess;
512} SUPDRVOBJ, *PSUPDRVOBJ;
513
514/** Magic number for SUPDRVOBJ::u32Magic. (Dame Agatha Mary Clarissa Christie). */
515#define SUPDRVOBJ_MAGIC 0x18900915
516
517/**
518 * The per-session object usage record.
519 */
520typedef struct SUPDRVUSAGE
521{
522 /** Pointer to the next in the list. */
523 struct SUPDRVUSAGE * volatile pNext;
524 /** Pointer to the object we're recording usage for. */
525 PSUPDRVOBJ pObj;
526 /** The usage count. */
527 uint32_t volatile cUsage;
528} SUPDRVUSAGE, *PSUPDRVUSAGE;
529
530
531/**
532 * Per session data.
533 * This is mainly for memory tracking.
534 */
535typedef struct SUPDRVSESSION
536{
537 /** Pointer to the device extension. */
538 PSUPDRVDEVEXT pDevExt;
539 /** Session Cookie. */
540 uint32_t u32Cookie;
541
542 /** Load usage records. (protected by SUPDRVDEVEXT::mtxLdr) */
543 PSUPDRVLDRUSAGE volatile pLdrUsage;
544#ifdef VBOX_WITH_IDT_PATCHING
545 /** Patch usage records. (protected by SUPDRVDEVEXT::SpinLock) */
546 PSUPDRVPATCHUSAGE volatile pPatchUsage;
547#endif
548 /** The VM associated with the session. */
549 PVM pVM;
550 /** List of generic usage records. (protected by SUPDRVDEVEXT::SpinLock) */
551 PSUPDRVUSAGE volatile pUsage;
552
553 /** Spinlock protecting the bundles and the GIP members. */
554 RTSPINLOCK Spinlock;
555 /** The ring-3 mapping of the GIP (readonly). */
556 RTR0MEMOBJ GipMapObjR3;
557 /** Set if the session is using the GIP. */
558 uint32_t fGipReferenced;
559 /** Bundle of locked memory objects. */
560 SUPDRVBUNDLE Bundle;
561
562 /** The user id of the session. (Set by the OS part.) */
563 RTUID Uid;
564 /** The group id of the session. (Set by the OS part.) */
565 RTGID Gid;
566 /** The process (id) of the session. */
567 RTPROCESS Process;
568 /** Which process this session is associated with.
569 * This is NIL_RTR0PROCESS for kernel sessions and valid for user ones. */
570 RTR0PROCESS R0Process;
571#if defined(RT_OS_DARWIN)
572 /** Pointer to the associated org_virtualbox_SupDrvClient object. */
573 void *pvSupDrvClient;
574 /** Whether this session has been opened or not. */
575 bool fOpened;
576#endif
577#if defined(RT_OS_OS2)
578 /** The system file number of this session. */
579 uint16_t sfn;
580 uint16_t Alignment; /**< Alignment */
581#endif
582#if defined(RT_OS_DARWIN) || defined(RT_OS_OS2) || defined(RT_OS_SOLARIS)
583 /** Pointer to the next session with the same hash. */
584 PSUPDRVSESSION pNextHash;
585#endif
586} SUPDRVSESSION;
587
588
589/**
590 * Device extension.
591 */
592typedef struct SUPDRVDEVEXT
593{
594 /** Spinlock to serialize the initialization,
595 * usage counting and destruction of the IDT entry override and objects. */
596 RTSPINLOCK Spinlock;
597
598#ifdef VBOX_WITH_IDT_PATCHING
599 /** List of patches. */
600 PSUPDRVPATCH volatile pIdtPatches;
601 /** List of patches Free. */
602 PSUPDRVPATCH volatile pIdtPatchesFree;
603#endif
604
605 /** List of registered objects. Protected by the spinlock. */
606 PSUPDRVOBJ volatile pObjs;
607 /** List of free object usage records. */
608 PSUPDRVUSAGE volatile pUsageFree;
609
610 /** Global cookie. */
611 uint32_t u32Cookie;
612
613 /** The IDT entry number.
614 * Only valid if pIdtPatches is set. */
615 uint8_t volatile u8Idt;
616
617 /** Loader mutex.
618 * This protects pvVMMR0, pvVMMR0Entry, pImages and SUPDRVSESSION::pLdrUsage. */
619 RTSEMFASTMUTEX mtxLdr;
620
621 /** VMM Module 'handle'.
622 * 0 if the code VMM isn't loaded and Idt are nops. */
623 void * volatile pvVMMR0;
624 /** VMMR0EntryInt() pointer. */
625 DECLR0CALLBACKMEMBER(int, pfnVMMR0EntryInt, (PVM pVM, unsigned uOperation, void *pvArg));
626 /** VMMR0EntryFast() pointer. */
627 DECLR0CALLBACKMEMBER(void, pfnVMMR0EntryFast, (PVM pVM, unsigned uOperation));
628 /** VMMR0EntryEx() pointer. */
629 DECLR0CALLBACKMEMBER(int, pfnVMMR0EntryEx, (PVM pVM, unsigned uOperation, PSUPVMMR0REQHDR pReq, uint64_t u64Arg, PSUPDRVSESSION pSession));
630
631 /** Linked list of loaded code. */
632 PSUPDRVLDRIMAGE volatile pLdrImages;
633
634 /** GIP mutex.
635 * Any changes to any of the GIP members requires ownership of this mutex,
636 * except on driver init and termination. */
637 RTSEMFASTMUTEX mtxGip;
638 /** Pointer to the Global Info Page (GIP). */
639 PSUPGLOBALINFOPAGE pGip;
640 /** The physical address of the GIP. */
641 RTHCPHYS HCPhysGip;
642 /** Number of processes using the GIP.
643 * (The updates are suspend while cGipUsers is 0.)*/
644 uint32_t volatile cGipUsers;
645 /** The ring-0 memory object handle for the GIP page. */
646 RTR0MEMOBJ GipMemObj;
647 /** The GIP timer handle. */
648 PRTTIMER pGipTimer;
649 /** If non-zero we've successfully called RTTimerRequestSystemGranularity(). */
650 uint32_t u32SystemTimerGranularityGrant;
651 /** The CPU id of the GIP master.
652 * This CPU is responsible for the updating the common GIP data. */
653 RTCPUID volatile idGipMaster;
654
655 /** Component factory mutex.
656 * This protects pComponentFactoryHead and component factory querying. */
657 RTSEMFASTMUTEX mtxComponentFactory;
658 /** The head of the list of registered component factories. */
659 PSUPDRVFACTORYREG pComponentFactoryHead;
660} SUPDRVDEVEXT;
661
662
663__BEGIN_DECLS
664
665/*******************************************************************************
666* OS Specific Functions *
667*******************************************************************************/
668void VBOXCALL supdrvOSObjInitCreator(PSUPDRVOBJ pObj, PSUPDRVSESSION pSession);
669bool VBOXCALL supdrvOSObjCanAccess(PSUPDRVOBJ pObj, PSUPDRVSESSION pSession, const char *pszObjName, int *prc);
670bool VBOXCALL supdrvOSGetForcedAsyncTscMode(PSUPDRVDEVEXT pDevExt);
671
672
673/*******************************************************************************
674* Shared Functions *
675*******************************************************************************/
676int VBOXCALL supdrvIOCtl(uintptr_t uIOCtl, PSUPDRVDEVEXT pDevExt, PSUPDRVSESSION pSession, PSUPREQHDR pReqHdr);
677int VBOXCALL supdrvIOCtlFast(uintptr_t uIOCtl, PSUPDRVDEVEXT pDevExt, PSUPDRVSESSION pSession);
678int VBOXCALL supdrvIDC(uintptr_t uIOCtl, PSUPDRVDEVEXT pDevExt, PSUPDRVSESSION pSession, PSUPDRVIDCREQHDR pReqHdr);
679int VBOXCALL supdrvInitDevExt(PSUPDRVDEVEXT pDevExt);
680void VBOXCALL supdrvDeleteDevExt(PSUPDRVDEVEXT pDevExt);
681int VBOXCALL supdrvCreateSession(PSUPDRVDEVEXT pDevExt, bool fUser, PSUPDRVSESSION *ppSession);
682void VBOXCALL supdrvCloseSession(PSUPDRVDEVEXT pDevExt, PSUPDRVSESSION pSession);
683void VBOXCALL supdrvCleanupSession(PSUPDRVDEVEXT pDevExt, PSUPDRVSESSION pSession);
684int VBOXCALL supdrvGipInit(PSUPDRVDEVEXT pDevExt, PSUPGLOBALINFOPAGE pGip, RTHCPHYS HCPhys, uint64_t u64NanoTS, unsigned uUpdateHz);
685void VBOXCALL supdrvGipTerm(PSUPGLOBALINFOPAGE pGip);
686void VBOXCALL supdrvGipUpdate(PSUPGLOBALINFOPAGE pGip, uint64_t u64NanoTS);
687void VBOXCALL supdrvGipUpdatePerCpu(PSUPGLOBALINFOPAGE pGip, uint64_t u64NanoTS, unsigned iCpu);
688bool VBOXCALL supdrvDetermineAsyncTsc(uint64_t *pu64DiffCores);
689
690__END_DECLS
691
692#endif
693
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