PageRenderTime 48ms CodeModel.GetById 24ms RepoModel.GetById 1ms app.codeStats 0ms

/WindSLIC_EFI/include/efiUgaIo.h

https://github.com/untermensch/WindSLIC
C Header | 234 lines | 108 code | 20 blank | 106 comment | 0 complexity | 93838a0981d8b7389559ff711027f014 MD5 | raw file
  1. /*++
  2. Copyright (c) 1999 - 2002 Intel Corporation. All rights reserved
  3. This software and associated documentation (if any) is furnished
  4. under a license and may only be used or copied in accordance
  5. with the terms of the license. Except as permitted by such
  6. license, no part of this software or documentation may be
  7. reproduced, stored in a retrieval system, or transmitted in any
  8. form or by any means without the express written consent of
  9. Intel Corporation.
  10. Module Name:
  11. UgaIo.h
  12. Abstract:
  13. UGA IO protocol from the EFI 1.1 specification.
  14. Abstraction of a very simple graphics device.
  15. --*/
  16. #ifndef __UGA_IO_H__
  17. #define __UGA_IO_H__
  18. #define EFI_UGA_IO_PROTOCOL_GUID \
  19. {0x61a4d49e, 0x6f68, 0x4f1b, 0xb9,0x22,0xa8,0x6e,0xed,0xb,0x7,0xa2}
  20. typedef struct _EFI_UGA_IO_PROTOCOL EFI_UGA_IO_PROTOCOL;
  21. typedef UINT32 UGA_STATUS;
  22. typedef enum {
  23. UgaDtParentBus = 1,
  24. UgaDtGraphicsController,
  25. UgaDtOutputController,
  26. UgaDtOutputPort, UgaDtOther
  27. } UGA_DEVICE_TYPE, *PUGA_DEVICE_TYPE;
  28. typedef UINT32 UGA_DEVICE_ID, *PUGA_DEVICE_ID;
  29. typedef struct {
  30. UGA_DEVICE_TYPE deviceType;
  31. UGA_DEVICE_ID deviceId;
  32. UINT32 ui32DeviceContextSize;
  33. UINT32 ui32SharedContextSize;
  34. } UGA_DEVICE_DATA, *PUGA_DEVICE_DATA;
  35. typedef struct _UGA_DEVICE {
  36. VOID *pvDeviceContext;
  37. VOID *pvSharedContext;
  38. VOID *pvRunTimeContext;
  39. struct _UGA_DEVICE *pParentDevice;
  40. VOID *pvBusIoServices;
  41. VOID *pvStdIoServices;
  42. UGA_DEVICE_DATA deviceData;
  43. } UGA_DEVICE, *PUGA_DEVICE;
  44. #ifndef UGA_IO_REQUEST_CODE
  45. //
  46. // Prevent conflicts with UGA typedefs.
  47. //
  48. typedef enum {
  49. UgaIoGetVersion = 1,
  50. UgaIoGetChildDevice,
  51. UgaIoStartDevice,
  52. UgaIoStopDevice,
  53. UgaIoFlushDevice,
  54. UgaIoResetDevice,
  55. UgaIoGetDeviceState,
  56. UgaIoSetDeviceState,
  57. UgaIoSetPowerState,
  58. UgaIoGetMemoryConfiguration,
  59. UgaIoSetVideoMode,
  60. UgaIoCopyRectangle,
  61. UgaIoGetEdidSegment,
  62. UgaIoDeviceChannelOpen,
  63. UgaIoDeviceChannelClose,
  64. UgaIoDeviceChannelRead,
  65. UgaIoDeviceChannelWrite,
  66. UgaIoGetPersistentDataSize,
  67. UgaIoGetPersistentData,
  68. UgaIoSetPersistentData,
  69. UgaIoGetDevicePropertySize,
  70. UgaIoGetDeviceProperty,
  71. UgaIoBtPrivateInterface
  72. } UGA_IO_REQUEST_CODE, *PUGA_IO_REQUEST_CODE;
  73. #endif
  74. typedef struct {
  75. IN UGA_IO_REQUEST_CODE ioRequestCode;
  76. IN VOID *pvInBuffer;
  77. IN UINT64 ui64InBufferSize;
  78. OUT VOID *pvOutBuffer;
  79. IN UINT64 ui64OutBufferSize;
  80. OUT UINT64 ui64BytesReturned;
  81. } UGA_IO_REQUEST, *PUGA_IO_REQUEST;
  82. typedef
  83. EFI_STATUS
  84. (EFIAPI *EFI_UGA_IO_PROTOCOL_CREATE_DEVICE) (
  85. IN EFI_UGA_IO_PROTOCOL *This,
  86. IN UGA_DEVICE *ParentDevice,
  87. IN UGA_DEVICE_DATA *DeviceData,
  88. IN VOID *RunTimeContext,
  89. OUT UGA_DEVICE **Device
  90. );
  91. /*++
  92. Routine Description:
  93. Dynamically allocate storage for a child UGA_DEVICE .
  94. Arguments:
  95. This - The EFI_UGA_IO_PROTOCOL instance. Type EFI_UGA_IO_PROTOCOL is
  96. defined in Section 10.7.
  97. ParentDevice - ParentDevice specifies a pointer to the parent device of Device.
  98. DeviceData - A pointer to UGA_DEVICE_DATA returned from a call to DispatchService()
  99. with a UGA_DEVICE of Parent and an IoRequest of type UgaIoGetChildDevice.
  100. RuntimeContext - Context to associate with Device.
  101. Device - The Device returns a dynamically allocated child UGA_DEVICE object
  102. for ParentDevice. The caller is responsible for deleting Device.
  103. Returns:
  104. EFI_SUCCESS - Device was returned.
  105. EFI_INVALID_PARAMETER - One of the arguments was not valid.
  106. EFI_DEVICE_ERROR - The device had an error and could not complete the request.
  107. --*/
  108. typedef
  109. EFI_STATUS
  110. (EFIAPI *EFI_UGA_IO_PROTOCOL_DELETE_DEVICE) (
  111. IN EFI_UGA_IO_PROTOCOL *This,
  112. IN UGA_DEVICE *Device
  113. );
  114. /*++
  115. Routine Description:
  116. Delete a dynamically allocated child UGA_DEVICE object that was allocated via
  117. CreateDevice() .
  118. Arguments:
  119. This - The EFI_UGA_IO_PROTOCOL instance. Type EFI_UGA_IO_PROTOCOL is defined
  120. in Section 10.7.
  121. Device - The Device points to a UGA_DEVICE object that was dynamically
  122. allocated via a CreateDevice() call.
  123. Returns:
  124. EFI_SUCCESS - Device was deleted.
  125. EFI_INVALID_PARAMETER - The Device was not allocated via CreateDevice()
  126. --*/
  127. typedef
  128. UGA_STATUS
  129. (EFIAPI *PUGA_FW_SERVICE_DISPATCH) (
  130. IN PUGA_DEVICE pDevice,
  131. IN OUT PUGA_IO_REQUEST pIoRequest
  132. );
  133. /*++
  134. Routine Description:
  135. This is the main UGA service dispatch routine for all UGA_IO_REQUEST s.
  136. Arguments:
  137. pDevice - pDevice specifies a pointer to a device object associated with a
  138. device enumerated by a pIoRequest->ioRequestCode of type
  139. UgaIoGetChildDevice. The root device for the EFI_UGA_IO_PROTOCOL
  140. is represented by pDevice being set to NULL.
  141. pIoRequest - pIoRequest points to a caller allocated buffer that contains data
  142. defined by pIoRequest->ioRequestCode. See “Related Definitions” for
  143. a definition of UGA_IO_REQUEST_CODE s and their associated data
  144. structures.
  145. Returns:
  146. Varies depending on pIoRequest.
  147. --*/
  148. typedef struct _EFI_UGA_IO_PROTOCOL {
  149. EFI_UGA_IO_PROTOCOL_CREATE_DEVICE CreateDevice;
  150. EFI_UGA_IO_PROTOCOL_DELETE_DEVICE DeleteDevice;
  151. PUGA_FW_SERVICE_DISPATCH DispatchService;
  152. } EFI_UGA_IO_PROTOCOL;
  153. extern EFI_GUID UgaIoProtocol;
  154. //
  155. // Data structure that is stored in the EFI Configuration Table with the
  156. // EFI_UGA_IO_PROTOCOL_GUID. The option ROMs listed in this table may have
  157. // EBC UGA drivers.
  158. //
  159. typedef struct {
  160. UINT32 Version;
  161. UINT32 HeaderSize;
  162. UINT32 SizeOfEntries;
  163. UINT32 NumberOfEntries;
  164. } EFI_DRIVER_OS_HANDOFF_HEADER;
  165. typedef enum {
  166. EfiUgaDriverFromPciRom,
  167. EfiUgaDriverFromSystem,
  168. EfiDriverHandoffMax
  169. } EFI_DRIVER_HANOFF_ENUM;
  170. typedef struct {
  171. EFI_DRIVER_HANOFF_ENUM Type;
  172. EFI_DEVICE_PATH_PROTOCOL *DevicePath;
  173. VOID *PciRomImage;
  174. UINT64 PciRomSize;
  175. } EFI_DRIVER_OS_HANDOFF;
  176. #endif