1 | /* $Id: HGSMIChSetup.h 69015 2017-10-09 12:50:34Z vboxsync $ */
|
---|
2 | /** @file
|
---|
3 | * VBox Host Guest Shared Memory Interface (HGSMI), Host/Guest shared part.
|
---|
4 | */
|
---|
5 |
|
---|
6 | /*
|
---|
7 | * Copyright (C) 2006-2017 Oracle Corporation
|
---|
8 | *
|
---|
9 | * Permission is hereby granted, free of charge, to any person obtaining a
|
---|
10 | * copy of this software and associated documentation files (the "Software"),
|
---|
11 | * to deal in the Software without restriction, including without limitation
|
---|
12 | * the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
---|
13 | * and/or sell copies of the Software, and to permit persons to whom the
|
---|
14 | * Software is furnished to do so, subject to the following conditions:
|
---|
15 | *
|
---|
16 | * The above copyright notice and this permission notice shall be included in
|
---|
17 | * all copies or substantial portions of the Software.
|
---|
18 | *
|
---|
19 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
---|
20 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
---|
21 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
---|
22 | * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
|
---|
23 | * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
---|
24 | * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
---|
25 | * OTHER DEALINGS IN THE SOFTWARE.
|
---|
26 | */
|
---|
27 |
|
---|
28 | #ifndef ___VBox_Graphics_HGSMIChSetup_h
|
---|
29 | #define ___VBox_Graphics_HGSMIChSetup_h
|
---|
30 |
|
---|
31 | #include "HGSMIDefs.h"
|
---|
32 |
|
---|
33 | /* HGSMI setup and configuration channel commands and data structures. */
|
---|
34 | /*
|
---|
35 | * Tell the host the location of hgsmi_host_flags structure, where the host
|
---|
36 | * can write information about pending buffers, etc, and which can be quickly
|
---|
37 | * polled by the guest without a need to port IO.
|
---|
38 | */
|
---|
39 | #define HGSMI_CC_HOST_FLAGS_LOCATION 0
|
---|
40 |
|
---|
41 | typedef struct HGSMIBUFFERLOCATION
|
---|
42 | {
|
---|
43 | HGSMIOFFSET offLocation;
|
---|
44 | HGSMISIZE cbLocation;
|
---|
45 | } HGSMIBUFFERLOCATION;
|
---|
46 | AssertCompileSize(HGSMIBUFFERLOCATION, 8);
|
---|
47 |
|
---|
48 | /* HGSMI setup and configuration data structures. */
|
---|
49 | /* host->guest commands pending, should be accessed under FIFO lock only */
|
---|
50 | #define HGSMIHOSTFLAGS_COMMANDS_PENDING UINT32_C(0x01)
|
---|
51 | /* IRQ is fired, should be accessed under VGAState::lock only */
|
---|
52 | #define HGSMIHOSTFLAGS_IRQ UINT32_C(0x02)
|
---|
53 | #ifdef VBOX_WITH_WDDM
|
---|
54 | /* one or more guest commands is completed, should be accessed under FIFO lock only */
|
---|
55 | # define HGSMIHOSTFLAGS_GCOMMAND_COMPLETED UINT32_C(0x04)
|
---|
56 | /* watchdog timer interrupt flag (used for debugging), should be accessed under VGAState::lock only */
|
---|
57 | # define HGSMIHOSTFLAGS_WATCHDOG UINT32_C(0x08)
|
---|
58 | #endif
|
---|
59 | /* vsync interrupt flag, should be accessed under VGAState::lock only */
|
---|
60 | #define HGSMIHOSTFLAGS_VSYNC UINT32_C(0x10)
|
---|
61 | /** monitor hotplug flag, should be accessed under VGAState::lock only */
|
---|
62 | #define HGSMIHOSTFLAGS_HOTPLUG UINT32_C(0x20)
|
---|
63 | /**
|
---|
64 | * Cursor capability state change flag, should be accessed under
|
---|
65 | * VGAState::lock only. @see VBVACONF32.
|
---|
66 | */
|
---|
67 | #define HGSMIHOSTFLAGS_CURSOR_CAPABILITIES UINT32_C(0x40)
|
---|
68 |
|
---|
69 | typedef struct HGSMIHOSTFLAGS
|
---|
70 | {
|
---|
71 | /*
|
---|
72 | * Host flags can be accessed and modified in multiple threads
|
---|
73 | * concurrently, e.g. CrOpenGL HGCM and GUI threads when completing
|
---|
74 | * HGSMI 3D and Video Accel respectively, EMT thread when dealing with
|
---|
75 | * HGSMI command processing, etc.
|
---|
76 | * Besides settings/cleaning flags atomically, some flags have their
|
---|
77 | * own special sync restrictions, see comments for flags above.
|
---|
78 | */
|
---|
79 | volatile uint32_t u32HostFlags;
|
---|
80 | uint32_t au32Reserved[3];
|
---|
81 | } HGSMIHOSTFLAGS;
|
---|
82 | AssertCompileSize(HGSMIHOSTFLAGS, 16);
|
---|
83 |
|
---|
84 | #endif
|
---|