]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Include/Protocol/UgaIo.h
Keep the C name of SIMPLE TEXT OUTPUT PROTOCOL unchanged for backward-compatible...
[mirror_edk2.git] / MdePkg / Include / Protocol / UgaIo.h
CommitLineData
d1f95000 1\r
2/*++\r
3\r
4Copyright (c) 2006, Intel Corporation \r
5All rights reserved. This program and the accompanying materials \r
6are licensed and made available under the terms and conditions of the BSD License \r
7which accompanies this distribution. The full text of the license may be found at \r
8http://opensource.org/licenses/bsd-license.php \r
9 \r
10THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
11WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
12\r
13Module Name:\r
14\r
15 UgaIo.h\r
16\r
17Abstract:\r
18\r
19 UGA IO protocol from the EFI 1.1 specification.\r
20\r
21 Abstraction of a very simple graphics device.\r
22\r
23--*/\r
24\r
25#ifndef __UGA_IO_H__\r
26#define __UGA_IO_H__\r
27\r
28#define EFI_UGA_IO_PROTOCOL_GUID \\r
29 { \\r
30 0x61a4d49e, 0x6f68, 0x4f1b, { 0xb9, 0x22, 0xa8, 0x6e, 0xed, 0xb, 0x7, 0xa2 } \\r
31 }\r
32\r
33typedef struct _EFI_UGA_IO_PROTOCOL EFI_UGA_IO_PROTOCOL;\r
34\r
35typedef UINT32 UGA_STATUS;\r
36\r
37typedef enum {\r
38 UgaDtParentBus = 1,\r
39 UgaDtGraphicsController,\r
40 UgaDtOutputController,\r
41 UgaDtOutputPort,\r
42 UgaDtOther\r
43}\r
44UGA_DEVICE_TYPE, *PUGA_DEVICE_TYPE;\r
45\r
46typedef UINT32 UGA_DEVICE_ID, *PUGA_DEVICE_ID;\r
47\r
48typedef struct {\r
49 UGA_DEVICE_TYPE deviceType;\r
50 UGA_DEVICE_ID deviceId;\r
51 UINT32 ui32DeviceContextSize;\r
52 UINT32 ui32SharedContextSize;\r
53}\r
54UGA_DEVICE_DATA, *PUGA_DEVICE_DATA;\r
55\r
56typedef struct _UGA_DEVICE {\r
57 VOID *pvDeviceContext;\r
58 VOID *pvSharedContext;\r
59 VOID *pvRunTimeContext;\r
60 struct _UGA_DEVICE *pParentDevice;\r
61 VOID *pvBusIoServices;\r
62 VOID *pvStdIoServices;\r
63 UGA_DEVICE_DATA deviceData;\r
64}\r
65UGA_DEVICE, *PUGA_DEVICE;\r
66\r
67#ifndef UGA_IO_REQUEST_CODE\r
68//\r
69// Prevent conflicts with UGA typedefs.\r
70//\r
71typedef enum {\r
72 UgaIoGetVersion = 1,\r
73 UgaIoGetChildDevice,\r
74 UgaIoStartDevice,\r
75 UgaIoStopDevice,\r
76 UgaIoFlushDevice,\r
77 UgaIoResetDevice,\r
78 UgaIoGetDeviceState,\r
79 UgaIoSetDeviceState,\r
80 UgaIoSetPowerState,\r
81 UgaIoGetMemoryConfiguration,\r
82 UgaIoSetVideoMode,\r
83 UgaIoCopyRectangle,\r
84 UgaIoGetEdidSegment,\r
85 UgaIoDeviceChannelOpen,\r
86 UgaIoDeviceChannelClose,\r
87 UgaIoDeviceChannelRead,\r
88 UgaIoDeviceChannelWrite,\r
89 UgaIoGetPersistentDataSize,\r
90 UgaIoGetPersistentData,\r
91 UgaIoSetPersistentData,\r
92 UgaIoGetDevicePropertySize,\r
93 UgaIoGetDeviceProperty,\r
94 UgaIoBtPrivateInterface\r
95}\r
96UGA_IO_REQUEST_CODE, *PUGA_IO_REQUEST_CODE;\r
97\r
98#endif\r
99\r
100typedef struct {\r
101 IN UGA_IO_REQUEST_CODE ioRequestCode;\r
102 IN VOID *pvInBuffer;\r
103 IN UINT64 ui64InBufferSize;\r
104 OUT VOID *pvOutBuffer;\r
105 IN UINT64 ui64OutBufferSize;\r
106 OUT UINT64 ui64BytesReturned;\r
107}\r
108UGA_IO_REQUEST, *PUGA_IO_REQUEST;\r
109\r
110typedef\r
111EFI_STATUS\r
112(EFIAPI *EFI_UGA_IO_PROTOCOL_CREATE_DEVICE) (\r
113 IN EFI_UGA_IO_PROTOCOL * This,\r
114 IN UGA_DEVICE * ParentDevice,\r
115 IN UGA_DEVICE_DATA * DeviceData,\r
116 IN VOID *RunTimeContext,\r
117 OUT UGA_DEVICE **Device\r
118 );\r
119\r
120/*++\r
121\r
122 Routine Description:\r
123\r
124 Dynamically allocate storage for a child UGA_DEVICE .\r
125\r
126 Arguments:\r
127\r
128 This - The EFI_UGA_IO_PROTOCOL instance. Type EFI_UGA_IO_PROTOCOL is \r
129 defined in Section 10.7.\r
130\r
131 ParentDevice - ParentDevice specifies a pointer to the parent device of Device.\r
132\r
133 DeviceData - A pointer to UGA_DEVICE_DATA returned from a call to DispatchService()\r
134 with a UGA_DEVICE of Parent and an IoRequest of type UgaIoGetChildDevice.\r
135\r
136 RuntimeContext - Context to associate with Device.\r
137\r
138 Device - The Device returns a dynamically allocated child UGA_DEVICE object\r
139 for ParentDevice. The caller is responsible for deleting Device.\r
140 \r
141 Returns:\r
142\r
143 EFI_SUCCESS - Device was returned.\r
144\r
145 EFI_INVALID_PARAMETER - One of the arguments was not valid.\r
146\r
147 EFI_DEVICE_ERROR - The device had an error and could not complete the request.\r
148\r
149--*/\r
150typedef\r
151EFI_STATUS\r
152(EFIAPI *EFI_UGA_IO_PROTOCOL_DELETE_DEVICE) (\r
153 IN EFI_UGA_IO_PROTOCOL * This,\r
154 IN UGA_DEVICE * Device\r
155 );\r
156\r
157/*++\r
158\r
159 Routine Description:\r
160\r
161 Delete a dynamically allocated child UGA_DEVICE object that was allocated via\r
162 CreateDevice() .\r
163\r
164 Arguments:\r
165\r
166 This - The EFI_UGA_IO_PROTOCOL instance. Type EFI_UGA_IO_PROTOCOL is defined \r
167 in Section 10.7.\r
168\r
169 Device - The Device points to a UGA_DEVICE object that was dynamically\r
170 allocated via a CreateDevice() call.\r
171\r
172 Returns:\r
173\r
174 EFI_SUCCESS - Device was deleted.\r
175\r
176 EFI_INVALID_PARAMETER - The Device was not allocated via CreateDevice()\r
177\r
178--*/\r
179typedef UGA_STATUS (EFIAPI *PUGA_FW_SERVICE_DISPATCH) (IN PUGA_DEVICE pDevice, IN OUT PUGA_IO_REQUEST pIoRequest);\r
180\r
181/*++\r
182\r
183 Routine Description:\r
184\r
185 This is the main UGA service dispatch routine for all UGA_IO_REQUEST s.\r
186\r
187 Arguments:\r
188\r
189 pDevice - pDevice specifies a pointer to a device object associated with a \r
190 device enumerated by a pIoRequest->ioRequestCode of type \r
191 UgaIoGetChildDevice. The root device for the EFI_UGA_IO_PROTOCOL \r
192 is represented by pDevice being set to NULL.\r
193\r
194 pIoRequest - pIoRequest points to a caller allocated buffer that contains data\r
195 defined by pIoRequest->ioRequestCode. See Related Definitions for\r
196 a definition of UGA_IO_REQUEST_CODE s and their associated data \r
197 structures.\r
198\r
199 Returns:\r
200\r
201 Varies depending on pIoRequest.\r
202\r
203--*/\r
204struct _EFI_UGA_IO_PROTOCOL {\r
205 EFI_UGA_IO_PROTOCOL_CREATE_DEVICE CreateDevice;\r
206 EFI_UGA_IO_PROTOCOL_DELETE_DEVICE DeleteDevice;\r
207 PUGA_FW_SERVICE_DISPATCH DispatchService;\r
208};\r
209\r
210extern EFI_GUID gEfiUgaIoProtocolGuid;\r
211\r
212//\r
213// Data structure that is stored in the EFI Configuration Table with the\r
214// EFI_UGA_IO_PROTOCOL_GUID. The option ROMs listed in this table may have\r
215// EBC UGA drivers.\r
216//\r
217typedef struct {\r
218 UINT32 Version;\r
219 UINT32 HeaderSize;\r
220 UINT32 SizeOfEntries;\r
221 UINT32 NumberOfEntries;\r
222} EFI_DRIVER_OS_HANDOFF_HEADER;\r
223\r
224typedef enum {\r
225 EfiUgaDriverFromPciRom,\r
226 EfiUgaDriverFromSystem,\r
227 EfiDriverHandoffMax\r
228} EFI_DRIVER_HANOFF_ENUM;\r
229\r
230typedef struct {\r
231 EFI_DRIVER_HANOFF_ENUM Type;\r
232 EFI_DEVICE_PATH_PROTOCOL *DevicePath;\r
233 VOID *PciRomImage;\r
234 UINT64 PciRomSize;\r
235} EFI_DRIVER_OS_HANDOFF;\r
236\r
237#endif\r