4 Copyright (c) 2006, Intel Corporation
5 All rights reserved. This program and the accompanying materials
6 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution. The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
19 UGA IO protocol from the EFI 1.1 specification.
21 Abstraction of a very simple graphics device.
28 #define EFI_UGA_IO_PROTOCOL_GUID \
30 0x61a4d49e, 0x6f68, 0x4f1b, { 0xb9, 0x22, 0xa8, 0x6e, 0xed, 0xb, 0x7, 0xa2 } \
33 typedef struct _EFI_UGA_IO_PROTOCOL EFI_UGA_IO_PROTOCOL
;
35 typedef UINT32 UGA_STATUS
;
39 UgaDtGraphicsController
,
40 UgaDtOutputController
,
44 UGA_DEVICE_TYPE
, *PUGA_DEVICE_TYPE
;
46 typedef UINT32 UGA_DEVICE_ID
, *PUGA_DEVICE_ID
;
49 UGA_DEVICE_TYPE deviceType
;
50 UGA_DEVICE_ID deviceId
;
51 UINT32 ui32DeviceContextSize
;
52 UINT32 ui32SharedContextSize
;
54 UGA_DEVICE_DATA
, *PUGA_DEVICE_DATA
;
56 typedef struct _UGA_DEVICE
{
57 VOID
*pvDeviceContext
;
58 VOID
*pvSharedContext
;
59 VOID
*pvRunTimeContext
;
60 struct _UGA_DEVICE
*pParentDevice
;
61 VOID
*pvBusIoServices
;
62 VOID
*pvStdIoServices
;
63 UGA_DEVICE_DATA deviceData
;
65 UGA_DEVICE
, *PUGA_DEVICE
;
67 #ifndef UGA_IO_REQUEST_CODE
69 // Prevent conflicts with UGA typedefs.
81 UgaIoGetMemoryConfiguration
,
85 UgaIoDeviceChannelOpen
,
86 UgaIoDeviceChannelClose
,
87 UgaIoDeviceChannelRead
,
88 UgaIoDeviceChannelWrite
,
89 UgaIoGetPersistentDataSize
,
90 UgaIoGetPersistentData
,
91 UgaIoSetPersistentData
,
92 UgaIoGetDevicePropertySize
,
93 UgaIoGetDeviceProperty
,
94 UgaIoBtPrivateInterface
96 UGA_IO_REQUEST_CODE
, *PUGA_IO_REQUEST_CODE
;
101 IN UGA_IO_REQUEST_CODE ioRequestCode
;
103 IN UINT64 ui64InBufferSize
;
104 OUT VOID
*pvOutBuffer
;
105 IN UINT64 ui64OutBufferSize
;
106 OUT UINT64 ui64BytesReturned
;
108 UGA_IO_REQUEST
, *PUGA_IO_REQUEST
;
112 (EFIAPI
*EFI_UGA_IO_PROTOCOL_CREATE_DEVICE
) (
113 IN EFI_UGA_IO_PROTOCOL
* This
,
114 IN UGA_DEVICE
* ParentDevice
,
115 IN UGA_DEVICE_DATA
* DeviceData
,
116 IN VOID
*RunTimeContext
,
117 OUT UGA_DEVICE
**Device
124 Dynamically allocate storage for a child UGA_DEVICE .
128 This - The EFI_UGA_IO_PROTOCOL instance. Type EFI_UGA_IO_PROTOCOL is
129 defined in Section 10.7.
131 ParentDevice - ParentDevice specifies a pointer to the parent device of Device.
133 DeviceData - A pointer to UGA_DEVICE_DATA returned from a call to DispatchService()
134 with a UGA_DEVICE of Parent and an IoRequest of type UgaIoGetChildDevice.
136 RuntimeContext - Context to associate with Device.
138 Device - The Device returns a dynamically allocated child UGA_DEVICE object
139 for ParentDevice. The caller is responsible for deleting Device.
143 EFI_SUCCESS - Device was returned.
145 EFI_INVALID_PARAMETER - One of the arguments was not valid.
147 EFI_DEVICE_ERROR - The device had an error and could not complete the request.
152 (EFIAPI
*EFI_UGA_IO_PROTOCOL_DELETE_DEVICE
) (
153 IN EFI_UGA_IO_PROTOCOL
* This
,
154 IN UGA_DEVICE
* Device
161 Delete a dynamically allocated child UGA_DEVICE object that was allocated via
166 This - The EFI_UGA_IO_PROTOCOL instance. Type EFI_UGA_IO_PROTOCOL is defined
169 Device - The Device points to a UGA_DEVICE object that was dynamically
170 allocated via a CreateDevice() call.
174 EFI_SUCCESS - Device was deleted.
176 EFI_INVALID_PARAMETER - The Device was not allocated via CreateDevice()
179 typedef UGA_STATUS (EFIAPI
*PUGA_FW_SERVICE_DISPATCH
) (IN PUGA_DEVICE pDevice
, IN OUT PUGA_IO_REQUEST pIoRequest
);
185 This is the main UGA service dispatch routine for all UGA_IO_REQUEST s.
189 pDevice - pDevice specifies a pointer to a device object associated with a
190 device enumerated by a pIoRequest->ioRequestCode of type
191 UgaIoGetChildDevice. The root device for the EFI_UGA_IO_PROTOCOL
192 is represented by pDevice being set to NULL.
194 pIoRequest - pIoRequest points to a caller allocated buffer that contains data
195 defined by pIoRequest->ioRequestCode. See Related Definitions for
196 a definition of UGA_IO_REQUEST_CODE s and their associated data
201 Varies depending on pIoRequest.
204 struct _EFI_UGA_IO_PROTOCOL
{
205 EFI_UGA_IO_PROTOCOL_CREATE_DEVICE CreateDevice
;
206 EFI_UGA_IO_PROTOCOL_DELETE_DEVICE DeleteDevice
;
207 PUGA_FW_SERVICE_DISPATCH DispatchService
;
210 extern EFI_GUID gEfiUgaIoProtocolGuid
;
213 // Data structure that is stored in the EFI Configuration Table with the
214 // EFI_UGA_IO_PROTOCOL_GUID. The option ROMs listed in this table may have
220 UINT32 SizeOfEntries
;
221 UINT32 NumberOfEntries
;
222 } EFI_DRIVER_OS_HANDOFF_HEADER
;
225 EfiUgaDriverFromPciRom
,
226 EfiUgaDriverFromSystem
,
228 } EFI_DRIVER_HANOFF_ENUM
;
231 EFI_DRIVER_HANOFF_ENUM Type
;
232 EFI_DEVICE_PATH_PROTOCOL
*DevicePath
;
235 } EFI_DRIVER_OS_HANDOFF
;