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
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.
18 UGA IO protocol from the EFI 1.1 specification.
20 Abstraction of a very simple graphics device.
27 #define EFI_UGA_IO_PROTOCOL_GUID \
29 0x61a4d49e, 0x6f68, 0x4f1b, { 0xb9, 0x22, 0xa8, 0x6e, 0xed, 0xb, 0x7, 0xa2 } \
32 typedef struct _EFI_UGA_IO_PROTOCOL EFI_UGA_IO_PROTOCOL
;
34 typedef UINT32 UGA_STATUS
;
38 UgaDtGraphicsController
,
39 UgaDtOutputController
,
43 UGA_DEVICE_TYPE
, *PUGA_DEVICE_TYPE
;
45 typedef UINT32 UGA_DEVICE_ID
, *PUGA_DEVICE_ID
;
48 UGA_DEVICE_TYPE deviceType
;
49 UGA_DEVICE_ID deviceId
;
50 UINT32 ui32DeviceContextSize
;
51 UINT32 ui32SharedContextSize
;
53 UGA_DEVICE_DATA
, *PUGA_DEVICE_DATA
;
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
;
64 UGA_DEVICE
, *PUGA_DEVICE
;
67 // Prevent conflicts with UGA typedefs.
79 UgaIoGetMemoryConfiguration
,
83 UgaIoDeviceChannelOpen
,
84 UgaIoDeviceChannelClose
,
85 UgaIoDeviceChannelRead
,
86 UgaIoDeviceChannelWrite
,
87 UgaIoGetPersistentDataSize
,
88 UgaIoGetPersistentData
,
89 UgaIoSetPersistentData
,
90 UgaIoGetDevicePropertySize
,
91 UgaIoGetDeviceProperty
,
92 UgaIoBtPrivateInterface
94 UGA_IO_REQUEST_CODE
, *PUGA_IO_REQUEST_CODE
;
97 IN UGA_IO_REQUEST_CODE ioRequestCode
;
99 IN UINT64 ui64InBufferSize
;
100 OUT VOID
*pvOutBuffer
;
101 IN UINT64 ui64OutBufferSize
;
102 OUT UINT64 ui64BytesReturned
;
104 UGA_IO_REQUEST
, *PUGA_IO_REQUEST
;
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
120 Dynamically allocate storage for a child UGA_DEVICE .
124 This - The EFI_UGA_IO_PROTOCOL instance. Type EFI_UGA_IO_PROTOCOL is
125 defined in Section 10.7.
127 ParentDevice - ParentDevice specifies a pointer to the parent device of Device.
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.
132 RuntimeContext - Context to associate with Device.
134 Device - The Device returns a dynamically allocated child UGA_DEVICE object
135 for ParentDevice. The caller is responsible for deleting Device.
139 EFI_SUCCESS - Device was returned.
141 EFI_INVALID_PARAMETER - One of the arguments was not valid.
143 EFI_DEVICE_ERROR - The device had an error and could not complete the request.
148 (EFIAPI
*EFI_UGA_IO_PROTOCOL_DELETE_DEVICE
) (
149 IN EFI_UGA_IO_PROTOCOL
* This
,
150 IN UGA_DEVICE
* Device
157 Delete a dynamically allocated child UGA_DEVICE object that was allocated via
162 This - The EFI_UGA_IO_PROTOCOL instance. Type EFI_UGA_IO_PROTOCOL is defined
165 Device - The Device points to a UGA_DEVICE object that was dynamically
166 allocated via a CreateDevice() call.
170 EFI_SUCCESS - Device was deleted.
172 EFI_INVALID_PARAMETER - The Device was not allocated via CreateDevice()
175 typedef UGA_STATUS (EFIAPI
*PUGA_FW_SERVICE_DISPATCH
) (IN PUGA_DEVICE pDevice
, IN OUT PUGA_IO_REQUEST pIoRequest
);
181 This is the main UGA service dispatch routine for all UGA_IO_REQUEST s.
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.
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
197 Varies depending on pIoRequest.
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
;
206 extern EFI_GUID gEfiUgaIoProtocolGuid
;
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
216 UINT32 SizeOfEntries
;
217 UINT32 NumberOfEntries
;
218 } EFI_DRIVER_OS_HANDOFF_HEADER
;
221 EfiUgaDriverFromPciRom
,
222 EfiUgaDriverFromSystem
,
224 } EFI_DRIVER_HANOFF_ENUM
;
227 EFI_DRIVER_HANOFF_ENUM Type
;
228 EFI_DEVICE_PATH_PROTOCOL
*DevicePath
;
231 } EFI_DRIVER_OS_HANDOFF
;