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