1 | /** @file
|
---|
2 | * VirtualBox Driver interface to VMM device
|
---|
3 | */
|
---|
4 |
|
---|
5 | /*
|
---|
6 | * Copyright (C) 2006-2010 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 |
|
---|
17 | #ifndef ____H_VMMDEV
|
---|
18 | #define ____H_VMMDEV
|
---|
19 |
|
---|
20 | #include "VirtualBoxBase.h"
|
---|
21 | #include <VBox/vmm/pdmdrv.h>
|
---|
22 | #include <iprt/asm.h>
|
---|
23 |
|
---|
24 | class Console;
|
---|
25 |
|
---|
26 | class VMMDev
|
---|
27 | {
|
---|
28 | public:
|
---|
29 | VMMDev(Console *console);
|
---|
30 | virtual ~VMMDev();
|
---|
31 | static const PDMDRVREG DrvReg;
|
---|
32 | /** Pointer to the associated VMMDev driver. */
|
---|
33 | struct DRVMAINVMMDEV *mpDrv;
|
---|
34 |
|
---|
35 | bool fSharedFolderActive;
|
---|
36 | bool isShFlActive()
|
---|
37 | {
|
---|
38 | return fSharedFolderActive;
|
---|
39 | }
|
---|
40 |
|
---|
41 | Console *getParent()
|
---|
42 | {
|
---|
43 | return mParent;
|
---|
44 | }
|
---|
45 |
|
---|
46 | int WaitCredentialsJudgement (uint32_t u32Timeout, uint32_t *pu32GuestFlags);
|
---|
47 | int SetCredentialsJudgementResult (uint32_t u32Flags);
|
---|
48 |
|
---|
49 | PPDMIVMMDEVPORT getVMMDevPort();
|
---|
50 |
|
---|
51 | int hgcmLoadService (const char *pszServiceLibrary, const char *pszServiceName);
|
---|
52 | int hgcmHostCall (const char *pszServiceName, uint32_t u32Function, uint32_t cParms, PVBOXHGCMSVCPARM paParms);
|
---|
53 | #ifdef VBOX_WITH_CRHGSMI
|
---|
54 | int hgcmHostSvcHandleCreate (const char *pszServiceName, HGCMCVSHANDLE * phSvc);
|
---|
55 | int hgcmHostSvcHandleDestroy (HGCMCVSHANDLE hSvc);
|
---|
56 | int hgcmHostFastCallAsync (HGCMCVSHANDLE hSvc, uint32_t function, PVBOXHGCMSVCPARM pParm, PHGCMHOSTFASTCALLCB pfnCompletion, void *pvCompletion);
|
---|
57 | #endif
|
---|
58 | void hgcmShutdown (void);
|
---|
59 |
|
---|
60 | bool hgcmIsActive (void) { return ASMAtomicReadBool(&m_fHGCMActive); }
|
---|
61 |
|
---|
62 | private:
|
---|
63 | static DECLCALLBACK(void *) drvQueryInterface(PPDMIBASE pInterface, const char *pszIID);
|
---|
64 | static DECLCALLBACK(int) drvConstruct(PPDMDRVINS pDrvIns, PCFGMNODE pCfg, uint32_t fFlags);
|
---|
65 | static DECLCALLBACK(void) drvDestruct(PPDMDRVINS pDrvIns);
|
---|
66 | static DECLCALLBACK(void) drvReset(PPDMDRVINS pDrvIns);
|
---|
67 |
|
---|
68 | Console * const mParent;
|
---|
69 |
|
---|
70 | RTSEMEVENT mCredentialsEvent;
|
---|
71 | uint32_t mu32CredentialsFlags;
|
---|
72 |
|
---|
73 | #ifdef VBOX_WITH_HGCM
|
---|
74 | bool volatile m_fHGCMActive;
|
---|
75 | #endif /* VBOX_WITH_HGCM */
|
---|
76 | };
|
---|
77 |
|
---|
78 | #endif // !____H_VMMDEV
|
---|
79 | /* vi: set tabstop=4 shiftwidth=4 expandtab: */
|
---|