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