1 | /* $Id: VMMDevState.h 24076 2009-10-26 13:39:50Z vboxsync $ */
|
---|
2 | /** @file
|
---|
3 | * VMMDev - Guest <-> VMM/Host communication device, internal header.
|
---|
4 | */
|
---|
5 |
|
---|
6 | /*
|
---|
7 | * Copyright (C) 2006-2007 Sun Microsystems, Inc.
|
---|
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 | * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
|
---|
18 | * Clara, CA 95054 USA or visit http://www.sun.com if you need
|
---|
19 | * additional information or have any questions.
|
---|
20 | */
|
---|
21 |
|
---|
22 | #ifndef ___VMMDev_VMMDevState_h
|
---|
23 | #define ___VMMDev_VMMDevState_h
|
---|
24 |
|
---|
25 | #include <VBox/VMMDev.h>
|
---|
26 | #include <VBox/pdmdev.h>
|
---|
27 | #include <VBox/pdmifs.h>
|
---|
28 |
|
---|
29 | #define TIMESYNC_BACKDOOR
|
---|
30 |
|
---|
31 | /** device structure containing all state information */
|
---|
32 | typedef struct VMMDevState
|
---|
33 | {
|
---|
34 | /** The PCI device structure. */
|
---|
35 | PCIDevice dev;
|
---|
36 |
|
---|
37 | /** The critical section for this device. */
|
---|
38 | PDMCRITSECT CritSect;
|
---|
39 |
|
---|
40 | /** hypervisor address space size */
|
---|
41 | uint32_t hypervisorSize;
|
---|
42 |
|
---|
43 | /** mouse capabilities of host and guest */
|
---|
44 | uint32_t mouseCapabilities;
|
---|
45 | /** absolute mouse position in pixels */
|
---|
46 | uint32_t mouseXAbs;
|
---|
47 | uint32_t mouseYAbs;
|
---|
48 | /** Does the guest currently want the host pointer to be shown? */
|
---|
49 | uint32_t fHostCursorRequested;
|
---|
50 |
|
---|
51 | /** Pointer to device instance. */
|
---|
52 | PPDMDEVINSR3 pDevIns;
|
---|
53 | /** VMMDev port base interface. */
|
---|
54 | PDMIBASE Base;
|
---|
55 | /** VMMDev port interface. */
|
---|
56 | PDMIVMMDEVPORT Port;
|
---|
57 | #ifdef VBOX_WITH_HGCM
|
---|
58 | /** HGCM port interface. */
|
---|
59 | PDMIHGCMPORT HGCMPort;
|
---|
60 | #endif
|
---|
61 | /** Pointer to base interface of the driver. */
|
---|
62 | R3PTRTYPE(PPDMIBASE) pDrvBase;
|
---|
63 | /** VMMDev connector interface */
|
---|
64 | R3PTRTYPE(PPDMIVMMDEVCONNECTOR) pDrv;
|
---|
65 | #ifdef VBOX_WITH_HGCM
|
---|
66 | /** HGCM connector interface */
|
---|
67 | R3PTRTYPE(PPDMIHGCMCONNECTOR) pHGCMDrv;
|
---|
68 | #endif
|
---|
69 | /** message buffer for backdoor logging. */
|
---|
70 | char szMsg[512];
|
---|
71 | /** message buffer index. */
|
---|
72 | unsigned iMsg;
|
---|
73 | /** Base port in the assigned I/O space. */
|
---|
74 | RTIOPORT PortBase;
|
---|
75 |
|
---|
76 | /** IRQ number assigned to the device */
|
---|
77 | uint32_t irq;
|
---|
78 | /** Current host side event flags */
|
---|
79 | uint32_t u32HostEventFlags;
|
---|
80 | /** Mask of events guest is interested in. Note that the HGCM events
|
---|
81 | * are enabled automatically by the VMMDev device when guest issues
|
---|
82 | * HGCM commands.
|
---|
83 | */
|
---|
84 | uint32_t u32GuestFilterMask;
|
---|
85 | /** Delayed mask of guest events */
|
---|
86 | uint32_t u32NewGuestFilterMask;
|
---|
87 | /** Flag whether u32NewGuestFilterMask is valid */
|
---|
88 | bool fNewGuestFilterMask;
|
---|
89 |
|
---|
90 | /** R3 pointer to VMMDev RAM area */
|
---|
91 | R3PTRTYPE(VMMDevMemory *) pVMMDevRAMR3;
|
---|
92 | /** GC physical address of VMMDev RAM area */
|
---|
93 | RTGCPHYS32 GCPhysVMMDevRAM;
|
---|
94 |
|
---|
95 | /** R3 pointer to VMMDev Heap RAM area
|
---|
96 | */
|
---|
97 | R3PTRTYPE(VMMDevMemory *) pVMMDevHeapR3;
|
---|
98 | /** GC physical address of VMMDev Heap RAM area */
|
---|
99 | RTGCPHYS32 GCPhysVMMDevHeap;
|
---|
100 |
|
---|
101 | /** Information reported by guest via VMMDevReportGuestInfo generic request.
|
---|
102 | * Until this information is reported the VMMDev refuses any other requests.
|
---|
103 | */
|
---|
104 | VBoxGuestInfo guestInfo;
|
---|
105 |
|
---|
106 | /** Information reported by guest via VMMDevReportGuestCapabilities
|
---|
107 | */
|
---|
108 | uint32_t guestCaps;
|
---|
109 |
|
---|
110 | /** "Additions are Ok" indicator, set to true after processing VMMDevReportGuestInfo,
|
---|
111 | * if additions version is compatible. This flag is here to avoid repeated comparing
|
---|
112 | * of the version in guestInfo.
|
---|
113 | */
|
---|
114 | uint32_t fu32AdditionsOk;
|
---|
115 |
|
---|
116 | /** Video acceleration status set by guest. */
|
---|
117 | uint32_t u32VideoAccelEnabled;
|
---|
118 |
|
---|
119 | /** true if the guest responded to VMMDEV_EVENT_DISPLAY_CHANGE_REQUEST at least once */
|
---|
120 | bool fGuestSentChangeEventAck;
|
---|
121 |
|
---|
122 | /** resolution change request */
|
---|
123 | struct
|
---|
124 | {
|
---|
125 | uint32_t xres;
|
---|
126 | uint32_t yres;
|
---|
127 | uint32_t bpp;
|
---|
128 | uint32_t display;
|
---|
129 | } displayChangeRequest,
|
---|
130 | lastReadDisplayChangeRequest;
|
---|
131 |
|
---|
132 | /** credentials for guest logon purposes */
|
---|
133 | struct
|
---|
134 | {
|
---|
135 | char szUserName[VMMDEV_CREDENTIALS_STRLEN];
|
---|
136 | char szPassword[VMMDEV_CREDENTIALS_STRLEN];
|
---|
137 | char szDomain[VMMDEV_CREDENTIALS_STRLEN];
|
---|
138 | bool fAllowInteractiveLogon;
|
---|
139 | } credentialsLogon;
|
---|
140 |
|
---|
141 | /** credentials for verification by guest */
|
---|
142 | struct
|
---|
143 | {
|
---|
144 | char szUserName[VMMDEV_CREDENTIALS_STRLEN];
|
---|
145 | char szPassword[VMMDEV_CREDENTIALS_STRLEN];
|
---|
146 | char szDomain[VMMDEV_CREDENTIALS_STRLEN];
|
---|
147 | } credentialsJudge;
|
---|
148 |
|
---|
149 | /* memory balloon change request */
|
---|
150 | uint32_t u32MemoryBalloonSize, u32LastMemoryBalloonSize;
|
---|
151 |
|
---|
152 | /* guest ram size */
|
---|
153 | uint64_t cbGuestRAM;
|
---|
154 |
|
---|
155 | /* statistics interval change request */
|
---|
156 | uint32_t u32StatIntervalSize, u32LastStatIntervalSize;
|
---|
157 |
|
---|
158 | /* seamless mode change request */
|
---|
159 | bool fLastSeamlessEnabled, fSeamlessEnabled;
|
---|
160 |
|
---|
161 | bool fVRDPEnabled;
|
---|
162 | uint32_t u32VRDPExperienceLevel;
|
---|
163 |
|
---|
164 | #ifdef TIMESYNC_BACKDOOR
|
---|
165 | bool fTimesyncBackdoorLo;
|
---|
166 | uint64_t hostTime;
|
---|
167 | #endif
|
---|
168 | /** Set if GetHostTime should fail.
|
---|
169 | * Loaded from the GetHostTimeDisabled configuration value. */
|
---|
170 | bool fGetHostTimeDisabled;
|
---|
171 |
|
---|
172 | /** Set if backdoor logging should be disabled (output will be ignored then) */
|
---|
173 | bool fBackdoorLogDisabled;
|
---|
174 |
|
---|
175 | /** Don't clear credentials */
|
---|
176 | bool fKeepCredentials;
|
---|
177 |
|
---|
178 | /** Heap enabled. */
|
---|
179 | bool fHeapEnabled;
|
---|
180 |
|
---|
181 | #ifdef VBOX_WITH_HGCM
|
---|
182 | /** List of pending HGCM requests, used for saving the HGCM state. */
|
---|
183 | R3PTRTYPE(PVBOXHGCMCMD) pHGCMCmdList;
|
---|
184 | /** Critical section to protect the list. */
|
---|
185 | RTCRITSECT critsectHGCMCmdList;
|
---|
186 | /** Whether the HGCM events are already automatically enabled. */
|
---|
187 | uint32_t u32HGCMEnabled;
|
---|
188 | #endif /* VBOX_WITH_HGCM */
|
---|
189 |
|
---|
190 | /* Shared folders LED */
|
---|
191 | struct
|
---|
192 | {
|
---|
193 | /** The LED. */
|
---|
194 | PDMLED Led;
|
---|
195 | /** The LED ports. */
|
---|
196 | PDMILEDPORTS ILeds;
|
---|
197 | /** Partner of ILeds. */
|
---|
198 | R3PTRTYPE(PPDMILEDCONNECTORS) pLedsConnector;
|
---|
199 | } SharedFolders;
|
---|
200 | } VMMDevState;
|
---|
201 | AssertCompileMemberAlignment(VMMDevState, CritSect, 8);
|
---|
202 |
|
---|
203 | void VMMDevNotifyGuest (VMMDevState *pVMMDevState, uint32_t u32EventMask);
|
---|
204 | void VMMDevCtlSetGuestFilterMask (VMMDevState *pVMMDevState,
|
---|
205 | uint32_t u32OrMask,
|
---|
206 | uint32_t u32NotMask);
|
---|
207 |
|
---|
208 | #endif /* !___VMMDev_VMMDevState_h */
|
---|
209 |
|
---|