1 | /** @file
|
---|
2 | *
|
---|
3 | * VBox Guest/VMM/host communication:
|
---|
4 | * HGCM - Host-Guest Communication Manager header
|
---|
5 | */
|
---|
6 |
|
---|
7 | /*
|
---|
8 | * Copyright (C) 2006-2007 innotek GmbH
|
---|
9 | *
|
---|
10 | * This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
11 | * available from http://www.virtualbox.org. This file is free software;
|
---|
12 | * you can redistribute it and/or modify it under the terms of the GNU
|
---|
13 | * General Public License as published by the Free Software Foundation,
|
---|
14 | * in version 2 as it comes in the "COPYING" file of the VirtualBox OSE
|
---|
15 | * distribution. VirtualBox OSE is distributed in the hope that it will
|
---|
16 | * be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
17 | *
|
---|
18 | * If you received this file as part of a commercial VirtualBox
|
---|
19 | * distribution, then only the terms of your commercial VirtualBox
|
---|
20 | * license agreement apply instead of the previous paragraph.
|
---|
21 | */
|
---|
22 |
|
---|
23 | #ifndef __VMMDevState_h__
|
---|
24 | #define __VMMDevState_h__
|
---|
25 |
|
---|
26 | #include <VBox/cdefs.h>
|
---|
27 | #include <VBox/types.h>
|
---|
28 |
|
---|
29 | #include <VBox/pdm.h>
|
---|
30 |
|
---|
31 | #define TIMESYNC_BACKDOOR
|
---|
32 |
|
---|
33 | /** device structure containing all state information */
|
---|
34 | typedef struct VMMDevState
|
---|
35 | {
|
---|
36 | /** The PCI device structure. */
|
---|
37 | PCIDevice dev;
|
---|
38 |
|
---|
39 | /** hypervisor address space size */
|
---|
40 | uint32_t hypervisorSize;
|
---|
41 |
|
---|
42 | /** bit 0: guest capability (1 == wants), bit 1: flag value has changed */
|
---|
43 | /** bit 2: host capability (1 == wants), bit 3: flag value has changed */
|
---|
44 | uint32_t mouseCapabilities;
|
---|
45 | /** absolute mouse position in pixels */
|
---|
46 | uint32_t mouseXAbs;
|
---|
47 | uint32_t mouseYAbs;
|
---|
48 |
|
---|
49 | /** Pointer to device instance. */
|
---|
50 | PPDMDEVINS pDevIns;
|
---|
51 | /** VMMDev port base interface. */
|
---|
52 | PDMIBASE Base;
|
---|
53 | /** VMMDev port interface. */
|
---|
54 | PDMIVMMDEVPORT Port;
|
---|
55 | #ifdef VBOX_HGCM
|
---|
56 | /** HGCM port interface. */
|
---|
57 | PDMIHGCMPORT HGCMPort;
|
---|
58 | #endif
|
---|
59 | /** Pointer to base interface of the driver. */
|
---|
60 | PPDMIBASE pDrvBase;
|
---|
61 | /** VMMDev connector interface */
|
---|
62 | PPDMIVMMDEVCONNECTOR pDrv;
|
---|
63 | #ifdef VBOX_HGCM
|
---|
64 | /** HGCM connector interface */
|
---|
65 | PPDMIHGCMCONNECTOR pHGCMDrv;
|
---|
66 | #endif
|
---|
67 | /** message buffer for backdoor logging. */
|
---|
68 | char szMsg[512];
|
---|
69 | /** message buffer index. */
|
---|
70 | unsigned iMsg;
|
---|
71 | /** Base port in the assigned I/O space. */
|
---|
72 | RTIOPORT PortBase;
|
---|
73 |
|
---|
74 | /** IRQ number assigned to the device */
|
---|
75 | uint32_t irq;
|
---|
76 | /** Current host side event flags */
|
---|
77 | uint32_t u32HostEventFlags;
|
---|
78 | /** Mask of events guest is interested in */
|
---|
79 | uint32_t u32GuestFilterMask;
|
---|
80 | /** Delayed mask of guest events */
|
---|
81 | uint32_t u32NewGuestFilterMask;
|
---|
82 | /** Flag whether u32NewGuestFilterMask is valid */
|
---|
83 | bool fNewGuestFilterMask;
|
---|
84 |
|
---|
85 | /** HC pointer to VMMDev RAM area */
|
---|
86 | VMMDevMemory *pVMMDevRAMHC;
|
---|
87 | /** GC physical address of VMMDev RAM area */
|
---|
88 | RTGCPHYS GCPhysVMMDevRAM;
|
---|
89 |
|
---|
90 | /** Information reported by guest via VMMDevReportGuestInfo generic request.
|
---|
91 | * Until this information is reported the VMMDev refuses any other requests.
|
---|
92 | */
|
---|
93 | VBoxGuestInfo guestInfo;
|
---|
94 |
|
---|
95 | /** "Additions are Ok" indicator, set to true after processing VMMDevReportGuestInfo,
|
---|
96 | * if additions version is compatible. This flag is here to avoid repeated comparing
|
---|
97 | * of the version in guestInfo.
|
---|
98 | */
|
---|
99 | uint32_t fu32AdditionsOk;
|
---|
100 |
|
---|
101 | /** Video acceleration status set by guest. */
|
---|
102 | uint32_t u32VideoAccelEnabled;
|
---|
103 |
|
---|
104 | /** resolution change request */
|
---|
105 | struct
|
---|
106 | {
|
---|
107 | uint32_t xres;
|
---|
108 | uint32_t yres;
|
---|
109 | uint32_t bpp;
|
---|
110 | uint32_t display;
|
---|
111 | } displayChangeRequest,
|
---|
112 | lastReadDisplayChangeRequest;
|
---|
113 |
|
---|
114 | /** credentials for guest logon purposes */
|
---|
115 | struct
|
---|
116 | {
|
---|
117 | char szUserName[VMMDEV_CREDENTIALS_STRLEN];
|
---|
118 | char szPassword[VMMDEV_CREDENTIALS_STRLEN];
|
---|
119 | char szDomain[VMMDEV_CREDENTIALS_STRLEN];
|
---|
120 | bool fAllowInteractiveLogon;
|
---|
121 | } credentialsLogon;
|
---|
122 |
|
---|
123 | /** credentials for verification by guest */
|
---|
124 | struct
|
---|
125 | {
|
---|
126 | char szUserName[VMMDEV_CREDENTIALS_STRLEN];
|
---|
127 | char szPassword[VMMDEV_CREDENTIALS_STRLEN];
|
---|
128 | char szDomain[VMMDEV_CREDENTIALS_STRLEN];
|
---|
129 | } credentialsJudge;
|
---|
130 |
|
---|
131 | #ifdef TIMESYNC_BACKDOOR
|
---|
132 | bool fTimesyncBackdoorLo;
|
---|
133 | uint64_t hostTime;
|
---|
134 | #endif
|
---|
135 | /** Set if GetHostTime should fail.
|
---|
136 | * Loaded from the GetHostTimeDisabled configuration value. */
|
---|
137 | bool fGetHostTimeDisabled;
|
---|
138 |
|
---|
139 | /** Set if backdoor logging should be disabled (output will be ignored then) */
|
---|
140 | bool fBackdoorLogDisabled;
|
---|
141 |
|
---|
142 | #ifdef VBOX_HGCM
|
---|
143 | /** List of pending HGCM requests, used for saving the HGCM state. */
|
---|
144 | PVBOXHGCMCMD pHGCMCmdList;
|
---|
145 | /** Critical section to protect the list. */
|
---|
146 | RTCRITSECT critsectHGCMCmdList;
|
---|
147 | #endif /* VBOX_HGCM */
|
---|
148 |
|
---|
149 | } VMMDevState;
|
---|
150 |
|
---|
151 | void VMMDevNotifyGuest (VMMDevState *pVMMDevState, uint32_t u32EventMask);
|
---|
152 |
|
---|
153 | #endif /* __VMMDevState_h__ */
|
---|