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