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