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