VirtualBox

source: vbox/trunk/src/VBox/Devices/VMMDev/VMMDevState.h@ 30775

Last change on this file since 30775 was 30775, checked in by vboxsync, 15 years ago

alignment fix.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 9.1 KB
Line 
1/* $Id: VMMDevState.h 30775 2010-07-10 05:25:55Z vboxsync $ */
2/** @file
3 * VMMDev - Guest <-> VMM/Host communication device, internal header.
4 */
5
6/*
7 * Copyright (C) 2006-2007 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 ___VMMDev_VMMDevState_h
19#define ___VMMDev_VMMDevState_h
20
21#include <VBox/VMMDev.h>
22#include <VBox/pdmdev.h>
23#include <VBox/pdmifs.h>
24
25#define TIMESYNC_BACKDOOR
26
27typedef struct DISPLAYCHANGEINFO
28{
29 uint32_t xres;
30 uint32_t yres;
31 uint32_t bpp;
32 uint32_t display;
33} DISPLAYCHANGEINFO;
34
35typedef struct DISPLAYCHANGEREQUEST
36{
37 bool fPending;
38 bool afAlignment[3];
39 DISPLAYCHANGEINFO displayChangeRequest;
40 DISPLAYCHANGEINFO lastReadDisplayChangeRequest;
41} DISPLAYCHANGEREQUEST;
42
43typedef struct DISPLAYCHANGEDATA
44{
45 /* Which monitor is being reported to the guest. */
46 int iCurrentMonitor;
47
48 /** true if the guest responded to VMMDEV_EVENT_DISPLAY_CHANGE_REQUEST at least once */
49 bool fGuestSentChangeEventAck;
50 bool afAlignment[3];
51
52 DISPLAYCHANGEREQUEST aRequests[64]; // @todo maxMonitors
53} DISPLAYCHANGEDATA;
54
55
56/** device structure containing all state information */
57typedef struct VMMDevState
58{
59 /** The PCI device structure. */
60 PCIDevice dev;
61
62 /** The critical section for this device. */
63 PDMCRITSECT CritSect;
64
65 /** hypervisor address space size */
66 uint32_t hypervisorSize;
67
68 /** mouse capabilities of host and guest */
69 uint32_t mouseCapabilities;
70 /** absolute mouse position in pixels */
71 uint32_t mouseXAbs;
72 uint32_t mouseYAbs;
73 /** Does the guest currently want the host pointer to be shown? */
74 uint32_t fHostCursorRequested;
75
76 /** Alignment padding. */
77 uint32_t u32Alignment0;
78
79 /** Pointer to device instance. */
80 PPDMDEVINSR3 pDevIns;
81 /** LUN\#0 + Status: VMMDev port base interface. */
82 PDMIBASE IBase;
83 /** LUN\#0: VMMDev port interface. */
84 PDMIVMMDEVPORT IPort;
85#ifdef VBOX_WITH_HGCM
86 /** LUN\#0: HGCM port interface. */
87 PDMIHGCMPORT IHGCMPort;
88#endif
89 /** Pointer to base interface of the driver. */
90 R3PTRTYPE(PPDMIBASE) pDrvBase;
91 /** VMMDev connector interface */
92 R3PTRTYPE(PPDMIVMMDEVCONNECTOR) pDrv;
93#ifdef VBOX_WITH_HGCM
94 /** HGCM connector interface */
95 R3PTRTYPE(PPDMIHGCMCONNECTOR) pHGCMDrv;
96#endif
97 /** Alignment padding. */
98 RTR3PTR PtrR3Alignment1;
99 /** message buffer for backdoor logging. */
100 char szMsg[512];
101 /** message buffer index. */
102 uint32_t iMsg;
103 /** Base port in the assigned I/O space. */
104 RTIOPORT PortBase;
105 /** Alignment padding. */
106 RTIOPORT PortAlignment2;
107
108 /** IRQ number assigned to the device */
109 uint32_t irq;
110 /** Current host side event flags */
111 uint32_t u32HostEventFlags;
112 /** Mask of events guest is interested in. Note that the HGCM events
113 * are enabled automatically by the VMMDev device when guest issues
114 * HGCM commands.
115 */
116 uint32_t u32GuestFilterMask;
117 /** Delayed mask of guest events */
118 uint32_t u32NewGuestFilterMask;
119 /** Flag whether u32NewGuestFilterMask is valid */
120 bool fNewGuestFilterMask;
121 /** Alignment padding. */
122 bool afAlignment3[3];
123
124 /** GC physical address of VMMDev RAM area */
125 RTGCPHYS32 GCPhysVMMDevRAM;
126 /** R3 pointer to VMMDev RAM area */
127 R3PTRTYPE(VMMDevMemory *) pVMMDevRAMR3;
128
129 /** R3 pointer to VMMDev Heap RAM area
130 */
131 R3PTRTYPE(VMMDevMemory *) pVMMDevHeapR3;
132 /** GC physical address of VMMDev Heap RAM area */
133 RTGCPHYS32 GCPhysVMMDevHeap;
134
135 /** Information reported by guest via VMMDevReportGuestInfo generic request.
136 * Until this information is reported the VMMDev refuses any other requests.
137 */
138 VBoxGuestInfo guestInfo;
139
140 /** Information reported by guest via VMMDevReportGuestCapabilities. */
141 uint32_t guestCaps;
142
143 /** "Additions are Ok" indicator, set to true after processing VMMDevReportGuestInfo,
144 * if additions version is compatible. This flag is here to avoid repeated comparing
145 * of the version in guestInfo.
146 */
147 uint32_t fu32AdditionsOk;
148
149 /** Video acceleration status set by guest. */
150 uint32_t u32VideoAccelEnabled;
151
152 DISPLAYCHANGEDATA displayChangeData;
153
154 /** credentials for guest logon purposes */
155 struct
156 {
157 char szUserName[VMMDEV_CREDENTIALS_STRLEN];
158 char szPassword[VMMDEV_CREDENTIALS_STRLEN];
159 char szDomain[VMMDEV_CREDENTIALS_STRLEN];
160 bool fAllowInteractiveLogon;
161 } credentialsLogon;
162
163 /** credentials for verification by guest */
164 struct
165 {
166 char szUserName[VMMDEV_CREDENTIALS_STRLEN];
167 char szPassword[VMMDEV_CREDENTIALS_STRLEN];
168 char szDomain[VMMDEV_CREDENTIALS_STRLEN];
169 } credentialsJudge;
170
171 bool afAlignment4[HC_ARCH_BITS == 32 ? 7 : 7];
172
173 /* memory balloon change request */
174 uint32_t u32MemoryBalloonSize, u32LastMemoryBalloonSize;
175
176 /* guest ram size */
177 uint64_t cbGuestRAM;
178
179 /* unique session id; the id will be different after each start, reset or restore of the VM. */
180 uint64_t idSession;
181
182 /* statistics interval change request */
183 uint32_t u32StatIntervalSize, u32LastStatIntervalSize;
184
185 /* seamless mode change request */
186 bool fLastSeamlessEnabled, fSeamlessEnabled;
187 bool afAlignment5[1];
188
189 bool fVRDPEnabled;
190 uint32_t u32VRDPExperienceLevel;
191
192#ifdef TIMESYNC_BACKDOOR
193 uint64_t hostTime;
194 bool fTimesyncBackdoorLo;
195 bool afAlignment6[3];
196#endif
197 /** Set if GetHostTime should fail.
198 * Loaded from the GetHostTimeDisabled configuration value. */
199 bool fGetHostTimeDisabled;
200
201 /** Set if backdoor logging should be disabled (output will be ignored then) */
202 bool fBackdoorLogDisabled;
203
204 /** Don't clear credentials */
205 bool fKeepCredentials;
206
207 /** Heap enabled. */
208 bool fHeapEnabled;
209
210#ifdef VBOX_WITH_HGCM
211 /** List of pending HGCM requests, used for saving the HGCM state. */
212 R3PTRTYPE(PVBOXHGCMCMD) pHGCMCmdList;
213 /** Critical section to protect the list. */
214 RTCRITSECT critsectHGCMCmdList;
215 /** Whether the HGCM events are already automatically enabled. */
216 uint32_t u32HGCMEnabled;
217 /** Alignment padding. */
218 uint32_t u32Alignment7;
219#endif /* VBOX_WITH_HGCM */
220
221 /** Status LUN: Shared folders LED */
222 struct
223 {
224 /** The LED. */
225 PDMLED Led;
226 /** The LED ports. */
227 PDMILEDPORTS ILeds;
228 /** Partner of ILeds. */
229 R3PTRTYPE(PPDMILEDCONNECTORS) pLedsConnector;
230 } SharedFolders;
231
232 /** FLag whether CPU hotplug events are monitored */
233 bool fCpuHotPlugEventsEnabled;
234 /** Alignment padding. */
235 bool afPadding8[3];
236 /** CPU hotplug event */
237 VMMDevCpuEventType enmCpuHotPlugEvent;
238 /** Core id of the CPU to change */
239 uint32_t idCpuCore;
240 /** Package id of the CPU to changhe */
241 uint32_t idCpuPackage;
242
243 uint32_t StatMemBalloonChunks;
244
245 /** Set if RC/R0 is enabled. */
246 bool fRZEnabled;
247 /** Set if testing is enabled. */
248 bool fTestingEnabled;
249 /** Alignment padding. */
250 bool afPadding9[HC_ARCH_BITS == 32 ? 2 : 6];
251#ifndef VBOX_WITHOUT_TESTING_FEATURES
252 /** The high timestamp value. */
253 uint32_t u32TestingHighTimestamp;
254 /** The current testing command (VMMDEV_TESTING_CMD_XXX). */
255 uint32_t u32TestingCmd;
256 /** The testing data offset (command specific). */
257 uint32_t offTestingData;
258 /** For buffering the what comes in over the testing data port. */
259 union
260 {
261 char padding[128];
262
263 /** VMMDEV_TESTING_CMD_INIT, VMMDEV_TESTING_CMD_SUB_NEW,
264 * VMMDEV_TESTING_CMD_FAILED. */
265 struct
266 {
267 char sz[128];
268 } String, Init, SubNew, Failed;
269
270 /** VMMDEV_TESTING_CMD_TERM, VMMDEV_TESTING_CMD_SUB_DONE. */
271 struct
272 {
273 uint32_t c;
274 } Error, Term, SubDone;
275
276 /** VMMDEV_TESTING_CMD_VALUE. */
277 struct
278 {
279 RTUINT64U u64Value;
280 uint32_t u32Unit;
281 char szName[128 - 8 - 4];
282 } Value;
283 } TestingData;
284#endif /* !VBOX_WITHOUT_TESTING_FEATURES */
285} VMMDevState;
286AssertCompileMemberAlignment(VMMDevState, CritSect, 8);
287AssertCompileMemberAlignment(VMMDevState, cbGuestRAM, 8);
288AssertCompileMemberAlignment(VMMDevState, enmCpuHotPlugEvent, 4);
289#ifndef VBOX_WITHOUT_TESTING_FEATURES
290AssertCompileMemberAlignment(VMMDevState, TestingData.Value.u64Value, 8);
291#endif
292
293
294void VMMDevNotifyGuest (VMMDevState *pVMMDevState, uint32_t u32EventMask);
295void VMMDevCtlSetGuestFilterMask (VMMDevState *pVMMDevState,
296 uint32_t u32OrMask,
297 uint32_t u32NotMask);
298
299#endif /* !___VMMDev_VMMDevState_h */
300
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