1 | /* $Id: VMMDev.h 55401 2015-04-23 10:03:17Z vboxsync $ */
|
---|
2 | /** @file
|
---|
3 | * VirtualBox Driver interface to VMM device
|
---|
4 | */
|
---|
5 |
|
---|
6 | /*
|
---|
7 | * Copyright (C) 2006-2010 Oracle Corporation
|
---|
8 | *
|
---|
9 | * This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
10 | * available from http://www.virtualbox.org. This file is free software;
|
---|
11 | * you can redistribute it and/or modify it under the terms of the GNU
|
---|
12 | * General Public License (GPL) as published by the Free Software
|
---|
13 | * Foundation, in version 2 as it comes in the "COPYING" file of the
|
---|
14 | * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
|
---|
15 | * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
16 | */
|
---|
17 |
|
---|
18 | #ifndef ____H_VMMDEV
|
---|
19 | #define ____H_VMMDEV
|
---|
20 |
|
---|
21 | #include "VirtualBoxBase.h"
|
---|
22 | #include <VBox/vmm/pdmdrv.h>
|
---|
23 | #include <iprt/asm.h>
|
---|
24 |
|
---|
25 | class Console;
|
---|
26 |
|
---|
27 | class VMMDevMouseInterface
|
---|
28 | {
|
---|
29 | public:
|
---|
30 | virtual PPDMIVMMDEVPORT getVMMDevPort() = 0;
|
---|
31 | };
|
---|
32 |
|
---|
33 | class VMMDev : public VMMDevMouseInterface
|
---|
34 | {
|
---|
35 | public:
|
---|
36 | VMMDev(Console *console);
|
---|
37 | virtual ~VMMDev();
|
---|
38 | static const PDMDRVREG DrvReg;
|
---|
39 | /** Pointer to the associated VMMDev driver. */
|
---|
40 | struct DRVMAINVMMDEV *mpDrv;
|
---|
41 |
|
---|
42 | bool fSharedFolderActive;
|
---|
43 | bool isShFlActive()
|
---|
44 | {
|
---|
45 | return fSharedFolderActive;
|
---|
46 | }
|
---|
47 |
|
---|
48 | Console *getParent()
|
---|
49 | {
|
---|
50 | return mParent;
|
---|
51 | }
|
---|
52 |
|
---|
53 | int WaitCredentialsJudgement (uint32_t u32Timeout, uint32_t *pu32GuestFlags);
|
---|
54 | int SetCredentialsJudgementResult (uint32_t u32Flags);
|
---|
55 |
|
---|
56 | PPDMIVMMDEVPORT getVMMDevPort();
|
---|
57 |
|
---|
58 | #ifdef VBOX_WITH_HGCM
|
---|
59 | int hgcmLoadService (const char *pszServiceLibrary, const char *pszServiceName);
|
---|
60 | int hgcmHostCall (const char *pszServiceName, uint32_t u32Function, uint32_t cParms, PVBOXHGCMSVCPARM paParms);
|
---|
61 | #ifdef VBOX_WITH_CRHGSMI
|
---|
62 | int hgcmHostSvcHandleCreate (const char *pszServiceName, HGCMCVSHANDLE * phSvc);
|
---|
63 | int hgcmHostSvcHandleDestroy (HGCMCVSHANDLE hSvc);
|
---|
64 | int hgcmHostFastCallAsync (HGCMCVSHANDLE hSvc, uint32_t function, PVBOXHGCMSVCPARM pParm, PHGCMHOSTFASTCALLCB pfnCompletion, void *pvCompletion);
|
---|
65 | #endif
|
---|
66 | void hgcmShutdown (void);
|
---|
67 |
|
---|
68 | bool hgcmIsActive (void) { return ASMAtomicReadBool(&m_fHGCMActive); }
|
---|
69 | #endif /* VBOX_WITH_HGCM */
|
---|
70 |
|
---|
71 | private:
|
---|
72 | static DECLCALLBACK(void *) drvQueryInterface(PPDMIBASE pInterface, const char *pszIID);
|
---|
73 | static DECLCALLBACK(int) drvConstruct(PPDMDRVINS pDrvIns, PCFGMNODE pCfg, uint32_t fFlags);
|
---|
74 | static DECLCALLBACK(void) drvDestruct(PPDMDRVINS pDrvIns);
|
---|
75 | static DECLCALLBACK(void) drvReset(PPDMDRVINS pDrvIns);
|
---|
76 |
|
---|
77 | Console * const mParent;
|
---|
78 |
|
---|
79 | RTSEMEVENT mCredentialsEvent;
|
---|
80 | uint32_t mu32CredentialsFlags;
|
---|
81 |
|
---|
82 | #ifdef VBOX_WITH_HGCM
|
---|
83 | bool volatile m_fHGCMActive;
|
---|
84 | #endif /* VBOX_WITH_HGCM */
|
---|
85 | };
|
---|
86 |
|
---|
87 | #endif // !____H_VMMDEV
|
---|
88 | /* vi: set tabstop=4 shiftwidth=4 expandtab: */
|
---|