VirtualBox

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

Last change on this file since 44591 was 44528, checked in by vboxsync, 12 years ago

header (C) fixes

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 11.1 KB
Line 
1/* $Id: VMMDevState.h 44528 2013-02-04 14:27:54Z vboxsync $ */
2/** @file
3 * VMMDev - Guest <-> VMM/Host communication device, internal header.
4 */
5
6/*
7 * Copyright (C) 2006-2012 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/vmm/pdmdev.h>
23#include <VBox/vmm/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 uint32_t xOrigin;
34 uint32_t yOrigin;
35 bool fEnabled;
36 bool fChangeOrigin;
37} DISPLAYCHANGEINFO;
38
39typedef struct DISPLAYCHANGEREQUEST
40{
41 bool fPending;
42 bool afAlignment[3];
43 DISPLAYCHANGEINFO displayChangeRequest;
44 DISPLAYCHANGEINFO lastReadDisplayChangeRequest;
45} DISPLAYCHANGEREQUEST;
46
47typedef struct DISPLAYCHANGEDATA
48{
49 /* Which monitor is being reported to the guest. */
50 int iCurrentMonitor;
51
52 /** true if the guest responded to VMMDEV_EVENT_DISPLAY_CHANGE_REQUEST at least once */
53 bool fGuestSentChangeEventAck;
54 bool afAlignment[3];
55
56 DISPLAYCHANGEREQUEST aRequests[64]; // @todo maxMonitors
57} DISPLAYCHANGEDATA;
58
59
60/**
61 * Credentials for automatic guest logon and host configured logon (?).
62 *
63 * This is not stored in the same block as the instance data in order to make it
64 * harder to access.
65 */
66typedef struct VMMDEVCREDS
67{
68 /** credentials for guest logon purposes */
69 struct
70 {
71 char szUserName[VMMDEV_CREDENTIALS_SZ_SIZE];
72 char szPassword[VMMDEV_CREDENTIALS_SZ_SIZE];
73 char szDomain[VMMDEV_CREDENTIALS_SZ_SIZE];
74 bool fAllowInteractiveLogon;
75 } Logon;
76
77 /** credentials for verification by guest */
78 struct
79 {
80 char szUserName[VMMDEV_CREDENTIALS_SZ_SIZE];
81 char szPassword[VMMDEV_CREDENTIALS_SZ_SIZE];
82 char szDomain[VMMDEV_CREDENTIALS_SZ_SIZE];
83 } Judge;
84} VMMDEVCREDS;
85
86
87/**
88 * Facility status entry.
89 */
90typedef struct VMMDEVFACILITYSTATUSENTRY
91{
92 /** The facility, see VBoxGuestFacilityType. */
93 uint32_t uFacility;
94 /** The status, see VBoxGuestFacilityStatus. */
95 uint16_t uStatus;
96 /** Whether this entry is fixed and cannot be reused when inactive. */
97 bool fFixed;
98 /** Explicit alignment padding / reserved for future use. MBZ. */
99 bool fPadding;
100 /** The facility flags (yet to be defined). */
101 uint32_t fFlags;
102 /** Explicit alignment padding / reserved for future use. MBZ. */
103 uint32_t uPadding;
104 /** Last update timestamp. */
105 RTTIMESPEC TimeSpecTS;
106} VMMDEVFACILITYSTATUSENTRY;
107/** Pointer to a facility status entry. */
108typedef VMMDEVFACILITYSTATUSENTRY *PVMMDEVFACILITYSTATUSENTRY;
109
110
111/** device structure containing all state information */
112typedef struct VMMDevState
113{
114 /** The PCI device structure. */
115 PCIDevice dev;
116
117 /** The critical section for this device. */
118 PDMCRITSECT CritSect;
119
120 /** hypervisor address space size */
121 uint32_t hypervisorSize;
122
123 /** mouse capabilities of host and guest */
124 uint32_t mouseCapabilities;
125 /** absolute mouse position in pixels */
126 int32_t mouseXAbs;
127 int32_t mouseYAbs;
128 /** Does the guest currently want the host pointer to be shown? */
129 uint32_t fHostCursorRequested;
130
131 /** Alignment padding. */
132 uint32_t u32Alignment0;
133
134 /** Pointer to device instance. */
135 PPDMDEVINSR3 pDevIns;
136 /** LUN\#0 + Status: VMMDev port base interface. */
137 PDMIBASE IBase;
138 /** LUN\#0: VMMDev port interface. */
139 PDMIVMMDEVPORT IPort;
140#ifdef VBOX_WITH_HGCM
141 /** LUN\#0: HGCM port interface. */
142 PDMIHGCMPORT IHGCMPort;
143#endif
144 /** Pointer to base interface of the driver. */
145 R3PTRTYPE(PPDMIBASE) pDrvBase;
146 /** VMMDev connector interface */
147 R3PTRTYPE(PPDMIVMMDEVCONNECTOR) pDrv;
148#ifdef VBOX_WITH_HGCM
149 /** HGCM connector interface */
150 R3PTRTYPE(PPDMIHGCMCONNECTOR) pHGCMDrv;
151#endif
152 /** Alignment padding. */
153 RTR3PTR PtrR3Alignment1;
154 /** message buffer for backdoor logging. */
155 char szMsg[512];
156 /** message buffer index. */
157 uint32_t iMsg;
158 /** Base port in the assigned I/O space. */
159 RTIOPORT PortBase;
160 /** Alignment padding. */
161 RTIOPORT PortAlignment2;
162
163 /** IRQ number assigned to the device */
164 uint32_t irq;
165 /** Current host side event flags */
166 uint32_t u32HostEventFlags;
167 /** Mask of events guest is interested in. Note that the HGCM events
168 * are enabled automatically by the VMMDev device when guest issues
169 * HGCM commands.
170 */
171 uint32_t u32GuestFilterMask;
172 /** Delayed mask of guest events */
173 uint32_t u32NewGuestFilterMask;
174 /** Flag whether u32NewGuestFilterMask is valid */
175 bool fNewGuestFilterMask;
176 /** Alignment padding. */
177 bool afAlignment3[3];
178
179 /** GC physical address of VMMDev RAM area */
180 RTGCPHYS32 GCPhysVMMDevRAM;
181 /** R3 pointer to VMMDev RAM area */
182 R3PTRTYPE(VMMDevMemory *) pVMMDevRAMR3;
183
184 /** R3 pointer to VMMDev Heap RAM area
185 */
186 R3PTRTYPE(VMMDevMemory *) pVMMDevHeapR3;
187 /** GC physical address of VMMDev Heap RAM area */
188 RTGCPHYS32 GCPhysVMMDevHeap;
189
190 /** Information reported by guest via VMMDevReportGuestInfo generic request.
191 * Until this information is reported the VMMDev refuses any other requests.
192 */
193 VBoxGuestInfo guestInfo;
194 /** Information report \#2, chewed a litte. */
195 struct
196 {
197 uint32_t uFullVersion; /**< non-zero if info is present. */
198 uint32_t uRevision;
199 uint32_t fFeatures;
200 char szName[128];
201 } guestInfo2;
202
203 /** Array of guest facility statuses. */
204 VMMDEVFACILITYSTATUSENTRY aFacilityStatuses[32];
205 /** The number of valid entries in the facility status array. */
206 uint32_t cFacilityStatuses;
207
208 /** Information reported by guest via VMMDevReportGuestCapabilities. */
209 uint32_t guestCaps;
210
211 /** "Additions are Ok" indicator, set to true after processing VMMDevReportGuestInfo,
212 * if additions version is compatible. This flag is here to avoid repeated comparing
213 * of the version in guestInfo.
214 */
215 uint32_t fu32AdditionsOk;
216
217 /** Video acceleration status set by guest. */
218 uint32_t u32VideoAccelEnabled;
219
220 DISPLAYCHANGEDATA displayChangeData;
221
222 /** Pointer to the credentials. */
223 R3PTRTYPE(VMMDEVCREDS *) pCredentials;
224
225 bool afAlignment4[HC_ARCH_BITS == 32 ? 3 : 7];
226
227 /* memory balloon change request */
228 uint32_t u32MemoryBalloonSize, u32LastMemoryBalloonSize;
229
230 /* guest ram size */
231 uint64_t cbGuestRAM;
232
233 /* unique session id; the id will be different after each start, reset or restore of the VM. */
234 uint64_t idSession;
235
236 /* statistics interval change request */
237 uint32_t u32StatIntervalSize, u32LastStatIntervalSize;
238
239 /* seamless mode change request */
240 bool fLastSeamlessEnabled, fSeamlessEnabled;
241 bool afAlignment5[1];
242
243 bool fVRDPEnabled;
244 uint32_t u32VRDPExperienceLevel;
245
246#ifdef TIMESYNC_BACKDOOR
247 uint64_t hostTime;
248 bool fTimesyncBackdoorLo;
249 bool afAlignment6[3];
250#endif
251 /** Set if GetHostTime should fail.
252 * Loaded from the GetHostTimeDisabled configuration value. */
253 bool fGetHostTimeDisabled;
254
255 /** Set if backdoor logging should be disabled (output will be ignored then) */
256 bool fBackdoorLogDisabled;
257
258 /** Don't clear credentials */
259 bool fKeepCredentials;
260
261 /** Heap enabled. */
262 bool fHeapEnabled;
263
264 /** Guest Core Dumping enabled. */
265 bool fGuestCoreDumpEnabled;
266
267 /** Guest Core Dump location. */
268 char szGuestCoreDumpDir[RTPATH_MAX];
269
270 /** Number of additional cores to keep around. */
271 uint32_t cGuestCoreDumps;
272
273 bool afAlignment7[1];
274
275#ifdef VBOX_WITH_HGCM
276 /** List of pending HGCM requests, used for saving the HGCM state. */
277 R3PTRTYPE(PVBOXHGCMCMD) pHGCMCmdList;
278 /** Critical section to protect the list. */
279 RTCRITSECT critsectHGCMCmdList;
280 /** Whether the HGCM events are already automatically enabled. */
281 uint32_t u32HGCMEnabled;
282 /** Alignment padding. */
283 uint32_t u32Alignment7;
284#endif /* VBOX_WITH_HGCM */
285
286 /** Status LUN: Shared folders LED */
287 struct
288 {
289 /** The LED. */
290 PDMLED Led;
291 /** The LED ports. */
292 PDMILEDPORTS ILeds;
293 /** Partner of ILeds. */
294 R3PTRTYPE(PPDMILEDCONNECTORS) pLedsConnector;
295 } SharedFolders;
296
297 /** FLag whether CPU hotplug events are monitored */
298 bool fCpuHotPlugEventsEnabled;
299 /** Alignment padding. */
300 bool afPadding8[3];
301 /** CPU hotplug event */
302 VMMDevCpuEventType enmCpuHotPlugEvent;
303 /** Core id of the CPU to change */
304 uint32_t idCpuCore;
305 /** Package id of the CPU to change */
306 uint32_t idCpuPackage;
307
308 uint32_t StatMemBalloonChunks;
309
310 /** Set if RC/R0 is enabled. */
311 bool fRZEnabled;
312 /** Set if testing is enabled. */
313 bool fTestingEnabled;
314 /** Alignment padding. */
315 bool afPadding9[HC_ARCH_BITS == 32 ? 2 : 6];
316#ifndef VBOX_WITHOUT_TESTING_FEATURES
317 /** The high timestamp value. */
318 uint32_t u32TestingHighTimestamp;
319 /** The current testing command (VMMDEV_TESTING_CMD_XXX). */
320 uint32_t u32TestingCmd;
321 /** The testing data offset (command specific). */
322 uint32_t offTestingData;
323 /** For buffering the what comes in over the testing data port. */
324 union
325 {
326 char padding[1024];
327
328 /** VMMDEV_TESTING_CMD_INIT, VMMDEV_TESTING_CMD_SUB_NEW,
329 * VMMDEV_TESTING_CMD_FAILED. */
330 struct
331 {
332 char sz[1024];
333 } String, Init, SubNew, Failed;
334
335 /** VMMDEV_TESTING_CMD_TERM, VMMDEV_TESTING_CMD_SUB_DONE. */
336 struct
337 {
338 uint32_t c;
339 } Error, Term, SubDone;
340
341 /** VMMDEV_TESTING_CMD_VALUE. */
342 struct
343 {
344 RTUINT64U u64Value;
345 uint32_t u32Unit;
346 char szName[1024 - 8 - 4];
347 } Value;
348 } TestingData;
349#endif /* !VBOX_WITHOUT_TESTING_FEATURES */
350} VMMDevState;
351AssertCompileMemberAlignment(VMMDevState, CritSect, 8);
352AssertCompileMemberAlignment(VMMDevState, cbGuestRAM, 8);
353AssertCompileMemberAlignment(VMMDevState, enmCpuHotPlugEvent, 4);
354AssertCompileMemberAlignment(VMMDevState, aFacilityStatuses, 8);
355#ifndef VBOX_WITHOUT_TESTING_FEATURES
356AssertCompileMemberAlignment(VMMDevState, TestingData.Value.u64Value, 8);
357#endif
358
359
360void VMMDevNotifyGuest (VMMDevState *pVMMDevState, uint32_t u32EventMask);
361void VMMDevCtlSetGuestFilterMask (VMMDevState *pVMMDevState,
362 uint32_t u32OrMask,
363 uint32_t u32NotMask);
364
365#endif /* !___VMMDev_VMMDevState_h */
366
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