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