1 | /** @file
|
---|
2 | * PDM - Pluggable Device Manager, Interfaces.
|
---|
3 | */
|
---|
4 |
|
---|
5 | /*
|
---|
6 | * Copyright (C) 2006-2019 Oracle Corporation
|
---|
7 | *
|
---|
8 | * This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
9 | * available from http://www.virtualbox.org. This file is free software;
|
---|
10 | * you can redistribute it and/or modify it under the terms of the GNU
|
---|
11 | * General Public License (GPL) as published by the Free Software
|
---|
12 | * Foundation, in version 2 as it comes in the "COPYING" file of the
|
---|
13 | * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
|
---|
14 | * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
15 | *
|
---|
16 | * The contents of this file may alternatively be used under the terms
|
---|
17 | * of the Common Development and Distribution License Version 1.0
|
---|
18 | * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
|
---|
19 | * VirtualBox OSE distribution, in which case the provisions of the
|
---|
20 | * CDDL are applicable instead of those of the GPL.
|
---|
21 | *
|
---|
22 | * You may elect to license modified versions of this file under the
|
---|
23 | * terms and conditions of either the GPL or the CDDL or both.
|
---|
24 | */
|
---|
25 |
|
---|
26 | #ifndef VBOX_INCLUDED_vmm_pdmifs_h
|
---|
27 | #define VBOX_INCLUDED_vmm_pdmifs_h
|
---|
28 | #ifndef RT_WITHOUT_PRAGMA_ONCE
|
---|
29 | # pragma once
|
---|
30 | #endif
|
---|
31 |
|
---|
32 | #include <iprt/sg.h>
|
---|
33 | #include <VBox/types.h>
|
---|
34 |
|
---|
35 |
|
---|
36 | RT_C_DECLS_BEGIN
|
---|
37 |
|
---|
38 | /** @defgroup grp_pdm_interfaces The PDM Interface Definitions
|
---|
39 | * @ingroup grp_pdm
|
---|
40 | *
|
---|
41 | * For historical reasons (the PDMINTERFACE enum) a lot of interface was stuffed
|
---|
42 | * together in this group instead, dragging stuff into global space that didn't
|
---|
43 | * need to be there and making this file huge (>2500 lines). Since we're using
|
---|
44 | * UUIDs as interface identifiers (IIDs) now, no only generic PDM interface will
|
---|
45 | * be added to this file. Component specific interface should be defined in the
|
---|
46 | * header file of that component.
|
---|
47 | *
|
---|
48 | * Interfaces consists of a method table (typedef'ed struct) and an interface
|
---|
49 | * ID. The typename of the method table should have an 'I' in it, be all
|
---|
50 | * capitals and according to the rules, no underscores. The interface ID is a
|
---|
51 | * \#define constructed by appending '_IID' to the typename. The IID value is a
|
---|
52 | * UUID string on the form "a2299c0d-b709-4551-aa5a-73f59ffbed74". If you stick
|
---|
53 | * to these rules, you can make use of the PDMIBASE_QUERY_INTERFACE and
|
---|
54 | * PDMIBASE_RETURN_INTERFACE when querying interface and implementing
|
---|
55 | * PDMIBASE::pfnQueryInterface respectively.
|
---|
56 | *
|
---|
57 | * In most interface descriptions the orientation of the interface is given as
|
---|
58 | * 'down' or 'up'. This refers to a model with the device on the top and the
|
---|
59 | * drivers stacked below it. Sometimes there is mention of 'main' or 'external'
|
---|
60 | * which normally means the same, i.e. the Main or VBoxBFE API. Picture the
|
---|
61 | * orientation of 'main' as horizontal.
|
---|
62 | *
|
---|
63 | * @{
|
---|
64 | */
|
---|
65 |
|
---|
66 |
|
---|
67 | /** @name PDMIBASE
|
---|
68 | * @{
|
---|
69 | */
|
---|
70 |
|
---|
71 | /**
|
---|
72 | * PDM Base Interface.
|
---|
73 | *
|
---|
74 | * Everyone implements this.
|
---|
75 | */
|
---|
76 | typedef struct PDMIBASE
|
---|
77 | {
|
---|
78 | /**
|
---|
79 | * Queries an interface to the driver.
|
---|
80 | *
|
---|
81 | * @returns Pointer to interface.
|
---|
82 | * @returns NULL if the interface was not supported by the driver.
|
---|
83 | * @param pInterface Pointer to this interface structure.
|
---|
84 | * @param pszIID The interface ID, a UUID string.
|
---|
85 | * @thread Any thread.
|
---|
86 | */
|
---|
87 | DECLR3CALLBACKMEMBER(void *, pfnQueryInterface,(struct PDMIBASE *pInterface, const char *pszIID));
|
---|
88 | } PDMIBASE;
|
---|
89 | /** PDMIBASE interface ID. */
|
---|
90 | #define PDMIBASE_IID "a2299c0d-b709-4551-aa5a-73f59ffbed74"
|
---|
91 |
|
---|
92 | /**
|
---|
93 | * Helper macro for querying an interface from PDMIBASE.
|
---|
94 | *
|
---|
95 | * @returns Correctly typed PDMIBASE::pfnQueryInterface return value.
|
---|
96 | *
|
---|
97 | * @param pIBase Pointer to the base interface.
|
---|
98 | * @param InterfaceType The interface type name. The interface ID is
|
---|
99 | * derived from this by appending _IID.
|
---|
100 | */
|
---|
101 | #define PDMIBASE_QUERY_INTERFACE(pIBase, InterfaceType) \
|
---|
102 | ( (InterfaceType *)(pIBase)->pfnQueryInterface(pIBase, InterfaceType##_IID ) )
|
---|
103 |
|
---|
104 | /**
|
---|
105 | * Helper macro for implementing PDMIBASE::pfnQueryInterface.
|
---|
106 | *
|
---|
107 | * Return @a pInterface if @a pszIID matches the @a InterfaceType. This will
|
---|
108 | * perform basic type checking.
|
---|
109 | *
|
---|
110 | * @param pszIID The ID of the interface that is being queried.
|
---|
111 | * @param InterfaceType The interface type name. The interface ID is
|
---|
112 | * derived from this by appending _IID.
|
---|
113 | * @param pInterface The interface address expression.
|
---|
114 | */
|
---|
115 | #define PDMIBASE_RETURN_INTERFACE(pszIID, InterfaceType, pInterface) \
|
---|
116 | do { \
|
---|
117 | if (RTUuidCompare2Strs((pszIID), InterfaceType##_IID) == 0) \
|
---|
118 | { \
|
---|
119 | P##InterfaceType pReturnInterfaceTypeCheck = (pInterface); \
|
---|
120 | return pReturnInterfaceTypeCheck; \
|
---|
121 | } \
|
---|
122 | } while (0)
|
---|
123 |
|
---|
124 | /** @} */
|
---|
125 |
|
---|
126 |
|
---|
127 | /** @name PDMIBASERC
|
---|
128 | * @{
|
---|
129 | */
|
---|
130 |
|
---|
131 | /**
|
---|
132 | * PDM Base Interface for querying ring-mode context interfaces in
|
---|
133 | * ring-3.
|
---|
134 | *
|
---|
135 | * This is mandatory for drivers present in raw-mode context.
|
---|
136 | */
|
---|
137 | typedef struct PDMIBASERC
|
---|
138 | {
|
---|
139 | /**
|
---|
140 | * Queries an ring-mode context interface to the driver.
|
---|
141 | *
|
---|
142 | * @returns Pointer to interface.
|
---|
143 | * @returns NULL if the interface was not supported by the driver.
|
---|
144 | * @param pInterface Pointer to this interface structure.
|
---|
145 | * @param pszIID The interface ID, a UUID string.
|
---|
146 | * @thread Any thread.
|
---|
147 | */
|
---|
148 | DECLR3CALLBACKMEMBER(RTRCPTR, pfnQueryInterface,(struct PDMIBASERC *pInterface, const char *pszIID));
|
---|
149 | } PDMIBASERC;
|
---|
150 | /** Pointer to a PDM Base Interface for query ring-mode context interfaces. */
|
---|
151 | typedef PDMIBASERC *PPDMIBASERC;
|
---|
152 | /** PDMIBASERC interface ID. */
|
---|
153 | #define PDMIBASERC_IID "f6a6c649-6cb3-493f-9737-4653f221aeca"
|
---|
154 |
|
---|
155 | /**
|
---|
156 | * Helper macro for querying an interface from PDMIBASERC.
|
---|
157 | *
|
---|
158 | * @returns PDMIBASERC::pfnQueryInterface return value.
|
---|
159 | *
|
---|
160 | * @param pIBaseRC Pointer to the base raw-mode context interface. Can
|
---|
161 | * be NULL.
|
---|
162 | * @param InterfaceType The interface type base name, no trailing RC. The
|
---|
163 | * interface ID is derived from this by appending _IID.
|
---|
164 | *
|
---|
165 | * @remarks Unlike PDMIBASE_QUERY_INTERFACE, this macro is not able to do any
|
---|
166 | * implicit type checking for you.
|
---|
167 | */
|
---|
168 | #define PDMIBASERC_QUERY_INTERFACE(pIBaseRC, InterfaceType) \
|
---|
169 | ( (P##InterfaceType##RC)((pIBaseRC) ? (pIBaseRC)->pfnQueryInterface(pIBaseRC, InterfaceType##_IID) : NIL_RTRCPTR) )
|
---|
170 |
|
---|
171 | /**
|
---|
172 | * Helper macro for implementing PDMIBASERC::pfnQueryInterface.
|
---|
173 | *
|
---|
174 | * Return @a pInterface if @a pszIID matches the @a InterfaceType. This will
|
---|
175 | * perform basic type checking.
|
---|
176 | *
|
---|
177 | * @param pIns Pointer to the instance data.
|
---|
178 | * @param pszIID The ID of the interface that is being queried.
|
---|
179 | * @param InterfaceType The interface type base name, no trailing RC. The
|
---|
180 | * interface ID is derived from this by appending _IID.
|
---|
181 | * @param pInterface The interface address expression. This must resolve
|
---|
182 | * to some address within the instance data.
|
---|
183 | * @remarks Don't use with PDMIBASE.
|
---|
184 | */
|
---|
185 | #define PDMIBASERC_RETURN_INTERFACE(pIns, pszIID, InterfaceType, pInterface) \
|
---|
186 | do { \
|
---|
187 | Assert((uintptr_t)pInterface - PDMINS_2_DATA(pIns, uintptr_t) < _4M); \
|
---|
188 | if (RTUuidCompare2Strs((pszIID), InterfaceType##_IID) == 0) \
|
---|
189 | { \
|
---|
190 | InterfaceType##RC *pReturnInterfaceTypeCheck = (pInterface); \
|
---|
191 | return (uintptr_t)pReturnInterfaceTypeCheck \
|
---|
192 | - PDMINS_2_DATA(pIns, uintptr_t) \
|
---|
193 | + PDMINS_2_DATA_RCPTR(pIns); \
|
---|
194 | } \
|
---|
195 | } while (0)
|
---|
196 |
|
---|
197 | /** @} */
|
---|
198 |
|
---|
199 |
|
---|
200 | /** @name PDMIBASER0
|
---|
201 | * @{
|
---|
202 | */
|
---|
203 |
|
---|
204 | /**
|
---|
205 | * PDM Base Interface for querying ring-0 interfaces in ring-3.
|
---|
206 | *
|
---|
207 | * This is mandatory for drivers present in ring-0 context.
|
---|
208 | */
|
---|
209 | typedef struct PDMIBASER0
|
---|
210 | {
|
---|
211 | /**
|
---|
212 | * Queries an ring-0 interface to the driver.
|
---|
213 | *
|
---|
214 | * @returns Pointer to interface.
|
---|
215 | * @returns NULL if the interface was not supported by the driver.
|
---|
216 | * @param pInterface Pointer to this interface structure.
|
---|
217 | * @param pszIID The interface ID, a UUID string.
|
---|
218 | * @thread Any thread.
|
---|
219 | */
|
---|
220 | DECLR3CALLBACKMEMBER(RTR0PTR, pfnQueryInterface,(struct PDMIBASER0 *pInterface, const char *pszIID));
|
---|
221 | } PDMIBASER0;
|
---|
222 | /** Pointer to a PDM Base Interface for query ring-0 context interfaces. */
|
---|
223 | typedef PDMIBASER0 *PPDMIBASER0;
|
---|
224 | /** PDMIBASER0 interface ID. */
|
---|
225 | #define PDMIBASER0_IID "9c9b99b8-7f53-4f59-a3c2-5bc9659c7944"
|
---|
226 |
|
---|
227 | /**
|
---|
228 | * Helper macro for querying an interface from PDMIBASER0.
|
---|
229 | *
|
---|
230 | * @returns PDMIBASER0::pfnQueryInterface return value.
|
---|
231 | *
|
---|
232 | * @param pIBaseR0 Pointer to the base ring-0 interface. Can be NULL.
|
---|
233 | * @param InterfaceType The interface type base name, no trailing R0. The
|
---|
234 | * interface ID is derived from this by appending _IID.
|
---|
235 | *
|
---|
236 | * @remarks Unlike PDMIBASE_QUERY_INTERFACE, this macro is not able to do any
|
---|
237 | * implicit type checking for you.
|
---|
238 | */
|
---|
239 | #define PDMIBASER0_QUERY_INTERFACE(pIBaseR0, InterfaceType) \
|
---|
240 | ( (P##InterfaceType##R0)((pIBaseR0) ? (pIBaseR0)->pfnQueryInterface(pIBaseR0, InterfaceType##_IID) : NIL_RTR0PTR) )
|
---|
241 |
|
---|
242 | /**
|
---|
243 | * Helper macro for implementing PDMIBASER0::pfnQueryInterface.
|
---|
244 | *
|
---|
245 | * Return @a pInterface if @a pszIID matches the @a InterfaceType. This will
|
---|
246 | * perform basic type checking.
|
---|
247 | *
|
---|
248 | * @param pIns Pointer to the instance data.
|
---|
249 | * @param pszIID The ID of the interface that is being queried.
|
---|
250 | * @param InterfaceType The interface type base name, no trailing R0. The
|
---|
251 | * interface ID is derived from this by appending _IID.
|
---|
252 | * @param pInterface The interface address expression. This must resolve
|
---|
253 | * to some address within the instance data.
|
---|
254 | * @remarks Don't use with PDMIBASE.
|
---|
255 | */
|
---|
256 | #define PDMIBASER0_RETURN_INTERFACE(pIns, pszIID, InterfaceType, pInterface) \
|
---|
257 | do { \
|
---|
258 | Assert((uintptr_t)pInterface - PDMINS_2_DATA(pIns, uintptr_t) < _4M); \
|
---|
259 | if (RTUuidCompare2Strs((pszIID), InterfaceType##_IID) == 0) \
|
---|
260 | { \
|
---|
261 | InterfaceType##R0 *pReturnInterfaceTypeCheck = (pInterface); \
|
---|
262 | return (uintptr_t)pReturnInterfaceTypeCheck \
|
---|
263 | - PDMINS_2_DATA(pIns, uintptr_t) \
|
---|
264 | + PDMINS_2_DATA_R0PTR(pIns); \
|
---|
265 | } \
|
---|
266 | } while (0)
|
---|
267 |
|
---|
268 | /** @} */
|
---|
269 |
|
---|
270 |
|
---|
271 | /**
|
---|
272 | * Dummy interface.
|
---|
273 | *
|
---|
274 | * This is used to typedef other dummy interfaces. The purpose of a dummy
|
---|
275 | * interface is to validate the logical function of a driver/device and
|
---|
276 | * full a natural interface pair.
|
---|
277 | */
|
---|
278 | typedef struct PDMIDUMMY
|
---|
279 | {
|
---|
280 | RTHCPTR pvDummy;
|
---|
281 | } PDMIDUMMY;
|
---|
282 |
|
---|
283 |
|
---|
284 | /** Pointer to a mouse port interface. */
|
---|
285 | typedef struct PDMIMOUSEPORT *PPDMIMOUSEPORT;
|
---|
286 | /**
|
---|
287 | * Mouse port interface (down).
|
---|
288 | * Pair with PDMIMOUSECONNECTOR.
|
---|
289 | */
|
---|
290 | typedef struct PDMIMOUSEPORT
|
---|
291 | {
|
---|
292 | /**
|
---|
293 | * Puts a mouse event.
|
---|
294 | *
|
---|
295 | * This is called by the source of mouse events. The event will be passed up
|
---|
296 | * until the topmost driver, which then calls the registered event handler.
|
---|
297 | *
|
---|
298 | * @returns VBox status code. Return VERR_TRY_AGAIN if you cannot process the
|
---|
299 | * event now and want it to be repeated at a later point.
|
---|
300 | *
|
---|
301 | * @param pInterface Pointer to this interface structure.
|
---|
302 | * @param dx The X delta.
|
---|
303 | * @param dy The Y delta.
|
---|
304 | * @param dz The Z delta.
|
---|
305 | * @param dw The W (horizontal scroll button) delta.
|
---|
306 | * @param fButtons The button states, see the PDMIMOUSEPORT_BUTTON_* \#defines.
|
---|
307 | */
|
---|
308 | DECLR3CALLBACKMEMBER(int, pfnPutEvent,(PPDMIMOUSEPORT pInterface,
|
---|
309 | int32_t dx, int32_t dy, int32_t dz,
|
---|
310 | int32_t dw, uint32_t fButtons));
|
---|
311 | /**
|
---|
312 | * Puts an absolute mouse event.
|
---|
313 | *
|
---|
314 | * This is called by the source of mouse events. The event will be passed up
|
---|
315 | * until the topmost driver, which then calls the registered event handler.
|
---|
316 | *
|
---|
317 | * @returns VBox status code. Return VERR_TRY_AGAIN if you cannot process the
|
---|
318 | * event now and want it to be repeated at a later point.
|
---|
319 | *
|
---|
320 | * @param pInterface Pointer to this interface structure.
|
---|
321 | * @param x The X value, in the range 0 to 0xffff.
|
---|
322 | * @param y The Y value, in the range 0 to 0xffff.
|
---|
323 | * @param dz The Z delta.
|
---|
324 | * @param dw The W (horizontal scroll button) delta.
|
---|
325 | * @param fButtons The button states, see the PDMIMOUSEPORT_BUTTON_* \#defines.
|
---|
326 | */
|
---|
327 | DECLR3CALLBACKMEMBER(int, pfnPutEventAbs,(PPDMIMOUSEPORT pInterface,
|
---|
328 | uint32_t x, uint32_t y,
|
---|
329 | int32_t dz, int32_t dw,
|
---|
330 | uint32_t fButtons));
|
---|
331 | /**
|
---|
332 | * Puts a multi-touch event.
|
---|
333 | *
|
---|
334 | * @returns VBox status code. Return VERR_TRY_AGAIN if you cannot process the
|
---|
335 | * event now and want it to be repeated at a later point.
|
---|
336 | *
|
---|
337 | * @param pInterface Pointer to this interface structure.
|
---|
338 | * @param cContacts How many touch contacts in this event.
|
---|
339 | * @param pau64Contacts Pointer to array of packed contact information.
|
---|
340 | * Each 64bit element contains:
|
---|
341 | * Bits 0..15: X coordinate in pixels (signed).
|
---|
342 | * Bits 16..31: Y coordinate in pixels (signed).
|
---|
343 | * Bits 32..39: contact identifier.
|
---|
344 | * Bit 40: "in contact" flag, which indicates that
|
---|
345 | * there is a contact with the touch surface.
|
---|
346 | * Bit 41: "in range" flag, the contact is close enough
|
---|
347 | * to the touch surface.
|
---|
348 | * All other bits are reserved for future use and must be set to 0.
|
---|
349 | * @param u32ScanTime Timestamp of this event in milliseconds. Only relative
|
---|
350 | * time between event is important.
|
---|
351 | */
|
---|
352 | DECLR3CALLBACKMEMBER(int, pfnPutEventMultiTouch,(PPDMIMOUSEPORT pInterface,
|
---|
353 | uint8_t cContacts,
|
---|
354 | const uint64_t *pau64Contacts,
|
---|
355 | uint32_t u32ScanTime));
|
---|
356 | } PDMIMOUSEPORT;
|
---|
357 | /** PDMIMOUSEPORT interface ID. */
|
---|
358 | #define PDMIMOUSEPORT_IID "359364f0-9fa3-4490-a6b4-7ed771901c93"
|
---|
359 |
|
---|
360 | /** Mouse button defines for PDMIMOUSEPORT::pfnPutEvent.
|
---|
361 | * @{ */
|
---|
362 | #define PDMIMOUSEPORT_BUTTON_LEFT RT_BIT(0)
|
---|
363 | #define PDMIMOUSEPORT_BUTTON_RIGHT RT_BIT(1)
|
---|
364 | #define PDMIMOUSEPORT_BUTTON_MIDDLE RT_BIT(2)
|
---|
365 | #define PDMIMOUSEPORT_BUTTON_X1 RT_BIT(3)
|
---|
366 | #define PDMIMOUSEPORT_BUTTON_X2 RT_BIT(4)
|
---|
367 | /** @} */
|
---|
368 |
|
---|
369 |
|
---|
370 | /** Pointer to a mouse connector interface. */
|
---|
371 | typedef struct PDMIMOUSECONNECTOR *PPDMIMOUSECONNECTOR;
|
---|
372 | /**
|
---|
373 | * Mouse connector interface (up).
|
---|
374 | * Pair with PDMIMOUSEPORT.
|
---|
375 | */
|
---|
376 | typedef struct PDMIMOUSECONNECTOR
|
---|
377 | {
|
---|
378 | /**
|
---|
379 | * Notifies the the downstream driver of changes to the reporting modes
|
---|
380 | * supported by the driver
|
---|
381 | *
|
---|
382 | * @param pInterface Pointer to this interface structure.
|
---|
383 | * @param fRelative Whether relative mode is currently supported.
|
---|
384 | * @param fAbsolute Whether absolute mode is currently supported.
|
---|
385 | * @param fMultiTouch Whether multi-touch mode is currently supported.
|
---|
386 | */
|
---|
387 | DECLR3CALLBACKMEMBER(void, pfnReportModes,(PPDMIMOUSECONNECTOR pInterface, bool fRelative, bool fAbsolute, bool fMultiTouch));
|
---|
388 |
|
---|
389 | /**
|
---|
390 | * Flushes the mouse queue if it contains pending events.
|
---|
391 | *
|
---|
392 | * @param pInterface Pointer to this interface structure.
|
---|
393 | */
|
---|
394 | DECLR3CALLBACKMEMBER(void, pfnFlushQueue,(PPDMIMOUSECONNECTOR pInterface));
|
---|
395 |
|
---|
396 | } PDMIMOUSECONNECTOR;
|
---|
397 | /** PDMIMOUSECONNECTOR interface ID. */
|
---|
398 | #define PDMIMOUSECONNECTOR_IID "ce64d7bd-fa8f-41d1-a6fb-d102a2d6bffe"
|
---|
399 |
|
---|
400 |
|
---|
401 | /** Pointer to a keyboard port interface. */
|
---|
402 | typedef struct PDMIKEYBOARDPORT *PPDMIKEYBOARDPORT;
|
---|
403 | /**
|
---|
404 | * Keyboard port interface (down).
|
---|
405 | * Pair with PDMIKEYBOARDCONNECTOR.
|
---|
406 | */
|
---|
407 | typedef struct PDMIKEYBOARDPORT
|
---|
408 | {
|
---|
409 | /**
|
---|
410 | * Puts a scan code based keyboard event.
|
---|
411 | *
|
---|
412 | * This is called by the source of keyboard events. The event will be passed up
|
---|
413 | * until the topmost driver, which then calls the registered event handler.
|
---|
414 | *
|
---|
415 | * @returns VBox status code. Return VERR_TRY_AGAIN if you cannot process the
|
---|
416 | * event now and want it to be repeated at a later point.
|
---|
417 | *
|
---|
418 | * @param pInterface Pointer to this interface structure.
|
---|
419 | * @param u8ScanCode The scan code to queue.
|
---|
420 | */
|
---|
421 | DECLR3CALLBACKMEMBER(int, pfnPutEventScan,(PPDMIKEYBOARDPORT pInterface, uint8_t u8KeyCode));
|
---|
422 |
|
---|
423 | /**
|
---|
424 | * Puts a USB HID usage ID based keyboard event.
|
---|
425 | *
|
---|
426 | * This is called by the source of keyboard events. The event will be passed up
|
---|
427 | * until the topmost driver, which then calls the registered event handler.
|
---|
428 | *
|
---|
429 | * @returns VBox status code. Return VERR_TRY_AGAIN if you cannot process the
|
---|
430 | * event now and want it to be repeated at a later point.
|
---|
431 | *
|
---|
432 | * @param pInterface Pointer to this interface structure.
|
---|
433 | * @param idUsage The HID usage code event to queue.
|
---|
434 | */
|
---|
435 | DECLR3CALLBACKMEMBER(int, pfnPutEventHid,(PPDMIKEYBOARDPORT pInterface, uint32_t idUsage));
|
---|
436 | } PDMIKEYBOARDPORT;
|
---|
437 | /** PDMIKEYBOARDPORT interface ID. */
|
---|
438 | #define PDMIKEYBOARDPORT_IID "2a0844f0-410b-40ab-a6ed-6575f3aa3e29"
|
---|
439 |
|
---|
440 |
|
---|
441 | /**
|
---|
442 | * Keyboard LEDs.
|
---|
443 | */
|
---|
444 | typedef enum PDMKEYBLEDS
|
---|
445 | {
|
---|
446 | /** No leds. */
|
---|
447 | PDMKEYBLEDS_NONE = 0x0000,
|
---|
448 | /** Num Lock */
|
---|
449 | PDMKEYBLEDS_NUMLOCK = 0x0001,
|
---|
450 | /** Caps Lock */
|
---|
451 | PDMKEYBLEDS_CAPSLOCK = 0x0002,
|
---|
452 | /** Scroll Lock */
|
---|
453 | PDMKEYBLEDS_SCROLLLOCK = 0x0004
|
---|
454 | } PDMKEYBLEDS;
|
---|
455 |
|
---|
456 | /** Pointer to keyboard connector interface. */
|
---|
457 | typedef struct PDMIKEYBOARDCONNECTOR *PPDMIKEYBOARDCONNECTOR;
|
---|
458 | /**
|
---|
459 | * Keyboard connector interface (up).
|
---|
460 | * Pair with PDMIKEYBOARDPORT
|
---|
461 | */
|
---|
462 | typedef struct PDMIKEYBOARDCONNECTOR
|
---|
463 | {
|
---|
464 | /**
|
---|
465 | * Notifies the the downstream driver about an LED change initiated by the guest.
|
---|
466 | *
|
---|
467 | * @param pInterface Pointer to this interface structure.
|
---|
468 | * @param enmLeds The new led mask.
|
---|
469 | */
|
---|
470 | DECLR3CALLBACKMEMBER(void, pfnLedStatusChange,(PPDMIKEYBOARDCONNECTOR pInterface, PDMKEYBLEDS enmLeds));
|
---|
471 |
|
---|
472 | /**
|
---|
473 | * Notifies the the downstream driver of changes in driver state.
|
---|
474 | *
|
---|
475 | * @param pInterface Pointer to this interface structure.
|
---|
476 | * @param fActive Whether interface wishes to get "focus".
|
---|
477 | */
|
---|
478 | DECLR3CALLBACKMEMBER(void, pfnSetActive,(PPDMIKEYBOARDCONNECTOR pInterface, bool fActive));
|
---|
479 |
|
---|
480 | /**
|
---|
481 | * Flushes the keyboard queue if it contains pending events.
|
---|
482 | *
|
---|
483 | * @param pInterface Pointer to this interface structure.
|
---|
484 | */
|
---|
485 | DECLR3CALLBACKMEMBER(void, pfnFlushQueue,(PPDMIKEYBOARDCONNECTOR pInterface));
|
---|
486 |
|
---|
487 | } PDMIKEYBOARDCONNECTOR;
|
---|
488 | /** PDMIKEYBOARDCONNECTOR interface ID. */
|
---|
489 | #define PDMIKEYBOARDCONNECTOR_IID "db3f7bd5-953e-436f-9f8e-077905a92d82"
|
---|
490 |
|
---|
491 |
|
---|
492 |
|
---|
493 | /** Pointer to a display port interface. */
|
---|
494 | typedef struct PDMIDISPLAYPORT *PPDMIDISPLAYPORT;
|
---|
495 | /**
|
---|
496 | * Display port interface (down).
|
---|
497 | * Pair with PDMIDISPLAYCONNECTOR.
|
---|
498 | */
|
---|
499 | typedef struct PDMIDISPLAYPORT
|
---|
500 | {
|
---|
501 | /**
|
---|
502 | * Update the display with any changed regions.
|
---|
503 | *
|
---|
504 | * Flushes any display changes to the memory pointed to by the
|
---|
505 | * PDMIDISPLAYCONNECTOR interface and calles PDMIDISPLAYCONNECTOR::pfnUpdateRect()
|
---|
506 | * while doing so.
|
---|
507 | *
|
---|
508 | * @returns VBox status code.
|
---|
509 | * @param pInterface Pointer to this interface.
|
---|
510 | * @thread The emulation thread.
|
---|
511 | */
|
---|
512 | DECLR3CALLBACKMEMBER(int, pfnUpdateDisplay,(PPDMIDISPLAYPORT pInterface));
|
---|
513 |
|
---|
514 | /**
|
---|
515 | * Update the entire display.
|
---|
516 | *
|
---|
517 | * Flushes the entire display content to the memory pointed to by the
|
---|
518 | * PDMIDISPLAYCONNECTOR interface and calles PDMIDISPLAYCONNECTOR::pfnUpdateRect().
|
---|
519 | *
|
---|
520 | * @returns VBox status code.
|
---|
521 | * @param pInterface Pointer to this interface.
|
---|
522 | * @param fFailOnResize Fail is a resize is pending.
|
---|
523 | * @thread The emulation thread.
|
---|
524 | */
|
---|
525 | DECLR3CALLBACKMEMBER(int, pfnUpdateDisplayAll,(PPDMIDISPLAYPORT pInterface, bool fFailOnResize));
|
---|
526 |
|
---|
527 | /**
|
---|
528 | * Return the current guest resolution and color depth in bits per pixel (bpp).
|
---|
529 | *
|
---|
530 | * As the graphics card is able to provide display updates with the bpp
|
---|
531 | * requested by the host, this method can be used to query the actual
|
---|
532 | * guest color depth.
|
---|
533 | *
|
---|
534 | * @returns VBox status code.
|
---|
535 | * @param pInterface Pointer to this interface.
|
---|
536 | * @param pcBits Where to store the current guest color depth.
|
---|
537 | * @param pcx Where to store the horizontal resolution.
|
---|
538 | * @param pcy Where to store the vertical resolution.
|
---|
539 | * @thread Any thread.
|
---|
540 | */
|
---|
541 | DECLR3CALLBACKMEMBER(int, pfnQueryVideoMode,(PPDMIDISPLAYPORT pInterface, uint32_t *pcBits, uint32_t *pcx, uint32_t *pcy));
|
---|
542 |
|
---|
543 | /**
|
---|
544 | * Sets the refresh rate and restart the timer.
|
---|
545 | * The rate is defined as the minimum interval between the return of
|
---|
546 | * one PDMIDISPLAYPORT::pfnRefresh() call to the next one.
|
---|
547 | *
|
---|
548 | * The interval timer will be restarted by this call. So at VM startup
|
---|
549 | * this function must be called to start the refresh cycle. The refresh
|
---|
550 | * rate is not saved, but have to be when resuming a loaded VM state.
|
---|
551 | *
|
---|
552 | * @returns VBox status code.
|
---|
553 | * @param pInterface Pointer to this interface.
|
---|
554 | * @param cMilliesInterval Number of millis between two refreshes.
|
---|
555 | * @thread Any thread.
|
---|
556 | */
|
---|
557 | DECLR3CALLBACKMEMBER(int, pfnSetRefreshRate,(PPDMIDISPLAYPORT pInterface, uint32_t cMilliesInterval));
|
---|
558 |
|
---|
559 | /**
|
---|
560 | * Create a 32-bbp screenshot of the display.
|
---|
561 | *
|
---|
562 | * This will allocate and return a 32-bbp bitmap. Size of the bitmap scanline in bytes is 4*width.
|
---|
563 | *
|
---|
564 | * The allocated bitmap buffer must be freed with pfnFreeScreenshot.
|
---|
565 | *
|
---|
566 | * @param pInterface Pointer to this interface.
|
---|
567 | * @param ppbData Where to store the pointer to the allocated
|
---|
568 | * buffer.
|
---|
569 | * @param pcbData Where to store the actual size of the bitmap.
|
---|
570 | * @param pcx Where to store the width of the bitmap.
|
---|
571 | * @param pcy Where to store the height of the bitmap.
|
---|
572 | * @thread The emulation thread.
|
---|
573 | */
|
---|
574 | DECLR3CALLBACKMEMBER(int, pfnTakeScreenshot,(PPDMIDISPLAYPORT pInterface, uint8_t **ppbData, size_t *pcbData, uint32_t *pcx, uint32_t *pcy));
|
---|
575 |
|
---|
576 | /**
|
---|
577 | * Free screenshot buffer.
|
---|
578 | *
|
---|
579 | * This will free the memory buffer allocated by pfnTakeScreenshot.
|
---|
580 | *
|
---|
581 | * @param pInterface Pointer to this interface.
|
---|
582 | * @param pbData Pointer to the buffer returned by
|
---|
583 | * pfnTakeScreenshot.
|
---|
584 | * @thread Any.
|
---|
585 | */
|
---|
586 | DECLR3CALLBACKMEMBER(void, pfnFreeScreenshot,(PPDMIDISPLAYPORT pInterface, uint8_t *pbData));
|
---|
587 |
|
---|
588 | /**
|
---|
589 | * Copy bitmap to the display.
|
---|
590 | *
|
---|
591 | * This will convert and copy a 32-bbp bitmap (with dword aligned scanline length) to
|
---|
592 | * the memory pointed to by the PDMIDISPLAYCONNECTOR interface.
|
---|
593 | *
|
---|
594 | * @param pInterface Pointer to this interface.
|
---|
595 | * @param pvData Pointer to the bitmap bits.
|
---|
596 | * @param x The upper left corner x coordinate of the destination rectangle.
|
---|
597 | * @param y The upper left corner y coordinate of the destination rectangle.
|
---|
598 | * @param cx The width of the source and destination rectangles.
|
---|
599 | * @param cy The height of the source and destination rectangles.
|
---|
600 | * @thread The emulation thread.
|
---|
601 | * @remark This is just a convenience for using the bitmap conversions of the
|
---|
602 | * graphics device.
|
---|
603 | */
|
---|
604 | DECLR3CALLBACKMEMBER(int, pfnDisplayBlt,(PPDMIDISPLAYPORT pInterface, const void *pvData, uint32_t x, uint32_t y, uint32_t cx, uint32_t cy));
|
---|
605 |
|
---|
606 | /**
|
---|
607 | * Render a rectangle from guest VRAM to Framebuffer.
|
---|
608 | *
|
---|
609 | * @param pInterface Pointer to this interface.
|
---|
610 | * @param x The upper left corner x coordinate of the rectangle to be updated.
|
---|
611 | * @param y The upper left corner y coordinate of the rectangle to be updated.
|
---|
612 | * @param cx The width of the rectangle to be updated.
|
---|
613 | * @param cy The height of the rectangle to be updated.
|
---|
614 | * @thread The emulation thread.
|
---|
615 | */
|
---|
616 | DECLR3CALLBACKMEMBER(void, pfnUpdateDisplayRect,(PPDMIDISPLAYPORT pInterface, int32_t x, int32_t y, uint32_t cx, uint32_t cy));
|
---|
617 |
|
---|
618 | /**
|
---|
619 | * Inform the VGA device whether the Display is directly using the guest VRAM and there is no need
|
---|
620 | * to render the VRAM to the framebuffer memory.
|
---|
621 | *
|
---|
622 | * @param pInterface Pointer to this interface.
|
---|
623 | * @param fRender Whether the VRAM content must be rendered to the framebuffer.
|
---|
624 | * @thread The emulation thread.
|
---|
625 | */
|
---|
626 | DECLR3CALLBACKMEMBER(void, pfnSetRenderVRAM,(PPDMIDISPLAYPORT pInterface, bool fRender));
|
---|
627 |
|
---|
628 | /**
|
---|
629 | * Render a bitmap rectangle from source to target buffer.
|
---|
630 | *
|
---|
631 | * @param pInterface Pointer to this interface.
|
---|
632 | * @param cx The width of the rectangle to be copied.
|
---|
633 | * @param cy The height of the rectangle to be copied.
|
---|
634 | * @param pbSrc Source frame buffer 0,0.
|
---|
635 | * @param xSrc The upper left corner x coordinate of the source rectangle.
|
---|
636 | * @param ySrc The upper left corner y coordinate of the source rectangle.
|
---|
637 | * @param cxSrc The width of the source frame buffer.
|
---|
638 | * @param cySrc The height of the source frame buffer.
|
---|
639 | * @param cbSrcLine The line length of the source frame buffer.
|
---|
640 | * @param cSrcBitsPerPixel The pixel depth of the source.
|
---|
641 | * @param pbDst Destination frame buffer 0,0.
|
---|
642 | * @param xDst The upper left corner x coordinate of the destination rectangle.
|
---|
643 | * @param yDst The upper left corner y coordinate of the destination rectangle.
|
---|
644 | * @param cxDst The width of the destination frame buffer.
|
---|
645 | * @param cyDst The height of the destination frame buffer.
|
---|
646 | * @param cbDstLine The line length of the destination frame buffer.
|
---|
647 | * @param cDstBitsPerPixel The pixel depth of the destination.
|
---|
648 | * @thread The emulation thread.
|
---|
649 | */
|
---|
650 | DECLR3CALLBACKMEMBER(int, pfnCopyRect,(PPDMIDISPLAYPORT pInterface, uint32_t cx, uint32_t cy,
|
---|
651 | const uint8_t *pbSrc, int32_t xSrc, int32_t ySrc, uint32_t cxSrc, uint32_t cySrc, uint32_t cbSrcLine, uint32_t cSrcBitsPerPixel,
|
---|
652 | uint8_t *pbDst, int32_t xDst, int32_t yDst, uint32_t cxDst, uint32_t cyDst, uint32_t cbDstLine, uint32_t cDstBitsPerPixel));
|
---|
653 |
|
---|
654 | /**
|
---|
655 | * Inform the VGA device of viewport changes (as a result of e.g. scrolling).
|
---|
656 | *
|
---|
657 | * @param pInterface Pointer to this interface.
|
---|
658 | * @param idScreen The screen updates are for.
|
---|
659 | * @param x The upper left corner x coordinate of the new viewport rectangle
|
---|
660 | * @param y The upper left corner y coordinate of the new viewport rectangle
|
---|
661 | * @param cx The width of the new viewport rectangle
|
---|
662 | * @param cy The height of the new viewport rectangle
|
---|
663 | * @thread GUI thread?
|
---|
664 | *
|
---|
665 | * @remarks Is allowed to be NULL.
|
---|
666 | */
|
---|
667 | DECLR3CALLBACKMEMBER(void, pfnSetViewport,(PPDMIDISPLAYPORT pInterface,
|
---|
668 | uint32_t idScreen, uint32_t x, uint32_t y, uint32_t cx, uint32_t cy));
|
---|
669 |
|
---|
670 | /**
|
---|
671 | * Send a video mode hint to the VGA device.
|
---|
672 | *
|
---|
673 | * @param pInterface Pointer to this interface.
|
---|
674 | * @param cx The X resolution.
|
---|
675 | * @param cy The Y resolution.
|
---|
676 | * @param cBPP The bit count.
|
---|
677 | * @param iDisplay The screen number.
|
---|
678 | * @param dx X offset into the virtual framebuffer or ~0.
|
---|
679 | * @param dy Y offset into the virtual framebuffer or ~0.
|
---|
680 | * @param fEnabled Is this screen currently enabled?
|
---|
681 | * @param fNotifyGuest Should the device send the guest an IRQ?
|
---|
682 | * Set for the last hint of a series.
|
---|
683 | * @thread Schedules on the emulation thread.
|
---|
684 | */
|
---|
685 | DECLR3CALLBACKMEMBER(int, pfnSendModeHint, (PPDMIDISPLAYPORT pInterface, uint32_t cx, uint32_t cy,
|
---|
686 | uint32_t cBPP, uint32_t iDisplay, uint32_t dx,
|
---|
687 | uint32_t dy, uint32_t fEnabled, uint32_t fNotifyGuest));
|
---|
688 |
|
---|
689 | /**
|
---|
690 | * Send the guest a notification about host cursor capabilities changes.
|
---|
691 | *
|
---|
692 | * @param pInterface Pointer to this interface.
|
---|
693 | * @param fSupportsRenderCursor Whether the host can draw the guest cursor
|
---|
694 | * using the host one provided the location matches.
|
---|
695 | * @param fSupportsMoveCursor Whether the host can draw the guest cursor
|
---|
696 | * itself at any position. Implies RenderCursor.
|
---|
697 | * @thread Any.
|
---|
698 | */
|
---|
699 | DECLR3CALLBACKMEMBER(void, pfnReportHostCursorCapabilities, (PPDMIDISPLAYPORT pInterface, bool fSupportsRenderCursor, bool fSupportsMoveCursor));
|
---|
700 |
|
---|
701 | /**
|
---|
702 | * Tell the graphics device about the host cursor position.
|
---|
703 | *
|
---|
704 | * @param pInterface Pointer to this interface.
|
---|
705 | * @param x X offset into the cursor range.
|
---|
706 | * @param y Y offset into the cursor range.
|
---|
707 | * @param fOutOfRange The host pointer is out of all guest windows, so
|
---|
708 | * X and Y do not currently have meaningful value.
|
---|
709 | * @thread Any.
|
---|
710 | */
|
---|
711 | DECLR3CALLBACKMEMBER(void, pfnReportHostCursorPosition, (PPDMIDISPLAYPORT pInterface, uint32_t x, uint32_t y, bool fOutOfRange));
|
---|
712 | } PDMIDISPLAYPORT;
|
---|
713 | /** PDMIDISPLAYPORT interface ID. */
|
---|
714 | #define PDMIDISPLAYPORT_IID "471b0520-338c-11e9-bb84-6ff2c956da45"
|
---|
715 |
|
---|
716 | /** @name Flags for PDMIDISPLAYCONNECTOR::pfnVBVAReportCursorPosition.
|
---|
717 | * @{ */
|
---|
718 | /** Is the data in the report valid? */
|
---|
719 | #define VBVA_CURSOR_VALID_DATA RT_BIT(0)
|
---|
720 | /** Is the cursor position reported relative to a particular guest screen? */
|
---|
721 | #define VBVA_CURSOR_SCREEN_RELATIVE RT_BIT(1)
|
---|
722 | /** @} */
|
---|
723 |
|
---|
724 | /** Pointer to a 2D graphics acceleration command. */
|
---|
725 | typedef struct VBOXVHWACMD VBOXVHWACMD;
|
---|
726 | /** Pointer to a VBVA command header. */
|
---|
727 | typedef struct VBVACMDHDR *PVBVACMDHDR;
|
---|
728 | /** Pointer to a const VBVA command header. */
|
---|
729 | typedef const struct VBVACMDHDR *PCVBVACMDHDR;
|
---|
730 | /** Pointer to a VBVA screen information. */
|
---|
731 | typedef struct VBVAINFOSCREEN *PVBVAINFOSCREEN;
|
---|
732 | /** Pointer to a const VBVA screen information. */
|
---|
733 | typedef const struct VBVAINFOSCREEN *PCVBVAINFOSCREEN;
|
---|
734 | /** Pointer to a VBVA guest VRAM area information. */
|
---|
735 | typedef struct VBVAINFOVIEW *PVBVAINFOVIEW;
|
---|
736 | /** Pointer to a const VBVA guest VRAM area information. */
|
---|
737 | typedef const struct VBVAINFOVIEW *PCVBVAINFOVIEW;
|
---|
738 | typedef struct VBVAHOSTFLAGS *PVBVAHOSTFLAGS;
|
---|
739 |
|
---|
740 | /** Pointer to a display connector interface. */
|
---|
741 | typedef struct PDMIDISPLAYCONNECTOR *PPDMIDISPLAYCONNECTOR;
|
---|
742 |
|
---|
743 | /**
|
---|
744 | * Display connector interface (up).
|
---|
745 | * Pair with PDMIDISPLAYPORT.
|
---|
746 | */
|
---|
747 | typedef struct PDMIDISPLAYCONNECTOR
|
---|
748 | {
|
---|
749 | /**
|
---|
750 | * Resize the display.
|
---|
751 | * This is called when the resolution changes. This usually happens on
|
---|
752 | * request from the guest os, but may also happen as the result of a reset.
|
---|
753 | * If the callback returns VINF_VGA_RESIZE_IN_PROGRESS, the caller (VGA device)
|
---|
754 | * must not access the connector and return.
|
---|
755 | *
|
---|
756 | * @returns VINF_SUCCESS if the framebuffer resize was completed,
|
---|
757 | * VINF_VGA_RESIZE_IN_PROGRESS if resize takes time and not yet finished.
|
---|
758 | * @param pInterface Pointer to this interface.
|
---|
759 | * @param cBits Color depth (bits per pixel) of the new video mode.
|
---|
760 | * @param pvVRAM Address of the guest VRAM.
|
---|
761 | * @param cbLine Size in bytes of a single scan line.
|
---|
762 | * @param cx New display width.
|
---|
763 | * @param cy New display height.
|
---|
764 | * @thread The emulation thread.
|
---|
765 | */
|
---|
766 | DECLR3CALLBACKMEMBER(int, pfnResize,(PPDMIDISPLAYCONNECTOR pInterface, uint32_t cBits, void *pvVRAM, uint32_t cbLine,
|
---|
767 | uint32_t cx, uint32_t cy));
|
---|
768 |
|
---|
769 | /**
|
---|
770 | * Update a rectangle of the display.
|
---|
771 | * PDMIDISPLAYPORT::pfnUpdateDisplay is the caller.
|
---|
772 | *
|
---|
773 | * @param pInterface Pointer to this interface.
|
---|
774 | * @param x The upper left corner x coordinate of the rectangle.
|
---|
775 | * @param y The upper left corner y coordinate of the rectangle.
|
---|
776 | * @param cx The width of the rectangle.
|
---|
777 | * @param cy The height of the rectangle.
|
---|
778 | * @thread The emulation thread.
|
---|
779 | */
|
---|
780 | DECLR3CALLBACKMEMBER(void, pfnUpdateRect,(PPDMIDISPLAYCONNECTOR pInterface, uint32_t x, uint32_t y, uint32_t cx, uint32_t cy));
|
---|
781 |
|
---|
782 | /**
|
---|
783 | * Refresh the display.
|
---|
784 | *
|
---|
785 | * The interval between these calls is set by
|
---|
786 | * PDMIDISPLAYPORT::pfnSetRefreshRate(). The driver should call
|
---|
787 | * PDMIDISPLAYPORT::pfnUpdateDisplay() if it wishes to refresh the
|
---|
788 | * display. PDMIDISPLAYPORT::pfnUpdateDisplay calls pfnUpdateRect with
|
---|
789 | * the changed rectangles.
|
---|
790 | *
|
---|
791 | * @param pInterface Pointer to this interface.
|
---|
792 | * @thread The emulation thread.
|
---|
793 | */
|
---|
794 | DECLR3CALLBACKMEMBER(void, pfnRefresh,(PPDMIDISPLAYCONNECTOR pInterface));
|
---|
795 |
|
---|
796 | /**
|
---|
797 | * Reset the display.
|
---|
798 | *
|
---|
799 | * Notification message when the graphics card has been reset.
|
---|
800 | *
|
---|
801 | * @param pInterface Pointer to this interface.
|
---|
802 | * @thread The emulation thread.
|
---|
803 | */
|
---|
804 | DECLR3CALLBACKMEMBER(void, pfnReset,(PPDMIDISPLAYCONNECTOR pInterface));
|
---|
805 |
|
---|
806 | /**
|
---|
807 | * LFB video mode enter/exit.
|
---|
808 | *
|
---|
809 | * Notification message when LinearFrameBuffer video mode is enabled/disabled.
|
---|
810 | *
|
---|
811 | * @param pInterface Pointer to this interface.
|
---|
812 | * @param fEnabled false - LFB mode was disabled,
|
---|
813 | * true - an LFB mode was disabled
|
---|
814 | * @thread The emulation thread.
|
---|
815 | */
|
---|
816 | DECLR3CALLBACKMEMBER(void, pfnLFBModeChange,(PPDMIDISPLAYCONNECTOR pInterface, bool fEnabled));
|
---|
817 |
|
---|
818 | /**
|
---|
819 | * Process the guest graphics adapter information.
|
---|
820 | *
|
---|
821 | * Direct notification from guest to the display connector.
|
---|
822 | *
|
---|
823 | * @param pInterface Pointer to this interface.
|
---|
824 | * @param pvVRAM Address of the guest VRAM.
|
---|
825 | * @param u32VRAMSize Size of the guest VRAM.
|
---|
826 | * @thread The emulation thread.
|
---|
827 | */
|
---|
828 | DECLR3CALLBACKMEMBER(void, pfnProcessAdapterData,(PPDMIDISPLAYCONNECTOR pInterface, void *pvVRAM, uint32_t u32VRAMSize));
|
---|
829 |
|
---|
830 | /**
|
---|
831 | * Process the guest display information.
|
---|
832 | *
|
---|
833 | * Direct notification from guest to the display connector.
|
---|
834 | *
|
---|
835 | * @param pInterface Pointer to this interface.
|
---|
836 | * @param pvVRAM Address of the guest VRAM.
|
---|
837 | * @param uScreenId The index of the guest display to be processed.
|
---|
838 | * @thread The emulation thread.
|
---|
839 | */
|
---|
840 | DECLR3CALLBACKMEMBER(void, pfnProcessDisplayData,(PPDMIDISPLAYCONNECTOR pInterface, void *pvVRAM, unsigned uScreenId));
|
---|
841 |
|
---|
842 | /**
|
---|
843 | * Process the guest Video HW Acceleration command.
|
---|
844 | *
|
---|
845 | * @param pInterface Pointer to this interface.
|
---|
846 | * @param enmCmd The command type (don't re-read from pCmd).
|
---|
847 | * @param fGuestCmd Set if the command origins with the guest and
|
---|
848 | * pCmd must be considered volatile.
|
---|
849 | * @param pCmd Video HW Acceleration Command to be processed.
|
---|
850 | * @retval VINF_SUCCESS - command is completed,
|
---|
851 | * @retval VINF_CALLBACK_RETURN if command will by asynchronously completed via
|
---|
852 | * complete callback.
|
---|
853 | * @retval VERR_INVALID_STATE if the command could not be processed (most
|
---|
854 | * likely because the framebuffer was disconnected) - the post should
|
---|
855 | * be retried later.
|
---|
856 | * @thread EMT
|
---|
857 | */
|
---|
858 | DECLR3CALLBACKMEMBER(int, pfnVHWACommandProcess,(PPDMIDISPLAYCONNECTOR pInterface, int enmCmd, bool fGuestCmd,
|
---|
859 | VBOXVHWACMD RT_UNTRUSTED_VOLATILE_GUEST *pCmd));
|
---|
860 |
|
---|
861 | /**
|
---|
862 | * The specified screen enters VBVA mode.
|
---|
863 | *
|
---|
864 | * @param pInterface Pointer to this interface.
|
---|
865 | * @param uScreenId The screen updates are for.
|
---|
866 | * @param pHostFlags Undocumented!
|
---|
867 | * @thread The emulation thread.
|
---|
868 | */
|
---|
869 | DECLR3CALLBACKMEMBER(int, pfnVBVAEnable,(PPDMIDISPLAYCONNECTOR pInterface, unsigned uScreenId,
|
---|
870 | struct VBVAHOSTFLAGS RT_UNTRUSTED_VOLATILE_GUEST *pHostFlags));
|
---|
871 |
|
---|
872 | /**
|
---|
873 | * The specified screen leaves VBVA mode.
|
---|
874 | *
|
---|
875 | * @param pInterface Pointer to this interface.
|
---|
876 | * @param uScreenId The screen updates are for.
|
---|
877 | * @thread if render thread mode is on (fRenderThreadMode that was passed to pfnVBVAEnable is TRUE) - the render thread pfnVBVAEnable was called in,
|
---|
878 | * otherwise - the emulation thread.
|
---|
879 | */
|
---|
880 | DECLR3CALLBACKMEMBER(void, pfnVBVADisable,(PPDMIDISPLAYCONNECTOR pInterface, unsigned uScreenId));
|
---|
881 |
|
---|
882 | /**
|
---|
883 | * A sequence of pfnVBVAUpdateProcess calls begins.
|
---|
884 | *
|
---|
885 | * @param pInterface Pointer to this interface.
|
---|
886 | * @param uScreenId The screen updates are for.
|
---|
887 | * @thread if render thread mode is on (fRenderThreadMode that was passed to pfnVBVAEnable is TRUE) - the render thread pfnVBVAEnable was called in,
|
---|
888 | * otherwise - the emulation thread.
|
---|
889 | */
|
---|
890 | DECLR3CALLBACKMEMBER(void, pfnVBVAUpdateBegin,(PPDMIDISPLAYCONNECTOR pInterface, unsigned uScreenId));
|
---|
891 |
|
---|
892 | /**
|
---|
893 | * Process the guest VBVA command.
|
---|
894 | *
|
---|
895 | * @param pInterface Pointer to this interface.
|
---|
896 | * @param uScreenId The screen updates are for.
|
---|
897 | * @param pCmd Video HW Acceleration Command to be processed.
|
---|
898 | * @param cbCmd Undocumented!
|
---|
899 | * @thread if render thread mode is on (fRenderThreadMode that was passed to pfnVBVAEnable is TRUE) - the render thread pfnVBVAEnable was called in,
|
---|
900 | * otherwise - the emulation thread.
|
---|
901 | */
|
---|
902 | DECLR3CALLBACKMEMBER(void, pfnVBVAUpdateProcess,(PPDMIDISPLAYCONNECTOR pInterface, unsigned uScreenId,
|
---|
903 | struct VBVACMDHDR const RT_UNTRUSTED_VOLATILE_GUEST *pCmd, size_t cbCmd));
|
---|
904 |
|
---|
905 | /**
|
---|
906 | * A sequence of pfnVBVAUpdateProcess calls ends.
|
---|
907 | *
|
---|
908 | * @param pInterface Pointer to this interface.
|
---|
909 | * @param uScreenId The screen updates are for.
|
---|
910 | * @param x The upper left corner x coordinate of the combined rectangle of all VBVA updates.
|
---|
911 | * @param y The upper left corner y coordinate of the rectangle.
|
---|
912 | * @param cx The width of the rectangle.
|
---|
913 | * @param cy The height of the rectangle.
|
---|
914 | * @thread if render thread mode is on (fRenderThreadMode that was passed to pfnVBVAEnable is TRUE) - the render thread pfnVBVAEnable was called in,
|
---|
915 | * otherwise - the emulation thread.
|
---|
916 | */
|
---|
917 | DECLR3CALLBACKMEMBER(void, pfnVBVAUpdateEnd,(PPDMIDISPLAYCONNECTOR pInterface, unsigned uScreenId, int32_t x, int32_t y,
|
---|
918 | uint32_t cx, uint32_t cy));
|
---|
919 |
|
---|
920 | /**
|
---|
921 | * Resize the display.
|
---|
922 | * This is called when the resolution changes. This usually happens on
|
---|
923 | * request from the guest os, but may also happen as the result of a reset.
|
---|
924 | * If the callback returns VINF_VGA_RESIZE_IN_PROGRESS, the caller (VGA device)
|
---|
925 | * must not access the connector and return.
|
---|
926 | *
|
---|
927 | * @todo Merge with pfnResize.
|
---|
928 | *
|
---|
929 | * @returns VINF_SUCCESS if the framebuffer resize was completed,
|
---|
930 | * VINF_VGA_RESIZE_IN_PROGRESS if resize takes time and not yet finished.
|
---|
931 | * @param pInterface Pointer to this interface.
|
---|
932 | * @param pView The description of VRAM block for this screen.
|
---|
933 | * @param pScreen The data of screen being resized.
|
---|
934 | * @param pvVRAM Address of the guest VRAM.
|
---|
935 | * @param fResetInputMapping Whether to reset the absolute pointing device to screen position co-ordinate
|
---|
936 | * mapping. Needed for real resizes, as the caller on the guest may not know how
|
---|
937 | * to set the mapping. Not wanted when we restore a saved state and are resetting
|
---|
938 | * the mode.
|
---|
939 | * @thread if render thread mode is on (fRenderThreadMode that was passed to pfnVBVAEnable is TRUE) - the render thread pfnVBVAEnable was called in,
|
---|
940 | * otherwise - the emulation thread.
|
---|
941 | */
|
---|
942 | DECLR3CALLBACKMEMBER(int, pfnVBVAResize,(PPDMIDISPLAYCONNECTOR pInterface, PCVBVAINFOVIEW pView, PCVBVAINFOSCREEN pScreen,
|
---|
943 | void *pvVRAM, bool fResetInputMapping));
|
---|
944 |
|
---|
945 | /**
|
---|
946 | * Update the pointer shape.
|
---|
947 | * This is called when the mouse pointer shape changes. The new shape
|
---|
948 | * is passed as a caller allocated buffer that will be freed after returning
|
---|
949 | *
|
---|
950 | * @param pInterface Pointer to this interface.
|
---|
951 | * @param fVisible Visibility indicator (if false, the other parameters are undefined).
|
---|
952 | * @param fAlpha Flag whether alpha channel is being passed.
|
---|
953 | * @param xHot Pointer hot spot x coordinate.
|
---|
954 | * @param yHot Pointer hot spot y coordinate.
|
---|
955 | * @param cx Pointer width in pixels.
|
---|
956 | * @param cy Pointer height in pixels.
|
---|
957 | * @param pvShape New shape buffer.
|
---|
958 | * @thread The emulation thread.
|
---|
959 | */
|
---|
960 | DECLR3CALLBACKMEMBER(int, pfnVBVAMousePointerShape,(PPDMIDISPLAYCONNECTOR pInterface, bool fVisible, bool fAlpha,
|
---|
961 | uint32_t xHot, uint32_t yHot, uint32_t cx, uint32_t cy,
|
---|
962 | const void *pvShape));
|
---|
963 |
|
---|
964 | /**
|
---|
965 | * The guest capabilities were updated.
|
---|
966 | *
|
---|
967 | * @param pInterface Pointer to this interface.
|
---|
968 | * @param fCapabilities The new capability flag state.
|
---|
969 | * @thread The emulation thread.
|
---|
970 | */
|
---|
971 | DECLR3CALLBACKMEMBER(void, pfnVBVAGuestCapabilityUpdate,(PPDMIDISPLAYCONNECTOR pInterface, uint32_t fCapabilities));
|
---|
972 |
|
---|
973 | /** Read-only attributes.
|
---|
974 | * For preformance reasons some readonly attributes are kept in the interface.
|
---|
975 | * We trust the interface users to respect the readonlyness of these.
|
---|
976 | * @{
|
---|
977 | */
|
---|
978 | /** Pointer to the display data buffer. */
|
---|
979 | uint8_t *pbData;
|
---|
980 | /** Size of a scanline in the data buffer. */
|
---|
981 | uint32_t cbScanline;
|
---|
982 | /** The color depth (in bits) the graphics card is supposed to provide. */
|
---|
983 | uint32_t cBits;
|
---|
984 | /** The display width. */
|
---|
985 | uint32_t cx;
|
---|
986 | /** The display height. */
|
---|
987 | uint32_t cy;
|
---|
988 | /** @} */
|
---|
989 |
|
---|
990 | /**
|
---|
991 | * The guest display input mapping rectangle was updated.
|
---|
992 | *
|
---|
993 | * @param pInterface Pointer to this interface.
|
---|
994 | * @param xOrigin Upper left X co-ordinate relative to the first screen.
|
---|
995 | * @param yOrigin Upper left Y co-ordinate relative to the first screen.
|
---|
996 | * @param cx Rectangle width.
|
---|
997 | * @param cy Rectangle height.
|
---|
998 | * @thread The emulation thread.
|
---|
999 | */
|
---|
1000 | DECLR3CALLBACKMEMBER(void, pfnVBVAInputMappingUpdate,(PPDMIDISPLAYCONNECTOR pInterface, int32_t xOrigin, int32_t yOrigin, uint32_t cx, uint32_t cy));
|
---|
1001 |
|
---|
1002 | /**
|
---|
1003 | * The guest is reporting the requested location of the host pointer.
|
---|
1004 | *
|
---|
1005 | * @param pInterface Pointer to this interface.
|
---|
1006 | * @param fFlags VBVA_CURSOR_*
|
---|
1007 | * @param uScreenId The screen to which X and Y are relative if VBVA_CURSOR_SCREEN_RELATIVE is set.
|
---|
1008 | * @param x Cursor X offset.
|
---|
1009 | * @param y Cursor Y offset.
|
---|
1010 | * @thread The emulation thread.
|
---|
1011 | */
|
---|
1012 | DECLR3CALLBACKMEMBER(void, pfnVBVAReportCursorPosition,(PPDMIDISPLAYCONNECTOR pInterface, uint32_t fFlags, uint32_t uScreen, uint32_t x, uint32_t y));
|
---|
1013 | } PDMIDISPLAYCONNECTOR;
|
---|
1014 | /** PDMIDISPLAYCONNECTOR interface ID. */
|
---|
1015 | #define PDMIDISPLAYCONNECTOR_IID "b71dc381-99cc-43de-b459-f1e812e73b65"
|
---|
1016 |
|
---|
1017 |
|
---|
1018 | /** Pointer to a secret key interface. */
|
---|
1019 | typedef struct PDMISECKEY *PPDMISECKEY;
|
---|
1020 |
|
---|
1021 | /**
|
---|
1022 | * Secret key interface to retrieve secret keys.
|
---|
1023 | */
|
---|
1024 | typedef struct PDMISECKEY
|
---|
1025 | {
|
---|
1026 | /**
|
---|
1027 | * Retains a key identified by the ID. The caller will only hold a reference
|
---|
1028 | * to the key and must not modify the key buffer in any way.
|
---|
1029 | *
|
---|
1030 | * @returns VBox status code.
|
---|
1031 | * @param pInterface Pointer to this interface.
|
---|
1032 | * @param pszId The alias/id for the key to retrieve.
|
---|
1033 | * @param ppbKey Where to store the pointer to the key buffer on success.
|
---|
1034 | * @param pcbKey Where to store the size of the key in bytes on success.
|
---|
1035 | */
|
---|
1036 | DECLR3CALLBACKMEMBER(int, pfnKeyRetain, (PPDMISECKEY pInterface, const char *pszId,
|
---|
1037 | const uint8_t **pbKey, size_t *pcbKey));
|
---|
1038 |
|
---|
1039 | /**
|
---|
1040 | * Releases one reference of the key identified by the given identifier.
|
---|
1041 | * The caller must not access the key buffer after calling this operation.
|
---|
1042 | *
|
---|
1043 | * @returns VBox status code.
|
---|
1044 | * @param pInterface Pointer to this interface.
|
---|
1045 | * @param pszId The alias/id for the key to release.
|
---|
1046 | *
|
---|
1047 | * @note: It is advised to release the key whenever it is not used anymore so the entity
|
---|
1048 | * storing the key can do anything to make retrieving the key from memory more
|
---|
1049 | * difficult like scrambling the memory buffer for instance.
|
---|
1050 | */
|
---|
1051 | DECLR3CALLBACKMEMBER(int, pfnKeyRelease, (PPDMISECKEY pInterface, const char *pszId));
|
---|
1052 |
|
---|
1053 | /**
|
---|
1054 | * Retains a password identified by the ID. The caller will only hold a reference
|
---|
1055 | * to the password and must not modify the buffer in any way.
|
---|
1056 | *
|
---|
1057 | * @returns VBox status code.
|
---|
1058 | * @param pInterface Pointer to this interface.
|
---|
1059 | * @param pszId The alias/id for the password to retrieve.
|
---|
1060 | * @param ppszPassword Where to store the pointer to the password on success.
|
---|
1061 | */
|
---|
1062 | DECLR3CALLBACKMEMBER(int, pfnPasswordRetain, (PPDMISECKEY pInterface, const char *pszId,
|
---|
1063 | const char **ppszPassword));
|
---|
1064 |
|
---|
1065 | /**
|
---|
1066 | * Releases one reference of the password identified by the given identifier.
|
---|
1067 | * The caller must not access the password after calling this operation.
|
---|
1068 | *
|
---|
1069 | * @returns VBox status code.
|
---|
1070 | * @param pInterface Pointer to this interface.
|
---|
1071 | * @param pszId The alias/id for the password to release.
|
---|
1072 | *
|
---|
1073 | * @note: It is advised to release the password whenever it is not used anymore so the entity
|
---|
1074 | * storing the password can do anything to make retrieving the password from memory more
|
---|
1075 | * difficult like scrambling the memory buffer for instance.
|
---|
1076 | */
|
---|
1077 | DECLR3CALLBACKMEMBER(int, pfnPasswordRelease, (PPDMISECKEY pInterface, const char *pszId));
|
---|
1078 | } PDMISECKEY;
|
---|
1079 | /** PDMISECKEY interface ID. */
|
---|
1080 | #define PDMISECKEY_IID "3d698355-d995-453d-960f-31566a891df2"
|
---|
1081 |
|
---|
1082 | /** Pointer to a secret key helper interface. */
|
---|
1083 | typedef struct PDMISECKEYHLP *PPDMISECKEYHLP;
|
---|
1084 |
|
---|
1085 | /**
|
---|
1086 | * Secret key helper interface for non critical functionality.
|
---|
1087 | */
|
---|
1088 | typedef struct PDMISECKEYHLP
|
---|
1089 | {
|
---|
1090 | /**
|
---|
1091 | * Notifies the interface provider that a key couldn't be retrieved from the key store.
|
---|
1092 | *
|
---|
1093 | * @returns VBox status code.
|
---|
1094 | * @param pInterface Pointer to this interface.
|
---|
1095 | */
|
---|
1096 | DECLR3CALLBACKMEMBER(int, pfnKeyMissingNotify, (PPDMISECKEYHLP pInterface));
|
---|
1097 |
|
---|
1098 | } PDMISECKEYHLP;
|
---|
1099 | /** PDMISECKEY interface ID. */
|
---|
1100 | #define PDMISECKEYHLP_IID "7be96168-4156-40ac-86d2-3073bf8b318e"
|
---|
1101 |
|
---|
1102 |
|
---|
1103 | /** Pointer to a stream interface. */
|
---|
1104 | typedef struct PDMISTREAM *PPDMISTREAM;
|
---|
1105 | /**
|
---|
1106 | * Stream interface (up).
|
---|
1107 | * Makes up the foundation for PDMICHARCONNECTOR. No pair interface.
|
---|
1108 | */
|
---|
1109 | typedef struct PDMISTREAM
|
---|
1110 | {
|
---|
1111 | /**
|
---|
1112 | * Polls for the specified events.
|
---|
1113 | *
|
---|
1114 | * @returns VBox status code.
|
---|
1115 | * @retval VERR_INTERRUPTED if the poll was interrupted.
|
---|
1116 | * @retval VERR_TIMEOUT if the maximum waiting time was reached.
|
---|
1117 | * @param pInterface Pointer to the interface structure containing the called function pointer.
|
---|
1118 | * @param fEvts The events to poll for, see RTPOLL_EVT_XXX.
|
---|
1119 | * @param *pfEvts Where to return details about the events that occurred.
|
---|
1120 | * @param cMillies Number of milliseconds to wait. Use
|
---|
1121 | * RT_INDEFINITE_WAIT to wait for ever.
|
---|
1122 | */
|
---|
1123 | DECLR3CALLBACKMEMBER(int, pfnPoll,(PPDMISTREAM pInterface, uint32_t fEvts, uint32_t *pfEvts, RTMSINTERVAL cMillies));
|
---|
1124 |
|
---|
1125 | /**
|
---|
1126 | * Interrupts the current poll call.
|
---|
1127 | *
|
---|
1128 | * @returns VBox status code.
|
---|
1129 | * @param pInterface Pointer to the interface structure containing the called function pointer.
|
---|
1130 | */
|
---|
1131 | DECLR3CALLBACKMEMBER(int, pfnPollInterrupt,(PPDMISTREAM pInterface));
|
---|
1132 |
|
---|
1133 | /**
|
---|
1134 | * Read bits.
|
---|
1135 | *
|
---|
1136 | * @returns VBox status code.
|
---|
1137 | * @param pInterface Pointer to the interface structure containing the called function pointer.
|
---|
1138 | * @param pvBuf Where to store the read bits.
|
---|
1139 | * @param pcbRead Number of bytes to read/bytes actually read.
|
---|
1140 | * @thread Any thread.
|
---|
1141 | *
|
---|
1142 | * @note: This is non blocking, use the poll callback to block when there is nothing to read.
|
---|
1143 | */
|
---|
1144 | DECLR3CALLBACKMEMBER(int, pfnRead,(PPDMISTREAM pInterface, void *pvBuf, size_t *pcbRead));
|
---|
1145 |
|
---|
1146 | /**
|
---|
1147 | * Write bits.
|
---|
1148 | *
|
---|
1149 | * @returns VBox status code.
|
---|
1150 | * @param pInterface Pointer to the interface structure containing the called function pointer.
|
---|
1151 | * @param pvBuf Where to store the write bits.
|
---|
1152 | * @param pcbWrite Number of bytes to write/bytes actually written.
|
---|
1153 | * @thread Any thread.
|
---|
1154 | *
|
---|
1155 | * @note: This is non blocking, use the poll callback to block until there is room to write.
|
---|
1156 | */
|
---|
1157 | DECLR3CALLBACKMEMBER(int, pfnWrite,(PPDMISTREAM pInterface, const void *pvBuf, size_t *pcbWrite));
|
---|
1158 | } PDMISTREAM;
|
---|
1159 | /** PDMISTREAM interface ID. */
|
---|
1160 | #define PDMISTREAM_IID "f9bd1ba6-c134-44cc-8259-febe14393952"
|
---|
1161 |
|
---|
1162 |
|
---|
1163 | /** Mode of the parallel port */
|
---|
1164 | typedef enum PDMPARALLELPORTMODE
|
---|
1165 | {
|
---|
1166 | /** First invalid mode. */
|
---|
1167 | PDM_PARALLEL_PORT_MODE_INVALID = 0,
|
---|
1168 | /** SPP (Compatibility mode). */
|
---|
1169 | PDM_PARALLEL_PORT_MODE_SPP,
|
---|
1170 | /** EPP Data mode. */
|
---|
1171 | PDM_PARALLEL_PORT_MODE_EPP_DATA,
|
---|
1172 | /** EPP Address mode. */
|
---|
1173 | PDM_PARALLEL_PORT_MODE_EPP_ADDR,
|
---|
1174 | /** ECP mode (not implemented yet). */
|
---|
1175 | PDM_PARALLEL_PORT_MODE_ECP,
|
---|
1176 | /** 32bit hack. */
|
---|
1177 | PDM_PARALLEL_PORT_MODE_32BIT_HACK = 0x7fffffff
|
---|
1178 | } PDMPARALLELPORTMODE;
|
---|
1179 |
|
---|
1180 | /** Pointer to a host parallel port interface. */
|
---|
1181 | typedef struct PDMIHOSTPARALLELPORT *PPDMIHOSTPARALLELPORT;
|
---|
1182 | /**
|
---|
1183 | * Host parallel port interface (down).
|
---|
1184 | * Pair with PDMIHOSTPARALLELCONNECTOR.
|
---|
1185 | */
|
---|
1186 | typedef struct PDMIHOSTPARALLELPORT
|
---|
1187 | {
|
---|
1188 | /**
|
---|
1189 | * Notify device/driver that an interrupt has occurred.
|
---|
1190 | *
|
---|
1191 | * @returns VBox status code.
|
---|
1192 | * @param pInterface Pointer to the interface structure containing the called function pointer.
|
---|
1193 | * @thread Any thread.
|
---|
1194 | */
|
---|
1195 | DECLR3CALLBACKMEMBER(int, pfnNotifyInterrupt,(PPDMIHOSTPARALLELPORT pInterface));
|
---|
1196 | } PDMIHOSTPARALLELPORT;
|
---|
1197 | /** PDMIHOSTPARALLELPORT interface ID. */
|
---|
1198 | #define PDMIHOSTPARALLELPORT_IID "f24b8668-e7f6-4eaa-a14c-4aa2a5f7048e"
|
---|
1199 |
|
---|
1200 |
|
---|
1201 |
|
---|
1202 | /** Pointer to a Host Parallel connector interface. */
|
---|
1203 | typedef struct PDMIHOSTPARALLELCONNECTOR *PPDMIHOSTPARALLELCONNECTOR;
|
---|
1204 | /**
|
---|
1205 | * Host parallel connector interface (up).
|
---|
1206 | * Pair with PDMIHOSTPARALLELPORT.
|
---|
1207 | */
|
---|
1208 | typedef struct PDMIHOSTPARALLELCONNECTOR
|
---|
1209 | {
|
---|
1210 | /**
|
---|
1211 | * Write bits.
|
---|
1212 | *
|
---|
1213 | * @returns VBox status code.
|
---|
1214 | * @param pInterface Pointer to the interface structure containing the called function pointer.
|
---|
1215 | * @param pvBuf Where to store the write bits.
|
---|
1216 | * @param cbWrite Number of bytes to write.
|
---|
1217 | * @param enmMode Mode to write the data.
|
---|
1218 | * @thread Any thread.
|
---|
1219 | * @todo r=klaus cbWrite only defines buffer length, method needs a way top return actually written amount of data.
|
---|
1220 | */
|
---|
1221 | DECLR3CALLBACKMEMBER(int, pfnWrite,(PPDMIHOSTPARALLELCONNECTOR pInterface, const void *pvBuf,
|
---|
1222 | size_t cbWrite, PDMPARALLELPORTMODE enmMode));
|
---|
1223 |
|
---|
1224 | /**
|
---|
1225 | * Read bits.
|
---|
1226 | *
|
---|
1227 | * @returns VBox status code.
|
---|
1228 | * @param pInterface Pointer to the interface structure containing the called function pointer.
|
---|
1229 | * @param pvBuf Where to store the read bits.
|
---|
1230 | * @param cbRead Number of bytes to read.
|
---|
1231 | * @param enmMode Mode to read the data.
|
---|
1232 | * @thread Any thread.
|
---|
1233 | * @todo r=klaus cbRead only defines buffer length, method needs a way top return actually read amount of data.
|
---|
1234 | */
|
---|
1235 | DECLR3CALLBACKMEMBER(int, pfnRead,(PPDMIHOSTPARALLELCONNECTOR pInterface, void *pvBuf,
|
---|
1236 | size_t cbRead, PDMPARALLELPORTMODE enmMode));
|
---|
1237 |
|
---|
1238 | /**
|
---|
1239 | * Set data direction of the port (forward/reverse).
|
---|
1240 | *
|
---|
1241 | * @returns VBox status code.
|
---|
1242 | * @param pInterface Pointer to the interface structure containing the called function pointer.
|
---|
1243 | * @param fForward Flag whether to indicate whether the port is operated in forward or reverse mode.
|
---|
1244 | * @thread Any thread.
|
---|
1245 | */
|
---|
1246 | DECLR3CALLBACKMEMBER(int, pfnSetPortDirection,(PPDMIHOSTPARALLELCONNECTOR pInterface, bool fForward));
|
---|
1247 |
|
---|
1248 | /**
|
---|
1249 | * Write control register bits.
|
---|
1250 | *
|
---|
1251 | * @returns VBox status code.
|
---|
1252 | * @param pInterface Pointer to the interface structure containing the called function pointer.
|
---|
1253 | * @param fReg The new control register value.
|
---|
1254 | * @thread Any thread.
|
---|
1255 | */
|
---|
1256 | DECLR3CALLBACKMEMBER(int, pfnWriteControl,(PPDMIHOSTPARALLELCONNECTOR pInterface, uint8_t fReg));
|
---|
1257 |
|
---|
1258 | /**
|
---|
1259 | * Read control register bits.
|
---|
1260 | *
|
---|
1261 | * @returns VBox status code.
|
---|
1262 | * @param pInterface Pointer to the interface structure containing the called function pointer.
|
---|
1263 | * @param pfReg Where to store the control register bits.
|
---|
1264 | * @thread Any thread.
|
---|
1265 | */
|
---|
1266 | DECLR3CALLBACKMEMBER(int, pfnReadControl,(PPDMIHOSTPARALLELCONNECTOR pInterface, uint8_t *pfReg));
|
---|
1267 |
|
---|
1268 | /**
|
---|
1269 | * Read status register bits.
|
---|
1270 | *
|
---|
1271 | * @returns VBox status code.
|
---|
1272 | * @param pInterface Pointer to the interface structure containing the called function pointer.
|
---|
1273 | * @param pfReg Where to store the status register bits.
|
---|
1274 | * @thread Any thread.
|
---|
1275 | */
|
---|
1276 | DECLR3CALLBACKMEMBER(int, pfnReadStatus,(PPDMIHOSTPARALLELCONNECTOR pInterface, uint8_t *pfReg));
|
---|
1277 |
|
---|
1278 | } PDMIHOSTPARALLELCONNECTOR;
|
---|
1279 | /** PDMIHOSTPARALLELCONNECTOR interface ID. */
|
---|
1280 | #define PDMIHOSTPARALLELCONNECTOR_IID "7c532602-7438-4fbc-9265-349d9f0415f9"
|
---|
1281 |
|
---|
1282 |
|
---|
1283 | /** ACPI power source identifier */
|
---|
1284 | typedef enum PDMACPIPOWERSOURCE
|
---|
1285 | {
|
---|
1286 | PDM_ACPI_POWER_SOURCE_UNKNOWN = 0,
|
---|
1287 | PDM_ACPI_POWER_SOURCE_OUTLET,
|
---|
1288 | PDM_ACPI_POWER_SOURCE_BATTERY
|
---|
1289 | } PDMACPIPOWERSOURCE;
|
---|
1290 | /** Pointer to ACPI battery state. */
|
---|
1291 | typedef PDMACPIPOWERSOURCE *PPDMACPIPOWERSOURCE;
|
---|
1292 |
|
---|
1293 | /** ACPI battey capacity */
|
---|
1294 | typedef enum PDMACPIBATCAPACITY
|
---|
1295 | {
|
---|
1296 | PDM_ACPI_BAT_CAPACITY_MIN = 0,
|
---|
1297 | PDM_ACPI_BAT_CAPACITY_MAX = 100,
|
---|
1298 | PDM_ACPI_BAT_CAPACITY_UNKNOWN = 255
|
---|
1299 | } PDMACPIBATCAPACITY;
|
---|
1300 | /** Pointer to ACPI battery capacity. */
|
---|
1301 | typedef PDMACPIBATCAPACITY *PPDMACPIBATCAPACITY;
|
---|
1302 |
|
---|
1303 | /** ACPI battery state. See ACPI 3.0 spec '_BST (Battery Status)' */
|
---|
1304 | typedef enum PDMACPIBATSTATE
|
---|
1305 | {
|
---|
1306 | PDM_ACPI_BAT_STATE_CHARGED = 0x00,
|
---|
1307 | PDM_ACPI_BAT_STATE_DISCHARGING = 0x01,
|
---|
1308 | PDM_ACPI_BAT_STATE_CHARGING = 0x02,
|
---|
1309 | PDM_ACPI_BAT_STATE_CRITICAL = 0x04
|
---|
1310 | } PDMACPIBATSTATE;
|
---|
1311 | /** Pointer to ACPI battery state. */
|
---|
1312 | typedef PDMACPIBATSTATE *PPDMACPIBATSTATE;
|
---|
1313 |
|
---|
1314 | /** Pointer to an ACPI port interface. */
|
---|
1315 | typedef struct PDMIACPIPORT *PPDMIACPIPORT;
|
---|
1316 | /**
|
---|
1317 | * ACPI port interface (down). Used by both the ACPI driver and (grumble) main.
|
---|
1318 | * Pair with PDMIACPICONNECTOR.
|
---|
1319 | */
|
---|
1320 | typedef struct PDMIACPIPORT
|
---|
1321 | {
|
---|
1322 | /**
|
---|
1323 | * Send an ACPI power off event.
|
---|
1324 | *
|
---|
1325 | * @returns VBox status code
|
---|
1326 | * @param pInterface Pointer to the interface structure containing the called function pointer.
|
---|
1327 | */
|
---|
1328 | DECLR3CALLBACKMEMBER(int, pfnPowerButtonPress,(PPDMIACPIPORT pInterface));
|
---|
1329 |
|
---|
1330 | /**
|
---|
1331 | * Send an ACPI sleep button event.
|
---|
1332 | *
|
---|
1333 | * @returns VBox status code
|
---|
1334 | * @param pInterface Pointer to the interface structure containing the called function pointer.
|
---|
1335 | */
|
---|
1336 | DECLR3CALLBACKMEMBER(int, pfnSleepButtonPress,(PPDMIACPIPORT pInterface));
|
---|
1337 |
|
---|
1338 | /**
|
---|
1339 | * Check if the last power button event was handled by the guest.
|
---|
1340 | *
|
---|
1341 | * @returns VBox status code
|
---|
1342 | * @param pInterface Pointer to the interface structure containing the called function pointer.
|
---|
1343 | * @param pfHandled Is set to true if the last power button event was handled, false otherwise.
|
---|
1344 | */
|
---|
1345 | DECLR3CALLBACKMEMBER(int, pfnGetPowerButtonHandled,(PPDMIACPIPORT pInterface, bool *pfHandled));
|
---|
1346 |
|
---|
1347 | /**
|
---|
1348 | * Check if the guest entered the ACPI mode.
|
---|
1349 | *
|
---|
1350 | * @returns VBox status code
|
---|
1351 | * @param pInterface Pointer to the interface structure containing the called function pointer.
|
---|
1352 | * @param pfEntered Is set to true if the guest entered the ACPI mode, false otherwise.
|
---|
1353 | */
|
---|
1354 | DECLR3CALLBACKMEMBER(int, pfnGetGuestEnteredACPIMode,(PPDMIACPIPORT pInterface, bool *pfEntered));
|
---|
1355 |
|
---|
1356 | /**
|
---|
1357 | * Check if the given CPU is still locked by the guest.
|
---|
1358 | *
|
---|
1359 | * @returns VBox status code
|
---|
1360 | * @param pInterface Pointer to the interface structure containing the called function pointer.
|
---|
1361 | * @param uCpu The CPU to check for.
|
---|
1362 | * @param pfLocked Is set to true if the CPU is still locked by the guest, false otherwise.
|
---|
1363 | */
|
---|
1364 | DECLR3CALLBACKMEMBER(int, pfnGetCpuStatus,(PPDMIACPIPORT pInterface, unsigned uCpu, bool *pfLocked));
|
---|
1365 |
|
---|
1366 | /**
|
---|
1367 | * Send an ACPI monitor hot-plug event.
|
---|
1368 | *
|
---|
1369 | * @returns VBox status code
|
---|
1370 | * @param pInterface Pointer to the interface structure containing
|
---|
1371 | * the called function pointer.
|
---|
1372 | */
|
---|
1373 | DECLR3CALLBACKMEMBER(int, pfnMonitorHotPlugEvent,(PPDMIACPIPORT pInterface));
|
---|
1374 |
|
---|
1375 | /**
|
---|
1376 | * Send a battery status change event.
|
---|
1377 | *
|
---|
1378 | * @returns VBox status code
|
---|
1379 | * @param pInterface Pointer to the interface structure containing
|
---|
1380 | * the called function pointer.
|
---|
1381 | */
|
---|
1382 | DECLR3CALLBACKMEMBER(int, pfnBatteryStatusChangeEvent,(PPDMIACPIPORT pInterface));
|
---|
1383 | } PDMIACPIPORT;
|
---|
1384 | /** PDMIACPIPORT interface ID. */
|
---|
1385 | #define PDMIACPIPORT_IID "974cb8fb-7fda-408c-f9b4-7ff4e3b2a699"
|
---|
1386 |
|
---|
1387 |
|
---|
1388 | /** Pointer to an ACPI connector interface. */
|
---|
1389 | typedef struct PDMIACPICONNECTOR *PPDMIACPICONNECTOR;
|
---|
1390 | /**
|
---|
1391 | * ACPI connector interface (up).
|
---|
1392 | * Pair with PDMIACPIPORT.
|
---|
1393 | */
|
---|
1394 | typedef struct PDMIACPICONNECTOR
|
---|
1395 | {
|
---|
1396 | /**
|
---|
1397 | * Get the current power source of the host system.
|
---|
1398 | *
|
---|
1399 | * @returns VBox status code
|
---|
1400 | * @param pInterface Pointer to the interface structure containing the called function pointer.
|
---|
1401 | * @param penmPowerSource Pointer to the power source result variable.
|
---|
1402 | */
|
---|
1403 | DECLR3CALLBACKMEMBER(int, pfnQueryPowerSource,(PPDMIACPICONNECTOR, PPDMACPIPOWERSOURCE penmPowerSource));
|
---|
1404 |
|
---|
1405 | /**
|
---|
1406 | * Query the current battery status of the host system.
|
---|
1407 | *
|
---|
1408 | * @returns VBox status code?
|
---|
1409 | * @param pInterface Pointer to the interface structure containing the called function pointer.
|
---|
1410 | * @param pfPresent Is set to true if battery is present, false otherwise.
|
---|
1411 | * @param penmRemainingCapacity Pointer to the battery remaining capacity (0 - 100 or 255 for unknown).
|
---|
1412 | * @param penmBatteryState Pointer to the battery status.
|
---|
1413 | * @param pu32PresentRate Pointer to the present rate (0..1000 of the total capacity).
|
---|
1414 | */
|
---|
1415 | DECLR3CALLBACKMEMBER(int, pfnQueryBatteryStatus,(PPDMIACPICONNECTOR, bool *pfPresent, PPDMACPIBATCAPACITY penmRemainingCapacity,
|
---|
1416 | PPDMACPIBATSTATE penmBatteryState, uint32_t *pu32PresentRate));
|
---|
1417 | } PDMIACPICONNECTOR;
|
---|
1418 | /** PDMIACPICONNECTOR interface ID. */
|
---|
1419 | #define PDMIACPICONNECTOR_IID "5f14bf8d-1edf-4e3a-a1e1-cca9fd08e359"
|
---|
1420 |
|
---|
1421 | struct VMMDevDisplayDef;
|
---|
1422 |
|
---|
1423 | /** Pointer to a VMMDevice port interface. */
|
---|
1424 | typedef struct PDMIVMMDEVPORT *PPDMIVMMDEVPORT;
|
---|
1425 | /**
|
---|
1426 | * VMMDevice port interface (down).
|
---|
1427 | * Pair with PDMIVMMDEVCONNECTOR.
|
---|
1428 | */
|
---|
1429 | typedef struct PDMIVMMDEVPORT
|
---|
1430 | {
|
---|
1431 | /**
|
---|
1432 | * Return the current absolute mouse position in pixels
|
---|
1433 | *
|
---|
1434 | * @returns VBox status code
|
---|
1435 | * @param pInterface Pointer to the interface structure containing the called function pointer.
|
---|
1436 | * @param pxAbs Pointer of result value, can be NULL
|
---|
1437 | * @param pyAbs Pointer of result value, can be NULL
|
---|
1438 | */
|
---|
1439 | DECLR3CALLBACKMEMBER(int, pfnQueryAbsoluteMouse,(PPDMIVMMDEVPORT pInterface, int32_t *pxAbs, int32_t *pyAbs));
|
---|
1440 |
|
---|
1441 | /**
|
---|
1442 | * Set the new absolute mouse position in pixels
|
---|
1443 | *
|
---|
1444 | * @returns VBox status code
|
---|
1445 | * @param pInterface Pointer to the interface structure containing the called function pointer.
|
---|
1446 | * @param xAbs New absolute X position
|
---|
1447 | * @param yAbs New absolute Y position
|
---|
1448 | */
|
---|
1449 | DECLR3CALLBACKMEMBER(int, pfnSetAbsoluteMouse,(PPDMIVMMDEVPORT pInterface, int32_t xAbs, int32_t yAbs));
|
---|
1450 |
|
---|
1451 | /**
|
---|
1452 | * Return the current mouse capability flags
|
---|
1453 | *
|
---|
1454 | * @returns VBox status code
|
---|
1455 | * @param pInterface Pointer to the interface structure containing the called function pointer.
|
---|
1456 | * @param pfCapabilities Pointer of result value
|
---|
1457 | */
|
---|
1458 | DECLR3CALLBACKMEMBER(int, pfnQueryMouseCapabilities,(PPDMIVMMDEVPORT pInterface, uint32_t *pfCapabilities));
|
---|
1459 |
|
---|
1460 | /**
|
---|
1461 | * Set the current mouse capability flag (host side)
|
---|
1462 | *
|
---|
1463 | * @returns VBox status code
|
---|
1464 | * @param pInterface Pointer to the interface structure containing the called function pointer.
|
---|
1465 | * @param fCapsAdded Mask of capabilities to add to the flag
|
---|
1466 | * @param fCapsRemoved Mask of capabilities to remove from the flag
|
---|
1467 | */
|
---|
1468 | DECLR3CALLBACKMEMBER(int, pfnUpdateMouseCapabilities,(PPDMIVMMDEVPORT pInterface, uint32_t fCapsAdded, uint32_t fCapsRemoved));
|
---|
1469 |
|
---|
1470 | /**
|
---|
1471 | * Issue a display resolution change request.
|
---|
1472 | *
|
---|
1473 | * Note that there can only one request in the queue and that in case the guest does
|
---|
1474 | * not process it, issuing another request will overwrite the previous.
|
---|
1475 | *
|
---|
1476 | * @returns VBox status code
|
---|
1477 | * @param pInterface Pointer to the interface structure containing the called function pointer.
|
---|
1478 | * @param cDisplays Number of displays. Can be either 1 or the number of VM virtual monitors.
|
---|
1479 | * @param paDisplays Definitions of guest screens to be applied. See VMMDev.h
|
---|
1480 | * @param fForce Whether to deliver the request to the guest even if the guest has
|
---|
1481 | * the requested resolution already.
|
---|
1482 | * @param fMayNotify Whether to send a hotplug notification to the guest if appropriate.
|
---|
1483 | */
|
---|
1484 | DECLR3CALLBACKMEMBER(int, pfnRequestDisplayChange,(PPDMIVMMDEVPORT pInterface, uint32_t cDisplays,
|
---|
1485 | struct VMMDevDisplayDef const *paDisplays, bool fForce, bool fMayNotify));
|
---|
1486 |
|
---|
1487 | /**
|
---|
1488 | * Pass credentials to guest.
|
---|
1489 | *
|
---|
1490 | * Note that there can only be one set of credentials and the guest may or may not
|
---|
1491 | * query them and may do whatever it wants with them.
|
---|
1492 | *
|
---|
1493 | * @returns VBox status code.
|
---|
1494 | * @param pInterface Pointer to the interface structure containing the called function pointer.
|
---|
1495 | * @param pszUsername User name, may be empty (UTF-8).
|
---|
1496 | * @param pszPassword Password, may be empty (UTF-8).
|
---|
1497 | * @param pszDomain Domain name, may be empty (UTF-8).
|
---|
1498 | * @param fFlags VMMDEV_SETCREDENTIALS_*.
|
---|
1499 | */
|
---|
1500 | DECLR3CALLBACKMEMBER(int, pfnSetCredentials,(PPDMIVMMDEVPORT pInterface, const char *pszUsername,
|
---|
1501 | const char *pszPassword, const char *pszDomain,
|
---|
1502 | uint32_t fFlags));
|
---|
1503 |
|
---|
1504 | /**
|
---|
1505 | * Notify the driver about a VBVA status change.
|
---|
1506 | *
|
---|
1507 | * @returns Nothing. Because it is informational callback.
|
---|
1508 | * @param pInterface Pointer to the interface structure containing the called function pointer.
|
---|
1509 | * @param fEnabled Current VBVA status.
|
---|
1510 | */
|
---|
1511 | DECLR3CALLBACKMEMBER(void, pfnVBVAChange, (PPDMIVMMDEVPORT pInterface, bool fEnabled));
|
---|
1512 |
|
---|
1513 | /**
|
---|
1514 | * Issue a seamless mode change request.
|
---|
1515 | *
|
---|
1516 | * Note that there can only one request in the queue and that in case the guest does
|
---|
1517 | * not process it, issuing another request will overwrite the previous.
|
---|
1518 | *
|
---|
1519 | * @returns VBox status code
|
---|
1520 | * @param pInterface Pointer to the interface structure containing the called function pointer.
|
---|
1521 | * @param fEnabled Seamless mode enabled or not
|
---|
1522 | */
|
---|
1523 | DECLR3CALLBACKMEMBER(int, pfnRequestSeamlessChange,(PPDMIVMMDEVPORT pInterface, bool fEnabled));
|
---|
1524 |
|
---|
1525 | /**
|
---|
1526 | * Issue a memory balloon change request.
|
---|
1527 | *
|
---|
1528 | * Note that there can only one request in the queue and that in case the guest does
|
---|
1529 | * not process it, issuing another request will overwrite the previous.
|
---|
1530 | *
|
---|
1531 | * @returns VBox status code
|
---|
1532 | * @param pInterface Pointer to the interface structure containing the called function pointer.
|
---|
1533 | * @param cMbBalloon Balloon size in megabytes
|
---|
1534 | */
|
---|
1535 | DECLR3CALLBACKMEMBER(int, pfnSetMemoryBalloon,(PPDMIVMMDEVPORT pInterface, uint32_t cMbBalloon));
|
---|
1536 |
|
---|
1537 | /**
|
---|
1538 | * Issue a statistcs interval change request.
|
---|
1539 | *
|
---|
1540 | * Note that there can only one request in the queue and that in case the guest does
|
---|
1541 | * not process it, issuing another request will overwrite the previous.
|
---|
1542 | *
|
---|
1543 | * @returns VBox status code
|
---|
1544 | * @param pInterface Pointer to the interface structure containing the called function pointer.
|
---|
1545 | * @param cSecsStatInterval Statistics query interval in seconds
|
---|
1546 | * (0=disable).
|
---|
1547 | */
|
---|
1548 | DECLR3CALLBACKMEMBER(int, pfnSetStatisticsInterval,(PPDMIVMMDEVPORT pInterface, uint32_t cSecsStatInterval));
|
---|
1549 |
|
---|
1550 | /**
|
---|
1551 | * Notify the guest about a VRDP status change.
|
---|
1552 | *
|
---|
1553 | * @returns VBox status code
|
---|
1554 | * @param pInterface Pointer to the interface structure containing the called function pointer.
|
---|
1555 | * @param fVRDPEnabled Current VRDP status.
|
---|
1556 | * @param uVRDPExperienceLevel Which visual effects to be disabled in
|
---|
1557 | * the guest.
|
---|
1558 | */
|
---|
1559 | DECLR3CALLBACKMEMBER(int, pfnVRDPChange, (PPDMIVMMDEVPORT pInterface, bool fVRDPEnabled, uint32_t uVRDPExperienceLevel));
|
---|
1560 |
|
---|
1561 | /**
|
---|
1562 | * Notify the guest of CPU hot-unplug event.
|
---|
1563 | *
|
---|
1564 | * @returns VBox status code
|
---|
1565 | * @param pInterface Pointer to the interface structure containing the called function pointer.
|
---|
1566 | * @param idCpuCore The core id of the CPU to remove.
|
---|
1567 | * @param idCpuPackage The package id of the CPU to remove.
|
---|
1568 | */
|
---|
1569 | DECLR3CALLBACKMEMBER(int, pfnCpuHotUnplug, (PPDMIVMMDEVPORT pInterface, uint32_t idCpuCore, uint32_t idCpuPackage));
|
---|
1570 |
|
---|
1571 | /**
|
---|
1572 | * Notify the guest of CPU hot-plug event.
|
---|
1573 | *
|
---|
1574 | * @returns VBox status code
|
---|
1575 | * @param pInterface Pointer to the interface structure containing the called function pointer.
|
---|
1576 | * @param idCpuCore The core id of the CPU to add.
|
---|
1577 | * @param idCpuPackage The package id of the CPU to add.
|
---|
1578 | */
|
---|
1579 | DECLR3CALLBACKMEMBER(int, pfnCpuHotPlug, (PPDMIVMMDEVPORT pInterface, uint32_t idCpuCore, uint32_t idCpuPackage));
|
---|
1580 |
|
---|
1581 | } PDMIVMMDEVPORT;
|
---|
1582 | /** PDMIVMMDEVPORT interface ID. */
|
---|
1583 | #define PDMIVMMDEVPORT_IID "9e004f1a-875d-11e9-a673-c77c30f53623"
|
---|
1584 |
|
---|
1585 |
|
---|
1586 | /** Pointer to a HPET legacy notification interface. */
|
---|
1587 | typedef struct PDMIHPETLEGACYNOTIFY *PPDMIHPETLEGACYNOTIFY;
|
---|
1588 | /**
|
---|
1589 | * HPET legacy notification interface.
|
---|
1590 | */
|
---|
1591 | typedef struct PDMIHPETLEGACYNOTIFY
|
---|
1592 | {
|
---|
1593 | /**
|
---|
1594 | * Notify about change of HPET legacy mode.
|
---|
1595 | *
|
---|
1596 | * @param pInterface Pointer to the interface structure containing the
|
---|
1597 | * called function pointer.
|
---|
1598 | * @param fActivated If HPET legacy mode is activated (@c true) or
|
---|
1599 | * deactivated (@c false).
|
---|
1600 | */
|
---|
1601 | DECLR3CALLBACKMEMBER(void, pfnModeChanged,(PPDMIHPETLEGACYNOTIFY pInterface, bool fActivated));
|
---|
1602 | } PDMIHPETLEGACYNOTIFY;
|
---|
1603 | /** PDMIHPETLEGACYNOTIFY interface ID. */
|
---|
1604 | #define PDMIHPETLEGACYNOTIFY_IID "c9ada595-4b65-4311-8b21-b10498997774"
|
---|
1605 |
|
---|
1606 |
|
---|
1607 | /** @name Flags for PDMIVMMDEVPORT::pfnSetCredentials.
|
---|
1608 | * @{ */
|
---|
1609 | /** The guest should perform a logon with the credentials. */
|
---|
1610 | #define VMMDEV_SETCREDENTIALS_GUESTLOGON RT_BIT(0)
|
---|
1611 | /** The guest should prevent local logons. */
|
---|
1612 | #define VMMDEV_SETCREDENTIALS_NOLOCALLOGON RT_BIT(1)
|
---|
1613 | /** The guest should verify the credentials. */
|
---|
1614 | #define VMMDEV_SETCREDENTIALS_JUDGE RT_BIT(15)
|
---|
1615 | /** @} */
|
---|
1616 |
|
---|
1617 | /** Forward declaration of the guest information structure. */
|
---|
1618 | struct VBoxGuestInfo;
|
---|
1619 | /** Forward declaration of the guest information-2 structure. */
|
---|
1620 | struct VBoxGuestInfo2;
|
---|
1621 | /** Forward declaration of the guest statistics structure */
|
---|
1622 | struct VBoxGuestStatistics;
|
---|
1623 | /** Forward declaration of the guest status structure */
|
---|
1624 | struct VBoxGuestStatus;
|
---|
1625 |
|
---|
1626 | /** Forward declaration of the video accelerator command memory. */
|
---|
1627 | struct VBVAMEMORY;
|
---|
1628 | /** Pointer to video accelerator command memory. */
|
---|
1629 | typedef struct VBVAMEMORY *PVBVAMEMORY;
|
---|
1630 |
|
---|
1631 | /** Pointer to a VMMDev connector interface. */
|
---|
1632 | typedef struct PDMIVMMDEVCONNECTOR *PPDMIVMMDEVCONNECTOR;
|
---|
1633 | /**
|
---|
1634 | * VMMDev connector interface (up).
|
---|
1635 | * Pair with PDMIVMMDEVPORT.
|
---|
1636 | */
|
---|
1637 | typedef struct PDMIVMMDEVCONNECTOR
|
---|
1638 | {
|
---|
1639 | /**
|
---|
1640 | * Update guest facility status.
|
---|
1641 | *
|
---|
1642 | * Called in response to VMMDevReq_ReportGuestStatus, reset or state restore.
|
---|
1643 | *
|
---|
1644 | * @param pInterface Pointer to this interface.
|
---|
1645 | * @param uFacility The facility.
|
---|
1646 | * @param uStatus The status.
|
---|
1647 | * @param fFlags Flags assoicated with the update. Currently
|
---|
1648 | * reserved and should be ignored.
|
---|
1649 | * @param pTimeSpecTS Pointer to the timestamp of this report.
|
---|
1650 | * @thread The emulation thread.
|
---|
1651 | */
|
---|
1652 | DECLR3CALLBACKMEMBER(void, pfnUpdateGuestStatus,(PPDMIVMMDEVCONNECTOR pInterface, uint32_t uFacility, uint16_t uStatus,
|
---|
1653 | uint32_t fFlags, PCRTTIMESPEC pTimeSpecTS));
|
---|
1654 |
|
---|
1655 | /**
|
---|
1656 | * Updates a guest user state.
|
---|
1657 | *
|
---|
1658 | * Called in response to VMMDevReq_ReportGuestUserState.
|
---|
1659 | *
|
---|
1660 | * @param pInterface Pointer to this interface.
|
---|
1661 | * @param pszUser Guest user name to update status for.
|
---|
1662 | * @param pszDomain Domain the guest user is bound to. Optional.
|
---|
1663 | * @param uState New guest user state to notify host about.
|
---|
1664 | * @param pabDetails Pointer to optional state data.
|
---|
1665 | * @param cbDetails Size (in bytes) of optional state data.
|
---|
1666 | * @thread The emulation thread.
|
---|
1667 | */
|
---|
1668 | DECLR3CALLBACKMEMBER(void, pfnUpdateGuestUserState,(PPDMIVMMDEVCONNECTOR pInterface, const char *pszUser,
|
---|
1669 | const char *pszDomain, uint32_t uState,
|
---|
1670 | const uint8_t *pabDetails, uint32_t cbDetails));
|
---|
1671 |
|
---|
1672 | /**
|
---|
1673 | * Reports the guest API and OS version.
|
---|
1674 | * Called whenever the Additions issue a guest info report request.
|
---|
1675 | *
|
---|
1676 | * @param pInterface Pointer to this interface.
|
---|
1677 | * @param pGuestInfo Pointer to guest information structure
|
---|
1678 | * @thread The emulation thread.
|
---|
1679 | */
|
---|
1680 | DECLR3CALLBACKMEMBER(void, pfnUpdateGuestInfo,(PPDMIVMMDEVCONNECTOR pInterface, const struct VBoxGuestInfo *pGuestInfo));
|
---|
1681 |
|
---|
1682 | /**
|
---|
1683 | * Reports the detailed Guest Additions version.
|
---|
1684 | *
|
---|
1685 | * @param pInterface Pointer to this interface.
|
---|
1686 | * @param uFullVersion The guest additions version as a full version.
|
---|
1687 | * Use VBOX_FULL_VERSION_GET_MAJOR,
|
---|
1688 | * VBOX_FULL_VERSION_GET_MINOR and
|
---|
1689 | * VBOX_FULL_VERSION_GET_BUILD to access it.
|
---|
1690 | * (This will not be zero, so turn down the
|
---|
1691 | * paranoia level a notch.)
|
---|
1692 | * @param pszName Pointer to the sanitized version name. This can
|
---|
1693 | * be empty, but will not be NULL. If not empty,
|
---|
1694 | * it will contain a build type tag and/or a
|
---|
1695 | * publisher tag. If both, then they are separated
|
---|
1696 | * by an underscore (VBOX_VERSION_STRING fashion).
|
---|
1697 | * @param uRevision The SVN revision. Can be 0.
|
---|
1698 | * @param fFeatures Feature mask, currently none are defined.
|
---|
1699 | *
|
---|
1700 | * @thread The emulation thread.
|
---|
1701 | */
|
---|
1702 | DECLR3CALLBACKMEMBER(void, pfnUpdateGuestInfo2,(PPDMIVMMDEVCONNECTOR pInterface, uint32_t uFullVersion,
|
---|
1703 | const char *pszName, uint32_t uRevision, uint32_t fFeatures));
|
---|
1704 |
|
---|
1705 | /**
|
---|
1706 | * Update the guest additions capabilities.
|
---|
1707 | * This is called when the guest additions capabilities change. The new capabilities
|
---|
1708 | * are given and the connector should update its internal state.
|
---|
1709 | *
|
---|
1710 | * @param pInterface Pointer to this interface.
|
---|
1711 | * @param newCapabilities New capabilities.
|
---|
1712 | * @thread The emulation thread.
|
---|
1713 | */
|
---|
1714 | DECLR3CALLBACKMEMBER(void, pfnUpdateGuestCapabilities,(PPDMIVMMDEVCONNECTOR pInterface, uint32_t newCapabilities));
|
---|
1715 |
|
---|
1716 | /**
|
---|
1717 | * Update the mouse capabilities.
|
---|
1718 | * This is called when the mouse capabilities change. The new capabilities
|
---|
1719 | * are given and the connector should update its internal state.
|
---|
1720 | *
|
---|
1721 | * @param pInterface Pointer to this interface.
|
---|
1722 | * @param newCapabilities New capabilities.
|
---|
1723 | * @thread The emulation thread.
|
---|
1724 | */
|
---|
1725 | DECLR3CALLBACKMEMBER(void, pfnUpdateMouseCapabilities,(PPDMIVMMDEVCONNECTOR pInterface, uint32_t newCapabilities));
|
---|
1726 |
|
---|
1727 | /**
|
---|
1728 | * Update the pointer shape.
|
---|
1729 | * This is called when the mouse pointer shape changes. The new shape
|
---|
1730 | * is passed as a caller allocated buffer that will be freed after returning
|
---|
1731 | *
|
---|
1732 | * @param pInterface Pointer to this interface.
|
---|
1733 | * @param fVisible Visibility indicator (if false, the other parameters are undefined).
|
---|
1734 | * @param fAlpha Flag whether alpha channel is being passed.
|
---|
1735 | * @param xHot Pointer hot spot x coordinate.
|
---|
1736 | * @param yHot Pointer hot spot y coordinate.
|
---|
1737 | * @param x Pointer new x coordinate on screen.
|
---|
1738 | * @param y Pointer new y coordinate on screen.
|
---|
1739 | * @param cx Pointer width in pixels.
|
---|
1740 | * @param cy Pointer height in pixels.
|
---|
1741 | * @param cbScanline Size of one scanline in bytes.
|
---|
1742 | * @param pvShape New shape buffer.
|
---|
1743 | * @thread The emulation thread.
|
---|
1744 | */
|
---|
1745 | DECLR3CALLBACKMEMBER(void, pfnUpdatePointerShape,(PPDMIVMMDEVCONNECTOR pInterface, bool fVisible, bool fAlpha,
|
---|
1746 | uint32_t xHot, uint32_t yHot,
|
---|
1747 | uint32_t cx, uint32_t cy,
|
---|
1748 | void *pvShape));
|
---|
1749 |
|
---|
1750 | /**
|
---|
1751 | * Enable or disable video acceleration on behalf of guest.
|
---|
1752 | *
|
---|
1753 | * @param pInterface Pointer to this interface.
|
---|
1754 | * @param fEnable Whether to enable acceleration.
|
---|
1755 | * @param pVbvaMemory Video accelerator memory.
|
---|
1756 |
|
---|
1757 | * @return VBox rc. VINF_SUCCESS if VBVA was enabled.
|
---|
1758 | * @thread The emulation thread.
|
---|
1759 | */
|
---|
1760 | DECLR3CALLBACKMEMBER(int, pfnVideoAccelEnable,(PPDMIVMMDEVCONNECTOR pInterface, bool fEnable, PVBVAMEMORY pVbvaMemory));
|
---|
1761 |
|
---|
1762 | /**
|
---|
1763 | * Force video queue processing.
|
---|
1764 | *
|
---|
1765 | * @param pInterface Pointer to this interface.
|
---|
1766 | * @thread The emulation thread.
|
---|
1767 | */
|
---|
1768 | DECLR3CALLBACKMEMBER(void, pfnVideoAccelFlush,(PPDMIVMMDEVCONNECTOR pInterface));
|
---|
1769 |
|
---|
1770 | /**
|
---|
1771 | * Return whether the given video mode is supported/wanted by the host.
|
---|
1772 | *
|
---|
1773 | * @returns VBox status code
|
---|
1774 | * @param pInterface Pointer to this interface.
|
---|
1775 | * @param display The guest monitor, 0 for primary.
|
---|
1776 | * @param cy Video mode horizontal resolution in pixels.
|
---|
1777 | * @param cx Video mode vertical resolution in pixels.
|
---|
1778 | * @param cBits Video mode bits per pixel.
|
---|
1779 | * @param pfSupported Where to put the indicator for whether this mode is supported. (output)
|
---|
1780 | * @thread The emulation thread.
|
---|
1781 | */
|
---|
1782 | DECLR3CALLBACKMEMBER(int, pfnVideoModeSupported,(PPDMIVMMDEVCONNECTOR pInterface, uint32_t display, uint32_t cx, uint32_t cy, uint32_t cBits, bool *pfSupported));
|
---|
1783 |
|
---|
1784 | /**
|
---|
1785 | * Queries by how many pixels the height should be reduced when calculating video modes
|
---|
1786 | *
|
---|
1787 | * @returns VBox status code
|
---|
1788 | * @param pInterface Pointer to this interface.
|
---|
1789 | * @param pcyReduction Pointer to the result value.
|
---|
1790 | * @thread The emulation thread.
|
---|
1791 | */
|
---|
1792 | DECLR3CALLBACKMEMBER(int, pfnGetHeightReduction,(PPDMIVMMDEVCONNECTOR pInterface, uint32_t *pcyReduction));
|
---|
1793 |
|
---|
1794 | /**
|
---|
1795 | * Informs about a credentials judgement result from the guest.
|
---|
1796 | *
|
---|
1797 | * @returns VBox status code
|
---|
1798 | * @param pInterface Pointer to this interface.
|
---|
1799 | * @param fFlags Judgement result flags.
|
---|
1800 | * @thread The emulation thread.
|
---|
1801 | */
|
---|
1802 | DECLR3CALLBACKMEMBER(int, pfnSetCredentialsJudgementResult,(PPDMIVMMDEVCONNECTOR pInterface, uint32_t fFlags));
|
---|
1803 |
|
---|
1804 | /**
|
---|
1805 | * Set the visible region of the display
|
---|
1806 | *
|
---|
1807 | * @returns VBox status code.
|
---|
1808 | * @param pInterface Pointer to this interface.
|
---|
1809 | * @param cRect Number of rectangles in pRect
|
---|
1810 | * @param pRect Rectangle array
|
---|
1811 | * @thread The emulation thread.
|
---|
1812 | */
|
---|
1813 | DECLR3CALLBACKMEMBER(int, pfnSetVisibleRegion,(PPDMIVMMDEVCONNECTOR pInterface, uint32_t cRect, PRTRECT pRect));
|
---|
1814 |
|
---|
1815 | /**
|
---|
1816 | * Query the visible region of the display
|
---|
1817 | *
|
---|
1818 | * @returns VBox status code.
|
---|
1819 | * @param pInterface Pointer to this interface.
|
---|
1820 | * @param pcRects Where to return the number of rectangles in
|
---|
1821 | * paRects.
|
---|
1822 | * @param paRects Rectangle array (set to NULL to query the number
|
---|
1823 | * of rectangles)
|
---|
1824 | * @thread The emulation thread.
|
---|
1825 | */
|
---|
1826 | DECLR3CALLBACKMEMBER(int, pfnQueryVisibleRegion,(PPDMIVMMDEVCONNECTOR pInterface, uint32_t *pcRects, PRTRECT paRects));
|
---|
1827 |
|
---|
1828 | /**
|
---|
1829 | * Request the statistics interval
|
---|
1830 | *
|
---|
1831 | * @returns VBox status code.
|
---|
1832 | * @param pInterface Pointer to this interface.
|
---|
1833 | * @param pulInterval Pointer to interval in seconds
|
---|
1834 | * @thread The emulation thread.
|
---|
1835 | */
|
---|
1836 | DECLR3CALLBACKMEMBER(int, pfnQueryStatisticsInterval,(PPDMIVMMDEVCONNECTOR pInterface, uint32_t *pulInterval));
|
---|
1837 |
|
---|
1838 | /**
|
---|
1839 | * Report new guest statistics
|
---|
1840 | *
|
---|
1841 | * @returns VBox status code.
|
---|
1842 | * @param pInterface Pointer to this interface.
|
---|
1843 | * @param pGuestStats Guest statistics
|
---|
1844 | * @thread The emulation thread.
|
---|
1845 | */
|
---|
1846 | DECLR3CALLBACKMEMBER(int, pfnReportStatistics,(PPDMIVMMDEVCONNECTOR pInterface, struct VBoxGuestStatistics *pGuestStats));
|
---|
1847 |
|
---|
1848 | /**
|
---|
1849 | * Query the current balloon size
|
---|
1850 | *
|
---|
1851 | * @returns VBox status code.
|
---|
1852 | * @param pInterface Pointer to this interface.
|
---|
1853 | * @param pcbBalloon Balloon size
|
---|
1854 | * @thread The emulation thread.
|
---|
1855 | */
|
---|
1856 | DECLR3CALLBACKMEMBER(int, pfnQueryBalloonSize,(PPDMIVMMDEVCONNECTOR pInterface, uint32_t *pcbBalloon));
|
---|
1857 |
|
---|
1858 | /**
|
---|
1859 | * Query the current page fusion setting
|
---|
1860 | *
|
---|
1861 | * @returns VBox status code.
|
---|
1862 | * @param pInterface Pointer to this interface.
|
---|
1863 | * @param pfPageFusionEnabled Pointer to boolean
|
---|
1864 | * @thread The emulation thread.
|
---|
1865 | */
|
---|
1866 | DECLR3CALLBACKMEMBER(int, pfnIsPageFusionEnabled,(PPDMIVMMDEVCONNECTOR pInterface, bool *pfPageFusionEnabled));
|
---|
1867 |
|
---|
1868 | } PDMIVMMDEVCONNECTOR;
|
---|
1869 | /** PDMIVMMDEVCONNECTOR interface ID. */
|
---|
1870 | #define PDMIVMMDEVCONNECTOR_IID "aff90240-a443-434e-9132-80c186ab97d4"
|
---|
1871 |
|
---|
1872 |
|
---|
1873 | /**
|
---|
1874 | * Generic status LED core.
|
---|
1875 | * Note that a unit doesn't have to support all the indicators.
|
---|
1876 | */
|
---|
1877 | typedef union PDMLEDCORE
|
---|
1878 | {
|
---|
1879 | /** 32-bit view. */
|
---|
1880 | uint32_t volatile u32;
|
---|
1881 | /** Bit view. */
|
---|
1882 | struct
|
---|
1883 | {
|
---|
1884 | /** Reading/Receiving indicator. */
|
---|
1885 | uint32_t fReading : 1;
|
---|
1886 | /** Writing/Sending indicator. */
|
---|
1887 | uint32_t fWriting : 1;
|
---|
1888 | /** Busy indicator. */
|
---|
1889 | uint32_t fBusy : 1;
|
---|
1890 | /** Error indicator. */
|
---|
1891 | uint32_t fError : 1;
|
---|
1892 | } s;
|
---|
1893 | } PDMLEDCORE;
|
---|
1894 |
|
---|
1895 | /** LED bit masks for the u32 view.
|
---|
1896 | * @{ */
|
---|
1897 | /** Reading/Receiving indicator. */
|
---|
1898 | #define PDMLED_READING RT_BIT(0)
|
---|
1899 | /** Writing/Sending indicator. */
|
---|
1900 | #define PDMLED_WRITING RT_BIT(1)
|
---|
1901 | /** Busy indicator. */
|
---|
1902 | #define PDMLED_BUSY RT_BIT(2)
|
---|
1903 | /** Error indicator. */
|
---|
1904 | #define PDMLED_ERROR RT_BIT(3)
|
---|
1905 | /** @} */
|
---|
1906 |
|
---|
1907 |
|
---|
1908 | /**
|
---|
1909 | * Generic status LED.
|
---|
1910 | * Note that a unit doesn't have to support all the indicators.
|
---|
1911 | */
|
---|
1912 | typedef struct PDMLED
|
---|
1913 | {
|
---|
1914 | /** Just a magic for sanity checking. */
|
---|
1915 | uint32_t u32Magic;
|
---|
1916 | uint32_t u32Alignment; /**< structure size alignment. */
|
---|
1917 | /** The actual LED status.
|
---|
1918 | * Only the device is allowed to change this. */
|
---|
1919 | PDMLEDCORE Actual;
|
---|
1920 | /** The asserted LED status which is cleared by the reader.
|
---|
1921 | * The device will assert the bits but never clear them.
|
---|
1922 | * The driver clears them as it sees fit. */
|
---|
1923 | PDMLEDCORE Asserted;
|
---|
1924 | } PDMLED;
|
---|
1925 |
|
---|
1926 | /** Pointer to an LED. */
|
---|
1927 | typedef PDMLED *PPDMLED;
|
---|
1928 | /** Pointer to a const LED. */
|
---|
1929 | typedef const PDMLED *PCPDMLED;
|
---|
1930 |
|
---|
1931 | /** Magic value for PDMLED::u32Magic. */
|
---|
1932 | #define PDMLED_MAGIC UINT32_C(0x11335577)
|
---|
1933 |
|
---|
1934 | /** Pointer to an LED ports interface. */
|
---|
1935 | typedef struct PDMILEDPORTS *PPDMILEDPORTS;
|
---|
1936 | /**
|
---|
1937 | * Interface for exporting LEDs (down).
|
---|
1938 | * Pair with PDMILEDCONNECTORS.
|
---|
1939 | */
|
---|
1940 | typedef struct PDMILEDPORTS
|
---|
1941 | {
|
---|
1942 | /**
|
---|
1943 | * Gets the pointer to the status LED of a unit.
|
---|
1944 | *
|
---|
1945 | * @returns VBox status code.
|
---|
1946 | * @param pInterface Pointer to the interface structure containing the called function pointer.
|
---|
1947 | * @param iLUN The unit which status LED we desire.
|
---|
1948 | * @param ppLed Where to store the LED pointer.
|
---|
1949 | */
|
---|
1950 | DECLR3CALLBACKMEMBER(int, pfnQueryStatusLed,(PPDMILEDPORTS pInterface, unsigned iLUN, PPDMLED *ppLed));
|
---|
1951 |
|
---|
1952 | } PDMILEDPORTS;
|
---|
1953 | /** PDMILEDPORTS interface ID. */
|
---|
1954 | #define PDMILEDPORTS_IID "435e0cec-8549-4ca0-8c0d-98e52f1dc038"
|
---|
1955 |
|
---|
1956 |
|
---|
1957 | /** Pointer to an LED connectors interface. */
|
---|
1958 | typedef struct PDMILEDCONNECTORS *PPDMILEDCONNECTORS;
|
---|
1959 | /**
|
---|
1960 | * Interface for reading LEDs (up).
|
---|
1961 | * Pair with PDMILEDPORTS.
|
---|
1962 | */
|
---|
1963 | typedef struct PDMILEDCONNECTORS
|
---|
1964 | {
|
---|
1965 | /**
|
---|
1966 | * Notification about a unit which have been changed.
|
---|
1967 | *
|
---|
1968 | * The driver must discard any pointers to data owned by
|
---|
1969 | * the unit and requery it.
|
---|
1970 | *
|
---|
1971 | * @param pInterface Pointer to the interface structure containing the called function pointer.
|
---|
1972 | * @param iLUN The unit number.
|
---|
1973 | */
|
---|
1974 | DECLR3CALLBACKMEMBER(void, pfnUnitChanged,(PPDMILEDCONNECTORS pInterface, unsigned iLUN));
|
---|
1975 | } PDMILEDCONNECTORS;
|
---|
1976 | /** PDMILEDCONNECTORS interface ID. */
|
---|
1977 | #define PDMILEDCONNECTORS_IID "8ed63568-82a7-4193-b57b-db8085ac4495"
|
---|
1978 |
|
---|
1979 |
|
---|
1980 | /** Pointer to a Media Notification interface. */
|
---|
1981 | typedef struct PDMIMEDIANOTIFY *PPDMIMEDIANOTIFY;
|
---|
1982 | /**
|
---|
1983 | * Interface for exporting Medium eject information (up). No interface pair.
|
---|
1984 | */
|
---|
1985 | typedef struct PDMIMEDIANOTIFY
|
---|
1986 | {
|
---|
1987 | /**
|
---|
1988 | * Signals that the medium was ejected.
|
---|
1989 | *
|
---|
1990 | * @returns VBox status code.
|
---|
1991 | * @param pInterface Pointer to the interface structure containing the called function pointer.
|
---|
1992 | * @param iLUN The unit which had the medium ejected.
|
---|
1993 | */
|
---|
1994 | DECLR3CALLBACKMEMBER(int, pfnEjected,(PPDMIMEDIANOTIFY pInterface, unsigned iLUN));
|
---|
1995 |
|
---|
1996 | } PDMIMEDIANOTIFY;
|
---|
1997 | /** PDMIMEDIANOTIFY interface ID. */
|
---|
1998 | #define PDMIMEDIANOTIFY_IID "fc22d53e-feb1-4a9c-b9fb-0a990a6ab288"
|
---|
1999 |
|
---|
2000 |
|
---|
2001 | /** The special status unit number */
|
---|
2002 | #define PDM_STATUS_LUN 999
|
---|
2003 |
|
---|
2004 |
|
---|
2005 | #ifdef VBOX_WITH_HGCM
|
---|
2006 |
|
---|
2007 | /** Abstract HGCM command structure. Used only to define a typed pointer. */
|
---|
2008 | struct VBOXHGCMCMD;
|
---|
2009 |
|
---|
2010 | /** Pointer to HGCM command structure. This pointer is unique and identifies
|
---|
2011 | * the command being processed. The pointer is passed to HGCM connector methods,
|
---|
2012 | * and must be passed back to HGCM port when command is completed.
|
---|
2013 | */
|
---|
2014 | typedef struct VBOXHGCMCMD *PVBOXHGCMCMD;
|
---|
2015 |
|
---|
2016 | /** Pointer to a HGCM port interface. */
|
---|
2017 | typedef struct PDMIHGCMPORT *PPDMIHGCMPORT;
|
---|
2018 | /**
|
---|
2019 | * Host-Guest communication manager port interface (down). Normally implemented
|
---|
2020 | * by VMMDev.
|
---|
2021 | * Pair with PDMIHGCMCONNECTOR.
|
---|
2022 | */
|
---|
2023 | typedef struct PDMIHGCMPORT
|
---|
2024 | {
|
---|
2025 | /**
|
---|
2026 | * Notify the guest on a command completion.
|
---|
2027 | *
|
---|
2028 | * @returns VINF_SUCCESS or VERR_CANCELLED if the guest canceled the call.
|
---|
2029 | * @param pInterface Pointer to this interface.
|
---|
2030 | * @param rc The return code (VBox error code).
|
---|
2031 | * @param pCmd A pointer that identifies the completed command.
|
---|
2032 | */
|
---|
2033 | DECLR3CALLBACKMEMBER(int, pfnCompleted,(PPDMIHGCMPORT pInterface, int32_t rc, PVBOXHGCMCMD pCmd));
|
---|
2034 |
|
---|
2035 | /**
|
---|
2036 | * Checks if @a pCmd was restored & resubmitted from saved state.
|
---|
2037 | *
|
---|
2038 | * @returns true if restored, false if not.
|
---|
2039 | * @param pInterface Pointer to this interface.
|
---|
2040 | * @param pCmd The command we're checking on.
|
---|
2041 | */
|
---|
2042 | DECLR3CALLBACKMEMBER(bool, pfnIsCmdRestored,(PPDMIHGCMPORT pInterface, PVBOXHGCMCMD pCmd));
|
---|
2043 |
|
---|
2044 | /**
|
---|
2045 | * Checks if @a pCmd was cancelled.
|
---|
2046 | *
|
---|
2047 | * @returns true if cancelled, false if not.
|
---|
2048 | * @param pInterface Pointer to this interface.
|
---|
2049 | * @param pCmd The command we're checking on.
|
---|
2050 | */
|
---|
2051 | DECLR3CALLBACKMEMBER(bool, pfnIsCmdCancelled,(PPDMIHGCMPORT pInterface, PVBOXHGCMCMD pCmd));
|
---|
2052 |
|
---|
2053 | /**
|
---|
2054 | * Gets the VMMDevRequestHeader::fRequestor value for @a pCmd.
|
---|
2055 | *
|
---|
2056 | * @returns The fRequestor value, VMMDEV_REQUESTOR_LEGACY if guest does not
|
---|
2057 | * support it, VMMDEV_REQUESTOR_LOWEST if invalid parameters.
|
---|
2058 | * @param pInterface Pointer to this interface.
|
---|
2059 | * @param pCmd The command we're in checking on.
|
---|
2060 | */
|
---|
2061 | DECLR3CALLBACKMEMBER(uint32_t, pfnGetRequestor,(PPDMIHGCMPORT pInterface, PVBOXHGCMCMD pCmd));
|
---|
2062 |
|
---|
2063 | /**
|
---|
2064 | * Gets the VMMDevState::idSession value.
|
---|
2065 | *
|
---|
2066 | * @returns VMMDevState::idSession.
|
---|
2067 | * @param pInterface Pointer to this interface.
|
---|
2068 | */
|
---|
2069 | DECLR3CALLBACKMEMBER(uint64_t, pfnGetVMMDevSessionId,(PPDMIHGCMPORT pInterface));
|
---|
2070 |
|
---|
2071 | } PDMIHGCMPORT;
|
---|
2072 | /** PDMIHGCMPORT interface ID. */
|
---|
2073 | # define PDMIHGCMPORT_IID "28c0a201-68cd-4752-9404-bb42a0c09eb7"
|
---|
2074 |
|
---|
2075 | /* forward decl to hgvmsvc.h. */
|
---|
2076 | struct VBOXHGCMSVCPARM;
|
---|
2077 | /** Pointer to a HGCM service location structure. */
|
---|
2078 | typedef struct HGCMSERVICELOCATION *PHGCMSERVICELOCATION;
|
---|
2079 | /** Pointer to a HGCM connector interface. */
|
---|
2080 | typedef struct PDMIHGCMCONNECTOR *PPDMIHGCMCONNECTOR;
|
---|
2081 | /**
|
---|
2082 | * The Host-Guest communication manager connector interface (up). Normally
|
---|
2083 | * implemented by Main::VMMDevInterface.
|
---|
2084 | * Pair with PDMIHGCMPORT.
|
---|
2085 | */
|
---|
2086 | typedef struct PDMIHGCMCONNECTOR
|
---|
2087 | {
|
---|
2088 | /**
|
---|
2089 | * Locate a service and inform it about a client connection.
|
---|
2090 | *
|
---|
2091 | * @param pInterface Pointer to this interface.
|
---|
2092 | * @param pCmd A pointer that identifies the command.
|
---|
2093 | * @param pServiceLocation Pointer to the service location structure.
|
---|
2094 | * @param pu32ClientID Where to store the client id for the connection.
|
---|
2095 | * @return VBox status code.
|
---|
2096 | * @thread The emulation thread.
|
---|
2097 | */
|
---|
2098 | DECLR3CALLBACKMEMBER(int, pfnConnect,(PPDMIHGCMCONNECTOR pInterface, PVBOXHGCMCMD pCmd, PHGCMSERVICELOCATION pServiceLocation, uint32_t *pu32ClientID));
|
---|
2099 |
|
---|
2100 | /**
|
---|
2101 | * Disconnect from service.
|
---|
2102 | *
|
---|
2103 | * @param pInterface Pointer to this interface.
|
---|
2104 | * @param pCmd A pointer that identifies the command.
|
---|
2105 | * @param u32ClientID The client id returned by the pfnConnect call.
|
---|
2106 | * @return VBox status code.
|
---|
2107 | * @thread The emulation thread.
|
---|
2108 | */
|
---|
2109 | DECLR3CALLBACKMEMBER(int, pfnDisconnect,(PPDMIHGCMCONNECTOR pInterface, PVBOXHGCMCMD pCmd, uint32_t u32ClientID));
|
---|
2110 |
|
---|
2111 | /**
|
---|
2112 | * Process a guest issued command.
|
---|
2113 | *
|
---|
2114 | * @param pInterface Pointer to this interface.
|
---|
2115 | * @param pCmd A pointer that identifies the command.
|
---|
2116 | * @param u32ClientID The client id returned by the pfnConnect call.
|
---|
2117 | * @param u32Function Function to be performed by the service.
|
---|
2118 | * @param cParms Number of parameters in the array pointed to by paParams.
|
---|
2119 | * @param paParms Pointer to an array of parameters.
|
---|
2120 | * @param tsArrival The STAM_GET_TS() value when the request arrived.
|
---|
2121 | * @return VBox status code.
|
---|
2122 | * @thread The emulation thread.
|
---|
2123 | */
|
---|
2124 | DECLR3CALLBACKMEMBER(int, pfnCall,(PPDMIHGCMCONNECTOR pInterface, PVBOXHGCMCMD pCmd, uint32_t u32ClientID, uint32_t u32Function,
|
---|
2125 | uint32_t cParms, struct VBOXHGCMSVCPARM *paParms, uint64_t tsArrival));
|
---|
2126 |
|
---|
2127 | /**
|
---|
2128 | * Notification about the guest cancelling a pending request.
|
---|
2129 | * @param pInterface Pointer to this interface.
|
---|
2130 | * @param pCmd A pointer that identifies the command.
|
---|
2131 | * @param idclient The client id returned by the pfnConnect call.
|
---|
2132 | */
|
---|
2133 | DECLR3CALLBACKMEMBER(void, pfnCancelled,(PPDMIHGCMCONNECTOR pInterface, PVBOXHGCMCMD pCmd, uint32_t idClient));
|
---|
2134 |
|
---|
2135 | } PDMIHGCMCONNECTOR;
|
---|
2136 | /** PDMIHGCMCONNECTOR interface ID. */
|
---|
2137 | # define PDMIHGCMCONNECTOR_IID "33cb5c91-6a4a-4ad9-3fec-d1f7d413c4a5"
|
---|
2138 |
|
---|
2139 | #endif /* VBOX_WITH_HGCM */
|
---|
2140 |
|
---|
2141 |
|
---|
2142 | /** Pointer to a display VBVA callbacks interface. */
|
---|
2143 | typedef struct PDMIDISPLAYVBVACALLBACKS *PPDMIDISPLAYVBVACALLBACKS;
|
---|
2144 | /**
|
---|
2145 | * Display VBVA callbacks interface (up).
|
---|
2146 | */
|
---|
2147 | typedef struct PDMIDISPLAYVBVACALLBACKS
|
---|
2148 | {
|
---|
2149 |
|
---|
2150 | /**
|
---|
2151 | * Informs guest about completion of processing the given Video HW Acceleration
|
---|
2152 | * command, does not wait for the guest to process the command.
|
---|
2153 | *
|
---|
2154 | * @returns ???
|
---|
2155 | * @param pInterface Pointer to this interface.
|
---|
2156 | * @param pCmd The Video HW Acceleration Command that was
|
---|
2157 | * completed.
|
---|
2158 | */
|
---|
2159 | DECLR3CALLBACKMEMBER(int, pfnVHWACommandCompleteAsync,(PPDMIDISPLAYVBVACALLBACKS pInterface,
|
---|
2160 | VBOXVHWACMD RT_UNTRUSTED_VOLATILE_GUEST *pCmd));
|
---|
2161 | } PDMIDISPLAYVBVACALLBACKS;
|
---|
2162 | /** PDMIDISPLAYVBVACALLBACKS */
|
---|
2163 | #define PDMIDISPLAYVBVACALLBACKS_IID "37f34c9c-0491-47dc-a0b3-81697c44a416"
|
---|
2164 |
|
---|
2165 | /** Pointer to a PCI raw connector interface. */
|
---|
2166 | typedef struct PDMIPCIRAWCONNECTOR *PPDMIPCIRAWCONNECTOR;
|
---|
2167 | /**
|
---|
2168 | * PCI raw connector interface (up).
|
---|
2169 | */
|
---|
2170 | typedef struct PDMIPCIRAWCONNECTOR
|
---|
2171 | {
|
---|
2172 |
|
---|
2173 | /**
|
---|
2174 | *
|
---|
2175 | */
|
---|
2176 | DECLR3CALLBACKMEMBER(int, pfnDeviceConstructComplete, (PPDMIPCIRAWCONNECTOR pInterface, const char *pcszName,
|
---|
2177 | uint32_t uHostPciAddress, uint32_t uGuestPciAddress,
|
---|
2178 | int rc));
|
---|
2179 |
|
---|
2180 | } PDMIPCIRAWCONNECTOR;
|
---|
2181 | /** PDMIPCIRAWCONNECTOR interface ID. */
|
---|
2182 | #define PDMIPCIRAWCONNECTOR_IID "14aa9c6c-8869-4782-9dfc-910071a6aebf"
|
---|
2183 |
|
---|
2184 | /** @} */
|
---|
2185 |
|
---|
2186 | RT_C_DECLS_END
|
---|
2187 |
|
---|
2188 | #endif /* !VBOX_INCLUDED_vmm_pdmifs_h */
|
---|