]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdePkg/Include/Protocol/UgaIo.h
Checked in the Protocols introduced in UEFI/PI.
[mirror_edk2.git] / MdePkg / Include / Protocol / UgaIo.h
diff --git a/MdePkg/Include/Protocol/UgaIo.h b/MdePkg/Include/Protocol/UgaIo.h
new file mode 100644 (file)
index 0000000..b1e7d44
--- /dev/null
@@ -0,0 +1,237 @@
+\r
+/*++\r
+\r
+Copyright (c) 2006, Intel Corporation                                                         \r
+All rights reserved. This program and the accompanying materials                          \r
+are licensed and made available under the terms and conditions of the BSD License         \r
+which accompanies this distribution.  The full text of the license may be found at        \r
+http://opensource.org/licenses/bsd-license.php                                            \r
+                                                                                          \r
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+\r
+Module Name:\r
+\r
+  UgaIo.h\r
+\r
+Abstract:\r
+\r
+  UGA IO protocol from the EFI 1.1 specification.\r
+\r
+  Abstraction of a very simple graphics device.\r
+\r
+--*/\r
+\r
+#ifndef __UGA_IO_H__\r
+#define __UGA_IO_H__\r
+\r
+#define EFI_UGA_IO_PROTOCOL_GUID \\r
+  { \\r
+    0x61a4d49e, 0x6f68, 0x4f1b, { 0xb9, 0x22, 0xa8, 0x6e, 0xed, 0xb, 0x7, 0xa2 } \\r
+  }\r
+\r
+typedef struct _EFI_UGA_IO_PROTOCOL EFI_UGA_IO_PROTOCOL;\r
+\r
+typedef UINT32                      UGA_STATUS;\r
+\r
+typedef enum {\r
+  UgaDtParentBus          = 1,\r
+  UgaDtGraphicsController,\r
+  UgaDtOutputController,\r
+  UgaDtOutputPort,\r
+  UgaDtOther\r
+}\r
+UGA_DEVICE_TYPE, *PUGA_DEVICE_TYPE;\r
+\r
+typedef UINT32 UGA_DEVICE_ID, *PUGA_DEVICE_ID;\r
+\r
+typedef struct {\r
+  UGA_DEVICE_TYPE deviceType;\r
+  UGA_DEVICE_ID   deviceId;\r
+  UINT32          ui32DeviceContextSize;\r
+  UINT32          ui32SharedContextSize;\r
+}\r
+UGA_DEVICE_DATA, *PUGA_DEVICE_DATA;\r
+\r
+typedef struct _UGA_DEVICE {\r
+  VOID                *pvDeviceContext;\r
+  VOID                *pvSharedContext;\r
+  VOID                *pvRunTimeContext;\r
+  struct _UGA_DEVICE  *pParentDevice;\r
+  VOID                *pvBusIoServices;\r
+  VOID                *pvStdIoServices;\r
+  UGA_DEVICE_DATA     deviceData;\r
+}\r
+UGA_DEVICE, *PUGA_DEVICE;\r
+\r
+#ifndef UGA_IO_REQUEST_CODE\r
+//\r
+// Prevent conflicts with UGA typedefs.\r
+//\r
+typedef enum {\r
+  UgaIoGetVersion             = 1,\r
+  UgaIoGetChildDevice,\r
+  UgaIoStartDevice,\r
+  UgaIoStopDevice,\r
+  UgaIoFlushDevice,\r
+  UgaIoResetDevice,\r
+  UgaIoGetDeviceState,\r
+  UgaIoSetDeviceState,\r
+  UgaIoSetPowerState,\r
+  UgaIoGetMemoryConfiguration,\r
+  UgaIoSetVideoMode,\r
+  UgaIoCopyRectangle,\r
+  UgaIoGetEdidSegment,\r
+  UgaIoDeviceChannelOpen,\r
+  UgaIoDeviceChannelClose,\r
+  UgaIoDeviceChannelRead,\r
+  UgaIoDeviceChannelWrite,\r
+  UgaIoGetPersistentDataSize,\r
+  UgaIoGetPersistentData,\r
+  UgaIoSetPersistentData,\r
+  UgaIoGetDevicePropertySize,\r
+  UgaIoGetDeviceProperty,\r
+  UgaIoBtPrivateInterface\r
+}\r
+UGA_IO_REQUEST_CODE, *PUGA_IO_REQUEST_CODE;\r
+\r
+#endif\r
+\r
+typedef struct {\r
+  IN UGA_IO_REQUEST_CODE  ioRequestCode;\r
+  IN VOID                 *pvInBuffer;\r
+  IN UINT64               ui64InBufferSize;\r
+  OUT VOID                *pvOutBuffer;\r
+  IN UINT64               ui64OutBufferSize;\r
+  OUT UINT64              ui64BytesReturned;\r
+}\r
+UGA_IO_REQUEST, *PUGA_IO_REQUEST;\r
+\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_UGA_IO_PROTOCOL_CREATE_DEVICE) (\r
+  IN  EFI_UGA_IO_PROTOCOL  * This,\r
+  IN  UGA_DEVICE           * ParentDevice,\r
+  IN  UGA_DEVICE_DATA      * DeviceData,\r
+  IN  VOID                 *RunTimeContext,\r
+  OUT UGA_DEVICE           **Device\r
+  );\r
+\r
+/*++\r
+\r
+  Routine Description:\r
+\r
+    Dynamically allocate storage for a child UGA_DEVICE .\r
+\r
+  Arguments:\r
+\r
+    This           - The EFI_UGA_IO_PROTOCOL instance. Type EFI_UGA_IO_PROTOCOL is \r
+                     defined in Section 10.7.\r
+\r
+    ParentDevice   - ParentDevice specifies a pointer to the parent device of Device.\r
+\r
+    DeviceData     - A pointer to UGA_DEVICE_DATA returned from a call to DispatchService()\r
+                     with a UGA_DEVICE of Parent and an IoRequest of type UgaIoGetChildDevice.\r
+\r
+    RuntimeContext - Context to associate with Device.\r
+\r
+    Device         - The Device returns a dynamically allocated child UGA_DEVICE object\r
+                     for ParentDevice. The caller is responsible for deleting Device.\r
+      \r
+  Returns:\r
+\r
+    EFI_SUCCESS           - Device was returned.\r
+\r
+    EFI_INVALID_PARAMETER - One of the arguments was not valid.\r
+\r
+    EFI_DEVICE_ERROR      - The device had an error and could not complete the request.\r
+\r
+--*/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_UGA_IO_PROTOCOL_DELETE_DEVICE) (\r
+  IN EFI_UGA_IO_PROTOCOL  * This,\r
+  IN UGA_DEVICE           * Device\r
+  );\r
+\r
+/*++\r
+\r
+  Routine Description:\r
+\r
+    Delete a dynamically allocated child UGA_DEVICE object that was allocated via\r
+    CreateDevice() .\r
+\r
+  Arguments:\r
+\r
+    This   - The EFI_UGA_IO_PROTOCOL instance. Type EFI_UGA_IO_PROTOCOL is defined \r
+             in Section 10.7.\r
+\r
+    Device - The Device points to a UGA_DEVICE object that was dynamically\r
+             allocated via a CreateDevice() call.\r
+\r
+  Returns:\r
+\r
+    EFI_SUCCESS           - Device was deleted.\r
+\r
+    EFI_INVALID_PARAMETER - The Device was not allocated via CreateDevice()\r
+\r
+--*/\r
+typedef UGA_STATUS (EFIAPI *PUGA_FW_SERVICE_DISPATCH) (IN PUGA_DEVICE pDevice, IN OUT PUGA_IO_REQUEST pIoRequest);\r
+\r
+/*++\r
+\r
+  Routine Description:\r
+\r
+    This is the main UGA service dispatch routine for all UGA_IO_REQUEST s.\r
+\r
+  Arguments:\r
+\r
+    pDevice    - pDevice specifies a pointer to a device object associated with a \r
+                 device enumerated by a pIoRequest->ioRequestCode of type \r
+                 UgaIoGetChildDevice. The root device for the EFI_UGA_IO_PROTOCOL \r
+                 is represented by pDevice being set to NULL.\r
+\r
+    pIoRequest - pIoRequest points to a caller allocated buffer that contains data\r
+                 defined by pIoRequest->ioRequestCode. See Related Definitions for\r
+                 a definition of UGA_IO_REQUEST_CODE s and their associated data \r
+                 structures.\r
+\r
+  Returns:\r
+\r
+  Varies depending on pIoRequest.\r
+\r
+--*/\r
+struct _EFI_UGA_IO_PROTOCOL {\r
+  EFI_UGA_IO_PROTOCOL_CREATE_DEVICE CreateDevice;\r
+  EFI_UGA_IO_PROTOCOL_DELETE_DEVICE DeleteDevice;\r
+  PUGA_FW_SERVICE_DISPATCH          DispatchService;\r
+};\r
+\r
+extern EFI_GUID gEfiUgaIoProtocolGuid;\r
+\r
+//\r
+// Data structure that is stored in the EFI Configuration Table with the\r
+// EFI_UGA_IO_PROTOCOL_GUID.  The option ROMs listed in this table may have\r
+// EBC UGA drivers.\r
+//\r
+typedef struct {\r
+  UINT32  Version;\r
+  UINT32  HeaderSize;\r
+  UINT32  SizeOfEntries;\r
+  UINT32  NumberOfEntries;\r
+} EFI_DRIVER_OS_HANDOFF_HEADER;\r
+\r
+typedef enum {\r
+  EfiUgaDriverFromPciRom,\r
+  EfiUgaDriverFromSystem,\r
+  EfiDriverHandoffMax\r
+} EFI_DRIVER_HANOFF_ENUM;\r
+\r
+typedef struct {\r
+  EFI_DRIVER_HANOFF_ENUM    Type;\r
+  EFI_DEVICE_PATH_PROTOCOL  *DevicePath;\r
+  VOID                      *PciRomImage;\r
+  UINT64                    PciRomSize;\r
+} EFI_DRIVER_OS_HANDOFF;\r
+\r
+#endif\r