]>
Commit | Line | Data |
---|---|---|
842f5579 | 1 | /** @file\r |
8a7d75b0 | 2 | UGA IO protocol from the EFI 1.10 specification.\r |
d1f95000 | 3 | \r |
4 | Abstraction of a very simple graphics device.\r | |
842f5579 | 5 | \r |
4ca9b6c4 | 6 | Copyright (c) 2006 - 2008, Intel Corporation \r |
842f5579 A |
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 |
23 | typedef struct _EFI_UGA_IO_PROTOCOL EFI_UGA_IO_PROTOCOL;\r | |
24 | \r | |
25 | typedef UINT32 UGA_STATUS;\r | |
26 | \r | |
27 | typedef enum {\r | |
28 | UgaDtParentBus = 1,\r | |
29 | UgaDtGraphicsController,\r | |
30 | UgaDtOutputController,\r | |
31 | UgaDtOutputPort,\r | |
32 | UgaDtOther\r | |
9319d2c2 | 33 | } UGA_DEVICE_TYPE, *PUGA_DEVICE_TYPE;\r |
d1f95000 | 34 | \r |
35 | typedef UINT32 UGA_DEVICE_ID, *PUGA_DEVICE_ID;\r | |
36 | \r | |
37 | typedef struct {\r | |
38 | UGA_DEVICE_TYPE deviceType;\r | |
39 | UGA_DEVICE_ID deviceId;\r | |
40 | UINT32 ui32DeviceContextSize;\r | |
41 | UINT32 ui32SharedContextSize;\r | |
9319d2c2 | 42 | } UGA_DEVICE_DATA, *PUGA_DEVICE_DATA;\r |
d1f95000 | 43 | \r |
44 | typedef struct _UGA_DEVICE {\r | |
45 | VOID *pvDeviceContext;\r | |
46 | VOID *pvSharedContext;\r | |
47 | VOID *pvRunTimeContext;\r | |
48 | struct _UGA_DEVICE *pParentDevice;\r | |
49 | VOID *pvBusIoServices;\r | |
50 | VOID *pvStdIoServices;\r | |
51 | UGA_DEVICE_DATA deviceData;\r | |
9319d2c2 | 52 | } UGA_DEVICE, *PUGA_DEVICE;\r |
d1f95000 | 53 | \r |
d1f95000 | 54 | typedef enum {\r |
55 | UgaIoGetVersion = 1,\r | |
56 | UgaIoGetChildDevice,\r | |
57 | UgaIoStartDevice,\r | |
58 | UgaIoStopDevice,\r | |
59 | UgaIoFlushDevice,\r | |
60 | UgaIoResetDevice,\r | |
61 | UgaIoGetDeviceState,\r | |
62 | UgaIoSetDeviceState,\r | |
63 | UgaIoSetPowerState,\r | |
64 | UgaIoGetMemoryConfiguration,\r | |
65 | UgaIoSetVideoMode,\r | |
66 | UgaIoCopyRectangle,\r | |
67 | UgaIoGetEdidSegment,\r | |
68 | UgaIoDeviceChannelOpen,\r | |
69 | UgaIoDeviceChannelClose,\r | |
70 | UgaIoDeviceChannelRead,\r | |
71 | UgaIoDeviceChannelWrite,\r | |
72 | UgaIoGetPersistentDataSize,\r | |
73 | UgaIoGetPersistentData,\r | |
74 | UgaIoSetPersistentData,\r | |
75 | UgaIoGetDevicePropertySize,\r | |
76 | UgaIoGetDeviceProperty,\r | |
77 | UgaIoBtPrivateInterface\r | |
9319d2c2 | 78 | } UGA_IO_REQUEST_CODE, *PUGA_IO_REQUEST_CODE;\r |
d1f95000 | 79 | \r |
d1f95000 | 80 | typedef struct {\r |
81 | IN UGA_IO_REQUEST_CODE ioRequestCode;\r | |
82 | IN VOID *pvInBuffer;\r | |
83 | IN UINT64 ui64InBufferSize;\r | |
84 | OUT VOID *pvOutBuffer;\r | |
85 | IN UINT64 ui64OutBufferSize;\r | |
86 | OUT UINT64 ui64BytesReturned;\r | |
bf231ea6 A |
87 | } UGA_IO_REQUEST, *PUGA_IO_REQUEST;\r |
88 | \r | |
89 | \r | |
c8e2c759 | 90 | /**\r |
bf231ea6 | 91 | Dynamically allocate storage for a child UGA_DEVICE .\r |
c8e2c759 | 92 | \r |
93 | @param[in] This The EFI_UGA_IO_PROTOCOL instance. \r | |
94 | @param[in] ParentDevice ParentDevice specifies a pointer to the parent device of Device.\r | |
bf231ea6 | 95 | @param[in] DeviceData A pointer to UGA_DEVICE_DATA returned from a call to DispatchService()\r |
c8e2c759 | 96 | with a UGA_DEVICE of Parent and an IoRequest of type UgaIoGetChildDevice. \r |
97 | @param[in] RunTimeContext Context to associate with Device. \r | |
bf231ea6 | 98 | @param[out] Device The Device returns a dynamically allocated child UGA_DEVICE object\r |
c8e2c759 | 99 | for ParentDevice. The caller is responsible for deleting Device.\r |
100 | \r | |
bf231ea6 A |
101 | \r |
102 | @retval EFI_SUCCESS Device was returned.\r | |
103 | @retval EFI_INVALID_PARAMETER One of the arguments was not valid.\r | |
104 | @retval EFI_DEVICE_ERROR The device had an error and could not complete the request.\r | |
d1f95000 | 105 | \r |
bf231ea6 | 106 | **/\r |
d1f95000 | 107 | typedef\r |
108 | EFI_STATUS\r | |
8b13229b | 109 | (EFIAPI *EFI_UGA_IO_PROTOCOL_CREATE_DEVICE)(\r |
bf231ea6 A |
110 | IN EFI_UGA_IO_PROTOCOL *This,\r |
111 | IN UGA_DEVICE *ParentDevice,\r | |
112 | IN UGA_DEVICE_DATA *DeviceData,\r | |
d1f95000 | 113 | IN VOID *RunTimeContext,\r |
114 | OUT UGA_DEVICE **Device\r | |
115 | );\r | |
116 | \r | |
d1f95000 | 117 | \r |
c8e2c759 | 118 | /**\r |
bf231ea6 | 119 | Delete a dynamically allocated child UGA_DEVICE object that was allocated via CreateDevice() .\r |
c8e2c759 | 120 | \r |
bf231ea6 | 121 | @param[in] This The EFI_UGA_IO_PROTOCOL instance. Type EFI_UGA_IO_PROTOCOL is \r |
c8e2c759 | 122 | defined in Section 10.7.\r |
bf231ea6 A |
123 | @param[in] Device The Device points to a UGA_DEVICE object that was dynamically\r |
124 | allocated via a CreateDevice() call.\r | |
c8e2c759 | 125 | \r |
bf231ea6 A |
126 | \r |
127 | @retval EFI_SUCCESS Device was returned.\r | |
128 | @retval EFI_INVALID_PARAMETER The Device was not allocated via CreateDevice().\r | |
d1f95000 | 129 | \r |
bf231ea6 | 130 | **/\r |
d1f95000 | 131 | typedef\r |
132 | EFI_STATUS\r | |
8b13229b | 133 | (EFIAPI *EFI_UGA_IO_PROTOCOL_DELETE_DEVICE)(\r |
d1f95000 | 134 | IN EFI_UGA_IO_PROTOCOL * This,\r |
135 | IN UGA_DEVICE * Device\r | |
136 | );\r | |
137 | \r | |
bf231ea6 | 138 | /**\r |
19bee90c | 139 | This is the main UGA service dispatch routine for all UGA_IO_REQUEST s.\r |
d1f95000 | 140 | \r |
19bee90c | 141 | @param pDevice pDevice specifies a pointer to a device object associated with a \r |
d1f95000 | 142 | device enumerated by a pIoRequest->ioRequestCode of type \r |
143 | UgaIoGetChildDevice. The root device for the EFI_UGA_IO_PROTOCOL \r | |
144 | is represented by pDevice being set to NULL.\r | |
145 | \r | |
19bee90c LG |
146 | @param pIoRequest \r |
147 | pIoRequest points to a caller allocated buffer that contains data\r | |
d1f95000 | 148 | defined by pIoRequest->ioRequestCode. See Related Definitions for\r |
149 | a definition of UGA_IO_REQUEST_CODE s and their associated data \r | |
150 | structures.\r | |
151 | \r | |
19bee90c | 152 | @return UGA_STATUS\r |
d1f95000 | 153 | \r |
bf231ea6 | 154 | **/\r |
19bee90c LG |
155 | typedef UGA_STATUS \r |
156 | (EFIAPI *PUGA_FW_SERVICE_DISPATCH)(\r | |
157 | IN PUGA_DEVICE pDevice, \r | |
158 | IN OUT PUGA_IO_REQUEST pIoRequest\r | |
159 | );\r | |
160 | \r | |
44717a39 | 161 | ///\r |
162 | /// Provides a basic abstraction to send I/O requests to the graphics device and any of its children.\r | |
163 | ///\r | |
d1f95000 | 164 | struct _EFI_UGA_IO_PROTOCOL {\r |
165 | EFI_UGA_IO_PROTOCOL_CREATE_DEVICE CreateDevice;\r | |
166 | EFI_UGA_IO_PROTOCOL_DELETE_DEVICE DeleteDevice;\r | |
167 | PUGA_FW_SERVICE_DISPATCH DispatchService;\r | |
168 | };\r | |
169 | \r | |
170 | extern EFI_GUID gEfiUgaIoProtocolGuid;\r | |
171 | \r | |
172 | //\r | |
173 | // Data structure that is stored in the EFI Configuration Table with the\r | |
174 | // EFI_UGA_IO_PROTOCOL_GUID. The option ROMs listed in this table may have\r | |
175 | // EBC UGA drivers.\r | |
176 | //\r | |
177 | typedef struct {\r | |
178 | UINT32 Version;\r | |
179 | UINT32 HeaderSize;\r | |
180 | UINT32 SizeOfEntries;\r | |
181 | UINT32 NumberOfEntries;\r | |
182 | } EFI_DRIVER_OS_HANDOFF_HEADER;\r | |
183 | \r | |
184 | typedef enum {\r | |
185 | EfiUgaDriverFromPciRom,\r | |
186 | EfiUgaDriverFromSystem,\r | |
187 | EfiDriverHandoffMax\r | |
188 | } EFI_DRIVER_HANOFF_ENUM;\r | |
189 | \r | |
190 | typedef struct {\r | |
191 | EFI_DRIVER_HANOFF_ENUM Type;\r | |
192 | EFI_DEVICE_PATH_PROTOCOL *DevicePath;\r | |
193 | VOID *PciRomImage;\r | |
194 | UINT64 PciRomSize;\r | |
195 | } EFI_DRIVER_OS_HANDOFF;\r | |
196 | \r | |
197 | #endif\r |