1 | /* $Id: VMMDev.h 76562 2019-01-01 03:22:50Z vboxsync $ */
|
---|
2 | /** @file
|
---|
3 | * VirtualBox Driver interface to VMM device
|
---|
4 | */
|
---|
5 |
|
---|
6 | /*
|
---|
7 | * Copyright (C) 2006-2019 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 MAIN_INCLUDED_VMMDev_h
|
---|
19 | #define MAIN_INCLUDED_VMMDev_h
|
---|
20 | #ifndef RT_WITHOUT_PRAGMA_ONCE
|
---|
21 | # pragma once
|
---|
22 | #endif
|
---|
23 |
|
---|
24 | #include "VirtualBoxBase.h"
|
---|
25 | #include <VBox/vmm/pdmdrv.h>
|
---|
26 | #include <VBox/hgcmsvc.h>
|
---|
27 | #include <iprt/asm.h>
|
---|
28 |
|
---|
29 | class Console;
|
---|
30 |
|
---|
31 | class VMMDevMouseInterface
|
---|
32 | {
|
---|
33 | public:
|
---|
34 | virtual PPDMIVMMDEVPORT getVMMDevPort() = 0;
|
---|
35 | };
|
---|
36 |
|
---|
37 | class VMMDev : public VMMDevMouseInterface
|
---|
38 | {
|
---|
39 | public:
|
---|
40 | VMMDev(Console *console);
|
---|
41 | virtual ~VMMDev();
|
---|
42 | static const PDMDRVREG DrvReg;
|
---|
43 | /** Pointer to the associated VMMDev driver. */
|
---|
44 | struct DRVMAINVMMDEV *mpDrv;
|
---|
45 |
|
---|
46 | bool fSharedFolderActive;
|
---|
47 | bool isShFlActive()
|
---|
48 | {
|
---|
49 | return fSharedFolderActive;
|
---|
50 | }
|
---|
51 |
|
---|
52 | Console *getParent()
|
---|
53 | {
|
---|
54 | return mParent;
|
---|
55 | }
|
---|
56 |
|
---|
57 | int WaitCredentialsJudgement (uint32_t u32Timeout, uint32_t *pu32GuestFlags);
|
---|
58 | int SetCredentialsJudgementResult (uint32_t u32Flags);
|
---|
59 |
|
---|
60 | PPDMIVMMDEVPORT getVMMDevPort();
|
---|
61 |
|
---|
62 | #ifdef VBOX_WITH_HGCM
|
---|
63 | int hgcmLoadService (const char *pszServiceLibrary, const char *pszServiceName);
|
---|
64 | int hgcmHostCall (const char *pszServiceName, uint32_t u32Function, uint32_t cParms, PVBOXHGCMSVCPARM paParms);
|
---|
65 | # ifdef VBOX_WITH_CRHGSMI
|
---|
66 | int hgcmHostSvcHandleCreate (const char *pszServiceName, HGCMCVSHANDLE * phSvc);
|
---|
67 | int hgcmHostSvcHandleDestroy (HGCMCVSHANDLE hSvc);
|
---|
68 | int hgcmHostFastCallAsync (HGCMCVSHANDLE hSvc, uint32_t function, PVBOXHGCMSVCPARM pParm, PHGCMHOSTFASTCALLCB pfnCompletion, void *pvCompletion);
|
---|
69 | # endif
|
---|
70 | void hgcmShutdown(bool fUvmIsInvalid = false);
|
---|
71 |
|
---|
72 | bool hgcmIsActive (void) { return ASMAtomicReadBool(&m_fHGCMActive); }
|
---|
73 | #endif /* VBOX_WITH_HGCM */
|
---|
74 |
|
---|
75 | private:
|
---|
76 | #ifdef VBOX_WITH_HGCM
|
---|
77 | # ifdef VBOX_WITH_GUEST_PROPS
|
---|
78 | void i_guestPropSetMultiple(void *names, void *values, void *timestamps, void *flags);
|
---|
79 | void i_guestPropSet(const char *pszName, const char *pszValue, const char *pszFlags);
|
---|
80 | int i_guestPropSetGlobalPropertyFlags(uint32_t fFlags);
|
---|
81 | int i_guestPropLoadAndConfigure();
|
---|
82 | # endif
|
---|
83 | #endif
|
---|
84 | static DECLCALLBACK(void *) drvQueryInterface(PPDMIBASE pInterface, const char *pszIID);
|
---|
85 | static DECLCALLBACK(int) drvConstruct(PPDMDRVINS pDrvIns, PCFGMNODE pCfg, uint32_t fFlags);
|
---|
86 | static DECLCALLBACK(void) drvDestruct(PPDMDRVINS pDrvIns);
|
---|
87 | static DECLCALLBACK(void) drvReset(PPDMDRVINS pDrvIns);
|
---|
88 | static DECLCALLBACK(void) drvPowerOn(PPDMDRVINS pDrvIns);
|
---|
89 | static DECLCALLBACK(void) drvPowerOff(PPDMDRVINS pDrvIns);
|
---|
90 | static DECLCALLBACK(void) drvSuspend(PPDMDRVINS pDrvIns);
|
---|
91 | static DECLCALLBACK(void) drvResume(PPDMDRVINS pDrvIns);
|
---|
92 |
|
---|
93 | Console * const mParent;
|
---|
94 |
|
---|
95 | RTSEMEVENT mCredentialsEvent;
|
---|
96 | uint32_t mu32CredentialsFlags;
|
---|
97 |
|
---|
98 | #ifdef VBOX_WITH_HGCM
|
---|
99 | bool volatile m_fHGCMActive;
|
---|
100 | #endif /* VBOX_WITH_HGCM */
|
---|
101 | };
|
---|
102 |
|
---|
103 | #endif /* !MAIN_INCLUDED_VMMDev_h */
|
---|
104 | /* vi: set tabstop=4 shiftwidth=4 expandtab: */
|
---|