VirtualBox

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

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

VMMDev: Cleanups.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 11.3 KB
Line 
1/* $Id: VMMDevState.h 44709 2013-02-15 01:50:45Z 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 PciDev;
116 /** The critical section for this device.
117 * @remarks We use this rather than the default one, it's simpler with all
118 * the driver interfaces where we have to waste time digging out the
119 * PDMDEVINS structure. */
120 PDMCRITSECT CritSect;
121
122 /** hypervisor address space size */
123 uint32_t hypervisorSize;
124
125 /** mouse capabilities of host and guest */
126 uint32_t mouseCapabilities;
127 /** absolute mouse position in pixels */
128 int32_t mouseXAbs;
129 int32_t mouseYAbs;
130 /** Does the guest currently want the host pointer to be shown? */
131 uint32_t fHostCursorRequested;
132
133 /** Alignment padding. */
134 uint32_t u32Alignment0;
135
136 /** Pointer to device instance. */
137 PPDMDEVINSR3 pDevIns;
138 /** LUN\#0 + Status: VMMDev port base interface. */
139 PDMIBASE IBase;
140 /** LUN\#0: VMMDev port interface. */
141 PDMIVMMDEVPORT IPort;
142#ifdef VBOX_WITH_HGCM
143 /** LUN\#0: HGCM port interface. */
144 PDMIHGCMPORT IHGCMPort;
145#endif
146 /** Pointer to base interface of the driver. */
147 R3PTRTYPE(PPDMIBASE) pDrvBase;
148 /** VMMDev connector interface */
149 R3PTRTYPE(PPDMIVMMDEVCONNECTOR) pDrv;
150#ifdef VBOX_WITH_HGCM
151 /** HGCM connector interface */
152 R3PTRTYPE(PPDMIHGCMCONNECTOR) pHGCMDrv;
153#endif
154 /** Alignment padding. */
155 RTR3PTR PtrR3Alignment1;
156 /** message buffer for backdoor logging. */
157 char szMsg[512];
158 /** message buffer index. */
159 uint32_t iMsg;
160 /** Base port in the assigned I/O space. */
161 RTIOPORT PortBase;
162 /** Alignment padding. */
163 RTIOPORT PortAlignment2;
164
165 /** IRQ number assigned to the device */
166 uint32_t irq;
167 /** Current host side event flags */
168 uint32_t u32HostEventFlags;
169 /** Mask of events guest is interested in. Note that the HGCM events
170 * are enabled automatically by the VMMDev device when guest issues
171 * HGCM commands.
172 */
173 uint32_t u32GuestFilterMask;
174 /** Delayed mask of guest events */
175 uint32_t u32NewGuestFilterMask;
176 /** Flag whether u32NewGuestFilterMask is valid */
177 bool fNewGuestFilterMask;
178 /** Alignment padding. */
179 bool afAlignment3[3];
180
181 /** GC physical address of VMMDev RAM area */
182 RTGCPHYS32 GCPhysVMMDevRAM;
183 /** R3 pointer to VMMDev RAM area */
184 R3PTRTYPE(VMMDevMemory *) pVMMDevRAMR3;
185
186 /** R3 pointer to VMMDev Heap RAM area
187 */
188 R3PTRTYPE(VMMDevMemory *) pVMMDevHeapR3;
189 /** GC physical address of VMMDev Heap RAM area */
190 RTGCPHYS32 GCPhysVMMDevHeap;
191
192 /** Information reported by guest via VMMDevReportGuestInfo generic request.
193 * Until this information is reported the VMMDev refuses any other requests.
194 */
195 VBoxGuestInfo guestInfo;
196 /** Information report \#2, chewed a litte. */
197 struct
198 {
199 uint32_t uFullVersion; /**< non-zero if info is present. */
200 uint32_t uRevision;
201 uint32_t fFeatures;
202 char szName[128];
203 } guestInfo2;
204
205 /** Array of guest facility statuses. */
206 VMMDEVFACILITYSTATUSENTRY aFacilityStatuses[32];
207 /** The number of valid entries in the facility status array. */
208 uint32_t cFacilityStatuses;
209
210 /** Information reported by guest via VMMDevReportGuestCapabilities. */
211 uint32_t guestCaps;
212
213 /** "Additions are Ok" indicator, set to true after processing VMMDevReportGuestInfo,
214 * if additions version is compatible. This flag is here to avoid repeated comparing
215 * of the version in guestInfo.
216 */
217 uint32_t fu32AdditionsOk;
218
219 /** Video acceleration status set by guest. */
220 uint32_t u32VideoAccelEnabled;
221
222 DISPLAYCHANGEDATA displayChangeData;
223
224 /** Pointer to the credentials. */
225 R3PTRTYPE(VMMDEVCREDS *) pCredentials;
226
227 bool afAlignment4[HC_ARCH_BITS == 32 ? 3 : 7];
228
229 /* memory balloon change request */
230 uint32_t cMbMemoryBalloon;
231 /** The last balloon size queried by the guest additions. */
232 uint32_t cMbMemoryBalloonLast;
233
234 /* guest ram size */
235 uint64_t cbGuestRAM;
236
237 /* unique session id; the id will be different after each start, reset or restore of the VM. */
238 uint64_t idSession;
239
240 /* statistics interval change request */
241 uint32_t u32StatIntervalSize, u32LastStatIntervalSize;
242
243 /* seamless mode change request */
244 bool fLastSeamlessEnabled, fSeamlessEnabled;
245 bool afAlignment5[1];
246
247 bool fVRDPEnabled;
248 uint32_t uVRDPExperienceLevel;
249
250#ifdef TIMESYNC_BACKDOOR
251 uint64_t hostTime;
252 bool fTimesyncBackdoorLo;
253 bool afAlignment6[3];
254#endif
255 /** Set if GetHostTime should fail.
256 * Loaded from the GetHostTimeDisabled configuration value. */
257 bool fGetHostTimeDisabled;
258
259 /** Set if backdoor logging should be disabled (output will be ignored then) */
260 bool fBackdoorLogDisabled;
261
262 /** Don't clear credentials */
263 bool fKeepCredentials;
264
265 /** Heap enabled. */
266 bool fHeapEnabled;
267
268 /** Guest Core Dumping enabled. */
269 bool fGuestCoreDumpEnabled;
270
271 /** Guest Core Dump location. */
272 char szGuestCoreDumpDir[RTPATH_MAX];
273
274 /** Number of additional cores to keep around. */
275 uint32_t cGuestCoreDumps;
276
277 bool afAlignment7[1];
278
279#ifdef VBOX_WITH_HGCM
280 /** List of pending HGCM requests, used for saving the HGCM state. */
281 R3PTRTYPE(PVBOXHGCMCMD) pHGCMCmdList;
282 /** Critical section to protect the list. */
283 RTCRITSECT critsectHGCMCmdList;
284 /** Whether the HGCM events are already automatically enabled. */
285 uint32_t u32HGCMEnabled;
286 /** Alignment padding. */
287 uint32_t u32Alignment7;
288#endif /* VBOX_WITH_HGCM */
289
290 /** Status LUN: Shared folders LED */
291 struct
292 {
293 /** The LED. */
294 PDMLED Led;
295 /** The LED ports. */
296 PDMILEDPORTS ILeds;
297 /** Partner of ILeds. */
298 R3PTRTYPE(PPDMILEDCONNECTORS) pLedsConnector;
299 } SharedFolders;
300
301 /** FLag whether CPU hotplug events are monitored */
302 bool fCpuHotPlugEventsEnabled;
303 /** Alignment padding. */
304 bool afPadding8[3];
305 /** CPU hotplug event */
306 VMMDevCpuEventType enmCpuHotPlugEvent;
307 /** Core id of the CPU to change */
308 uint32_t idCpuCore;
309 /** Package id of the CPU to change */
310 uint32_t idCpuPackage;
311
312 uint32_t StatMemBalloonChunks;
313
314 /** Set if RC/R0 is enabled. */
315 bool fRZEnabled;
316 /** Set if testing is enabled. */
317 bool fTestingEnabled;
318 /** Alignment padding. */
319 bool afPadding9[HC_ARCH_BITS == 32 ? 2 : 6];
320#ifndef VBOX_WITHOUT_TESTING_FEATURES
321 /** The high timestamp value. */
322 uint32_t u32TestingHighTimestamp;
323 /** The current testing command (VMMDEV_TESTING_CMD_XXX). */
324 uint32_t u32TestingCmd;
325 /** The testing data offset (command specific). */
326 uint32_t offTestingData;
327 /** For buffering the what comes in over the testing data port. */
328 union
329 {
330 char padding[1024];
331
332 /** VMMDEV_TESTING_CMD_INIT, VMMDEV_TESTING_CMD_SUB_NEW,
333 * VMMDEV_TESTING_CMD_FAILED. */
334 struct
335 {
336 char sz[1024];
337 } String, Init, SubNew, Failed;
338
339 /** VMMDEV_TESTING_CMD_TERM, VMMDEV_TESTING_CMD_SUB_DONE. */
340 struct
341 {
342 uint32_t c;
343 } Error, Term, SubDone;
344
345 /** VMMDEV_TESTING_CMD_VALUE. */
346 struct
347 {
348 RTUINT64U u64Value;
349 uint32_t u32Unit;
350 char szName[1024 - 8 - 4];
351 } Value;
352 } TestingData;
353#endif /* !VBOX_WITHOUT_TESTING_FEATURES */
354} VMMDevState;
355typedef VMMDevState VMMDEV;
356/** Pointer to the VMM device state. */
357typedef VMMDEV *PVMMDEV;
358AssertCompileMemberAlignment(VMMDEV, CritSect, 8);
359AssertCompileMemberAlignment(VMMDEV, cbGuestRAM, 8);
360AssertCompileMemberAlignment(VMMDEV, enmCpuHotPlugEvent, 4);
361AssertCompileMemberAlignment(VMMDEV, aFacilityStatuses, 8);
362#ifndef VBOX_WITHOUT_TESTING_FEATURES
363AssertCompileMemberAlignment(VMMDEV, TestingData.Value.u64Value, 8);
364#endif
365
366
367void VMMDevNotifyGuest(VMMDEV *pVMMDevState, uint32_t u32EventMask);
368void VMMDevCtlSetGuestFilterMask(VMMDEV *pVMMDevState, uint32_t u32OrMask, uint32_t u32NotMask);
369
370#endif /* !___VMMDev_VMMDevState_h */
371
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