1 | /** @file
|
---|
2 | *
|
---|
3 | * VBox Guest/VMM/host communication:
|
---|
4 | * HGCM - Host-Guest Communication Manager header
|
---|
5 | */
|
---|
6 |
|
---|
7 | /*
|
---|
8 | * Copyright (C) 2006-2007 innotek GmbH
|
---|
9 | *
|
---|
10 | * This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
11 | * available from http://www.virtualbox.org. This file is free software;
|
---|
12 | * you can redistribute it and/or modify it under the terms of the GNU
|
---|
13 | * General Public License (GPL) as published by the Free Software
|
---|
14 | * Foundation, in version 2 as it comes in the "COPYING" file of the
|
---|
15 | * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
|
---|
16 | * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
17 | */
|
---|
18 |
|
---|
19 | #ifndef __VMMDevState_h__
|
---|
20 | #define __VMMDevState_h__
|
---|
21 |
|
---|
22 | #include <VBox/cdefs.h>
|
---|
23 | #include <VBox/types.h>
|
---|
24 |
|
---|
25 | #include <VBox/pdm.h>
|
---|
26 |
|
---|
27 | #define TIMESYNC_BACKDOOR
|
---|
28 |
|
---|
29 | /** device structure containing all state information */
|
---|
30 | typedef struct VMMDevState
|
---|
31 | {
|
---|
32 | /** The PCI device structure. */
|
---|
33 | PCIDevice dev;
|
---|
34 |
|
---|
35 | /** hypervisor address space size */
|
---|
36 | uint32_t hypervisorSize;
|
---|
37 |
|
---|
38 | /** bit 0: guest capability (1 == wants), bit 1: flag value has changed */
|
---|
39 | /** bit 2: host capability (1 == wants), bit 3: flag value has changed */
|
---|
40 | uint32_t mouseCapabilities;
|
---|
41 | /** absolute mouse position in pixels */
|
---|
42 | uint32_t mouseXAbs;
|
---|
43 | uint32_t mouseYAbs;
|
---|
44 |
|
---|
45 | /** Pointer to device instance. */
|
---|
46 | PPDMDEVINS pDevIns;
|
---|
47 | /** VMMDev port base interface. */
|
---|
48 | PDMIBASE Base;
|
---|
49 | /** VMMDev port interface. */
|
---|
50 | PDMIVMMDEVPORT Port;
|
---|
51 | #ifdef VBOX_HGCM
|
---|
52 | /** HGCM port interface. */
|
---|
53 | PDMIHGCMPORT HGCMPort;
|
---|
54 | #endif
|
---|
55 | /** Pointer to base interface of the driver. */
|
---|
56 | PPDMIBASE pDrvBase;
|
---|
57 | /** VMMDev connector interface */
|
---|
58 | PPDMIVMMDEVCONNECTOR pDrv;
|
---|
59 | #ifdef VBOX_HGCM
|
---|
60 | /** HGCM connector interface */
|
---|
61 | PPDMIHGCMCONNECTOR pHGCMDrv;
|
---|
62 | #endif
|
---|
63 | /** message buffer for backdoor logging. */
|
---|
64 | char szMsg[512];
|
---|
65 | /** message buffer index. */
|
---|
66 | unsigned iMsg;
|
---|
67 | /** Base port in the assigned I/O space. */
|
---|
68 | RTIOPORT PortBase;
|
---|
69 |
|
---|
70 | /** IRQ number assigned to the device */
|
---|
71 | uint32_t irq;
|
---|
72 | /** Current host side event flags */
|
---|
73 | uint32_t u32HostEventFlags;
|
---|
74 | /** Mask of events guest is interested in. Note that the HGCM events
|
---|
75 | * are enabled automatically by the VMMDev device when guest issues
|
---|
76 | * HGCM commands.
|
---|
77 | */
|
---|
78 | uint32_t u32GuestFilterMask;
|
---|
79 | /** Delayed mask of guest events */
|
---|
80 | uint32_t u32NewGuestFilterMask;
|
---|
81 | /** Flag whether u32NewGuestFilterMask is valid */
|
---|
82 | bool fNewGuestFilterMask;
|
---|
83 |
|
---|
84 | /** HC pointer to VMMDev RAM area */
|
---|
85 | VMMDevMemory *pVMMDevRAMHC;
|
---|
86 | /** GC physical address of VMMDev RAM area */
|
---|
87 | RTGCPHYS GCPhysVMMDevRAM;
|
---|
88 |
|
---|
89 | /** Information reported by guest via VMMDevReportGuestInfo generic request.
|
---|
90 | * Until this information is reported the VMMDev refuses any other requests.
|
---|
91 | */
|
---|
92 | VBoxGuestInfo guestInfo;
|
---|
93 |
|
---|
94 | /** Information reported by guest via VMMDevReportGuestCapabilities
|
---|
95 | */
|
---|
96 | uint32_t guestCaps;
|
---|
97 |
|
---|
98 | /** "Additions are Ok" indicator, set to true after processing VMMDevReportGuestInfo,
|
---|
99 | * if additions version is compatible. This flag is here to avoid repeated comparing
|
---|
100 | * of the version in guestInfo.
|
---|
101 | */
|
---|
102 | uint32_t fu32AdditionsOk;
|
---|
103 |
|
---|
104 | /** Video acceleration status set by guest. */
|
---|
105 | uint32_t u32VideoAccelEnabled;
|
---|
106 |
|
---|
107 | /** resolution change request */
|
---|
108 | struct
|
---|
109 | {
|
---|
110 | uint32_t xres;
|
---|
111 | uint32_t yres;
|
---|
112 | uint32_t bpp;
|
---|
113 | uint32_t display;
|
---|
114 | } displayChangeRequest,
|
---|
115 | lastReadDisplayChangeRequest;
|
---|
116 |
|
---|
117 | /** credentials for guest logon purposes */
|
---|
118 | struct
|
---|
119 | {
|
---|
120 | char szUserName[VMMDEV_CREDENTIALS_STRLEN];
|
---|
121 | char szPassword[VMMDEV_CREDENTIALS_STRLEN];
|
---|
122 | char szDomain[VMMDEV_CREDENTIALS_STRLEN];
|
---|
123 | bool fAllowInteractiveLogon;
|
---|
124 | } credentialsLogon;
|
---|
125 |
|
---|
126 | /** credentials for verification by guest */
|
---|
127 | struct
|
---|
128 | {
|
---|
129 | char szUserName[VMMDEV_CREDENTIALS_STRLEN];
|
---|
130 | char szPassword[VMMDEV_CREDENTIALS_STRLEN];
|
---|
131 | char szDomain[VMMDEV_CREDENTIALS_STRLEN];
|
---|
132 | } credentialsJudge;
|
---|
133 |
|
---|
134 | /* memory balloon change request */
|
---|
135 | uint32_t u32MemoryBalloonSize, u32LastMemoryBalloonSize;
|
---|
136 |
|
---|
137 | /* guest ram size */
|
---|
138 | uint64_t u64GuestRAMSize;
|
---|
139 |
|
---|
140 | /* statistics interval change request */
|
---|
141 | uint32_t u32StatIntervalSize, u32LastStatIntervalSize;
|
---|
142 |
|
---|
143 | /* seamless mode change request */
|
---|
144 | bool fLastSeamlessEnabled, fSeamlessEnabled;
|
---|
145 |
|
---|
146 | bool fVRDPEnabled;
|
---|
147 | uint32_t u32VRDPExperienceLevel;
|
---|
148 |
|
---|
149 | #ifdef TIMESYNC_BACKDOOR
|
---|
150 | bool fTimesyncBackdoorLo;
|
---|
151 | uint64_t hostTime;
|
---|
152 | #endif
|
---|
153 | /** Set if GetHostTime should fail.
|
---|
154 | * Loaded from the GetHostTimeDisabled configuration value. */
|
---|
155 | bool fGetHostTimeDisabled;
|
---|
156 |
|
---|
157 | /** Set if backdoor logging should be disabled (output will be ignored then) */
|
---|
158 | bool fBackdoorLogDisabled;
|
---|
159 |
|
---|
160 | #ifdef VBOX_HGCM
|
---|
161 | /** List of pending HGCM requests, used for saving the HGCM state. */
|
---|
162 | PVBOXHGCMCMD pHGCMCmdList;
|
---|
163 | /** Critical section to protect the list. */
|
---|
164 | RTCRITSECT critsectHGCMCmdList;
|
---|
165 | /** Whether the HGCM events are already automatically enabled. */
|
---|
166 | uint32_t u32HGCMEnabled;
|
---|
167 | #endif /* VBOX_HGCM */
|
---|
168 |
|
---|
169 | /* Shared folders LED */
|
---|
170 | struct
|
---|
171 | {
|
---|
172 | /** The LED. */
|
---|
173 | PDMLED Led;
|
---|
174 | /** The LED ports. */
|
---|
175 | PDMILEDPORTS ILeds;
|
---|
176 | /** Partner of ILeds. */
|
---|
177 | R3PTRTYPE(PPDMILEDCONNECTORS) pLedsConnector;
|
---|
178 | } SharedFolders;
|
---|
179 |
|
---|
180 | } VMMDevState;
|
---|
181 |
|
---|
182 | void VMMDevNotifyGuest (VMMDevState *pVMMDevState, uint32_t u32EventMask);
|
---|
183 | void VMMDevCtlSetGuestFilterMask (VMMDevState *pVMMDevState,
|
---|
184 | uint32_t u32OrMask,
|
---|
185 | uint32_t u32NotMask);
|
---|
186 |
|
---|
187 | #endif /* __VMMDevState_h__ */
|
---|