+++ /dev/null
-/** @file\r
- The EFI Legacy BIOS Patform Protocol is used to mate a Legacy16 \r
- implementation with this EFI code. The EFI driver that produces \r
- the Legacy BIOS protocol is generic and consumes this protocol.\r
- A driver that matches the Legacy16 produces this protocol\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: LegacyBiosPlatform.h\r
-\r
- @par Revision Reference:\r
- This protocol is defined in Framework for EFI Compatibility Support Module spec\r
- Version 0.96\r
-**/\r
-\r
-#ifndef _EFI_LEGACY_BIOS_PLATFORM_H\r
-#define _EFI_LEGACY_BIOS_PLATFORM_H\r
-\r
-#define EFI_LEGACY_BIOS_PLATFORM_PROTOCOL_GUID \\r
- { \\r
- 0x783658a3, 0x4172, 0x4421, {0xa2, 0x99, 0xe0, 0x9, 0x7, 0x9c, 0xc, 0xb4 } \\r
- }\r
-\r
-typedef struct _EFI_LEGACY_BIOS_PLATFORM_PROTOCOL EFI_LEGACY_BIOS_PLATFORM_PROTOCOL;\r
-\r
-#pragma pack(1)\r
-//\r
-// Define structures for GetOemIntData\r
-// Note:\r
-// OemIntDataElenent is an array of structures from 0 to Count-1.\r
-// RawData is an array of bytes from 0 to RamDataLength-1.\r
-//\r
-typedef struct {\r
- UINT16 Int;\r
- UINT16 Ax;\r
- UINT32 RawDataLength;\r
- UINT8 RawData[1];\r
-} EFI_OEM_INT_DATA_ELEMENT;\r
-\r
-typedef struct {\r
- UINT16 Count;\r
- EFI_OEM_INT_DATA_ELEMENT OemIntDataElement[1];\r
-} EFI_OEM_INT_DATA;\r
-#pragma pack()\r
-\r
-typedef enum {\r
- EfiGetPlatformBinaryMpTable = 0,\r
- EfiGetPlatformBinaryOemIntData = 1,\r
- EfiGetPlatformBinaryOem16Data = 2,\r
- EfiGetPlatformBinaryOem32Data = 3,\r
- EfiGetPlatformBinaryTpmBinary = 4,\r
- EfiGetPlatformBinarySystemRom = 5,\r
- EfiGetPlatformPciExpressBase = 6,\r
- EfiGetPlatformPmmSize = 7,\r
- EfiGetPlatformEndOpromShadowAddr = 8,\r
-\r
-} EFI_GET_PLATFORM_INFO_MODE;\r
-\r
-typedef enum {\r
- EfiGetPlatformVgaHandle = 0,\r
- EfiGetPlatformIdeHandle = 1,\r
- EfiGetPlatformIsaBusHandle = 2,\r
- EfiGetPlatformUsbHandle = 3\r
-} EFI_GET_PLATFORM_HANDLE_MODE;\r
-\r
-typedef enum {\r
- EfiPlatformHookPrepareToScanRom = 0,\r
- EfiPlatformHookShadowServiceRoms= 1,\r
- EfiPlatformHookAfterRomInit = 2\r
-} EFI_GET_PLATFORM_HOOK_MODE;\r
-\r
-/**\r
- Finds the binary data or other platform information.\r
-\r
- @param This Protocol instance pointer.\r
- @param Mode Specifies what data to return\r
- @param Table Pointer to MP table.\r
- @param TableSize Size in bytes of table.\r
- @param Location Legacy region requested\r
- 0x00 = Any location\r
- Bit 0 = 0xF0000 region\r
- Bit 1 = 0xE0000 region\r
- Multiple bits can be set\r
- @param Alignment Address alignment for allocation.\r
- Bit mapped. First non-zero bit from right\r
- is alignment.\r
- @param LegacySegment Segment in LegacyBios where Table is stored\r
- @param LegacyOffset Offset in LegacyBios where Table is stored\r
-\r
- @retval EFI_SUCCESS Data was returned successfully.\r
- @retval EFI_UNSUPPORTED Mode is not supported on the platform.\r
- @retval EFI_NOT_FOUND Binary image or table not found.\r
-\r
-**/\r
-typedef\r
-EFI_STATUS\r
-(EFIAPI *EFI_LEGACY_BIOS_PLATFORM_GET_PLATFORM_INFO) (\r
- IN EFI_LEGACY_BIOS_PLATFORM_PROTOCOL *This,\r
- IN EFI_GET_PLATFORM_INFO_MODE Mode,\r
- OUT VOID **Table,\r
- OUT UINTN *TableSize,\r
- OUT UINTN *Location,\r
- OUT UINTN *Alignment,\r
- IN UINT16 LegacySegment,\r
- IN UINT16 LegacyOffset\r
- )\r
-;\r
-\r
-/**\r
- Returns a buffer of handles for the requested sub-function.\r
-\r
- @param This Protocol instance pointer.\r
- @param Mode Specifies what handle to return.\r
- @param Type Type from Device Path for Handle to represent.\r
- @param HandleBuffer Handles of the device/controller in priority order\r
- with HandleBuffer[0] highest priority.\r
- @param HandleCount Number of handles in the buffer.\r
- @param AdditionalData Mode specific.\r
-\r
- @retval EFI_SUCCESS Handle is valid\r
- @retval EFI_UNSUPPORTED Mode is not supported on the platform.\r
- @retval EFI_NOT_FOUND Handle is not known\r
-\r
-**/\r
-typedef\r
-EFI_STATUS\r
-(EFIAPI *EFI_LEGACY_BIOS_PLATFORM_GET_PLATFORM_HANDLE) (\r
- IN EFI_LEGACY_BIOS_PLATFORM_PROTOCOL *This,\r
- IN EFI_GET_PLATFORM_HANDLE_MODE Mode,\r
- IN UINT16 Type,\r
- OUT EFI_HANDLE **HandleBuffer,\r
- OUT UINTN *HandleCount,\r
- IN VOID **AdditionalData OPTIONAL\r
- )\r
-;\r
-\r
-/**\r
- Load and initialize the Legacy BIOS SMM handler.\r
-\r
- @param This Protocol instance pointer.\r
- @param EfiToLegacy16BootTable Pointer to Legacy16 boot table.\r
-\r
- @retval EFI_SUCCESS SMM code loaded.\r
- @retval EFI_DEVICE_ERROR SMM code failed to load\r
-\r
-**/\r
-typedef\r
-EFI_STATUS\r
-(EFIAPI *EFI_LEGACY_BIOS_PLATFORM_SMM_INIT) (\r
- IN EFI_LEGACY_BIOS_PLATFORM_PROTOCOL *This,\r
- IN VOID *EfiToLegacy16BootTable\r
- )\r
-;\r
-\r
-/**\r
- Allows platform to perform any required action after a LegacyBios operation.\r
-\r
- @param This Protocol instance pointer.\r
- @param Mode Specifies what handle to return.\r
- @param Type Mode specific.\r
- @param DeviceHandle List of PCI devices in the system.\r
- @param ShadowAddress First free OpROM area, after other OpROMs have been dispatched.\r
- @param Compatibility16Table Pointer to Compatibility16Table.\r
- @param AdditionalData Mode specific Pointer to additional data returned ¨C mode specific.\r
-\r
- @retval EFI_SUCCESS RomImage is valid\r
- @retval EFI_UNSUPPORTED Mode is not supported on the platform.\r
-\r
-**/\r
-typedef\r
-EFI_STATUS\r
-(EFIAPI *EFI_LEGACY_BIOS_PLATFORM_HOOKS) (\r
- IN EFI_LEGACY_BIOS_PLATFORM_PROTOCOL *This,\r
- IN EFI_GET_PLATFORM_HOOK_MODE Mode,\r
- IN UINT16 Type,\r
- IN EFI_HANDLE DeviceHandle,\r
- IN OUT UINTN *ShadowAddress,\r
- IN EFI_COMPATIBILITY16_TABLE *Compatibility16Table,\r
- IN VOID **AdditionalData OPTIONAL\r
- )\r
-;\r
-\r
-/**\r
- Returns information associated with PCI IRQ routing.\r
-\r
- @param This Protocol instance pointer.\r
- @param RoutingTable Pointer to PCI IRQ Routing table.\r
- @param RoutingTableEntries Number of entries in table.\r
- @param LocalPirqTable $PIR table\r
- @param PirqTableSize $PIR table size\r
- @param LocalIrqPriorityTable List of interrupts in priority order to assign\r
- @param IrqPriorityTableEntries- Number of entries in priority table\r
-\r
- @retval EFI_SUCCESS Data was successfully returned.\r
-\r
-**/\r
-typedef\r
-EFI_STATUS\r
-(EFIAPI *EFI_LEGACY_BIOS_PLATFORM_GET_ROUTING_TABLE) (\r
- IN EFI_LEGACY_BIOS_PLATFORM_PROTOCOL *This,\r
- OUT VOID **RoutingTable,\r
- OUT UINTN *RoutingTableEntries,\r
- OUT VOID **LocalPirqTable, OPTIONAL\r
- OUT UINTN *PirqTableSize, OPTIONAL\r
- OUT VOID **LocalIrqPriorityTable, OPTIONAL\r
- OUT UINTN *IrqPriorityTableEntries OPTIONAL\r
- )\r
-;\r
-\r
-/**\r
- Translates the given PIRQ accounting for bridge\r
-\r
- @param This Protocol instance pointer.\r
- @param PciBus PCI bus number for this device.\r
- @param PciDevice PCI device number for this device.\r
- @param PciFunction PCI function number for this device.\r
- @param Pirq Input is PIRQ reported by device, output is true PIRQ.\r
- @param PciIrq The IRQ already assigned to the PIRQ or the IRQ to be\r
- assigned to the PIRQ.\r
-\r
- @retval EFI_SUCCESS The PIRQ was translated.\r
-\r
-**/\r
-typedef\r
-EFI_STATUS\r
-(EFIAPI *EFI_LEGACY_BIOS_PLATFORM_TRANSLATE_PIRQ) (\r
- IN EFI_LEGACY_BIOS_PLATFORM_PROTOCOL *This,\r
- IN UINTN PciBus,\r
- IN UINTN PciDevice,\r
- IN UINTN PciFunction,\r
- IN OUT UINT8 *Pirq,\r
- OUT UINT8 *PciIrq\r
- )\r
-;\r
-\r
-/**\r
- Attempt to legacy boot the BootOption. If the EFI contexted has been \r
- compromised this function will not return.\r
-\r
- @param This Protocol instance pointer.\r
- @param BbsDevicePath EFI Device Path from BootXXXX variable.\r
- @param BbsTable Internal BBS table.\r
- @param LoadOptionSize Size of LoadOption in size.\r
- @param LoadOption LoadOption from BootXXXX variable\r
- @param EfiToLegacy16BootTable Pointer to BootTable structure\r
-\r
- @retval EFI_SUCCESS Ready to boot.\r
-\r
-**/\r
-typedef\r
-EFI_STATUS\r
-(EFIAPI *EFI_LEGACY_BIOS_PLATFORM_PREPARE_TO_BOOT) (\r
- IN EFI_LEGACY_BIOS_PLATFORM_PROTOCOL *This,\r
- IN BBS_BBS_DEVICE_PATH *BbsDevicePath,\r
- IN VOID *BbsTable,\r
- IN UINT32 LoadOptionsSize,\r
- IN VOID *LoadOptions,\r
- IN VOID *EfiToLegacy16BootTable\r
- )\r
-;\r
-\r
-/**\r
- @par Protocol Description:\r
- Abstracts the platform portion of the traditional BIOS. \r
-\r
- @param GetPlatformInfo\r
- Gets binary data or other platform information.\r
-\r
- @param GetPlatformHandle\r
- Returns a buffer of all handles matching the requested subfunction. \r
-\r
- @param SmmInit\r
- Loads and initializes the traditional BIOS SMM handler.\r
-\r
- @param PlatformHooks\r
- Allows platform to perform any required actions after a LegacyBios operation.\r
-\r
- @param GetRoutingTable\r
- Gets $PIR table. \r
-\r
- @param TranslatePirq \r
- Translates the given PIRQ to the final value after traversing any PCI bridges. \r
-\r
- @param PrepareToBoot\r
- Final platform function before the system attempts to boot to a traditional OS. \r
-\r
-**/\r
-struct _EFI_LEGACY_BIOS_PLATFORM_PROTOCOL {\r
- EFI_LEGACY_BIOS_PLATFORM_GET_PLATFORM_INFO GetPlatformInfo;\r
- EFI_LEGACY_BIOS_PLATFORM_GET_PLATFORM_HANDLE GetPlatformHandle;\r
- EFI_LEGACY_BIOS_PLATFORM_SMM_INIT SmmInit;\r
- EFI_LEGACY_BIOS_PLATFORM_HOOKS PlatformHooks;\r
- EFI_LEGACY_BIOS_PLATFORM_GET_ROUTING_TABLE GetRoutingTable;\r
- EFI_LEGACY_BIOS_PLATFORM_TRANSLATE_PIRQ TranslatePirq;\r
- EFI_LEGACY_BIOS_PLATFORM_PREPARE_TO_BOOT PrepareToBoot;\r
-};\r
-\r
-extern EFI_GUID gEfiLegacyBiosPlatformProtocolGuid;\r
-\r
-#endif\r