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