VirtualBox

source: vbox/trunk/include/VBox/vmm/pdmifs.h@ 75320

Last change on this file since 75320 was 73766, checked in by vboxsync, 6 years ago

Serial: Remove the old serial code and switch over to the new one by default now that it is mostly stable (Any remaining bugs will get fixed)

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

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette