Intel® Platform Innovation Framework for UEFI Compatibility Support Module Specification Revision 0.
THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY, NONINFRINGEMENT, FITNESS FOR ANY PARTICULAR PURPOSE, OR ANY WARRANTY OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. Except for a limited copyright license to copy this specification for internal use only, no license, express or implied, by estoppel or otherwise, to any intellectual property rights is granted herein.
Revision History Revision Revision History Date 0.9 • First public release. 9/16/03 0.91 • Added PciExpressBase parameter to EFI_COMPATIBILITY16_TABLE. 2/01/05 • Renamed GetOemInt15Data to GetOemIntData and expanded it to support any software INT. • Modified PrepareToBootEfi to return BBS table. BBS Table updated to return AssignedDriveNumber. • Added GetTpmBinary. • Combined several LegacyBiosPlatform APIs into three APIs. Updated BBS_TABLE and EFI_COMPATIBILITY16_TABLE.
Revision 0.97 Revision History • Date Added OpromDestinationSegment field to the 9/04/07 Added support for Shadow RAM region to be set as Read/Write and have option for permanent allocation of high memory (above 1MB). EFI_COMPATIBILITY16_TABLE had UmaAddress, UmaSize, HiPermanentMemoryAddress, and HiPermanentMemorySize added. 09/26/13 EFI_DISPATCH_OPROM_TABLE structure to indicate where the OpROM may have been relocated to. 0.
Table of Contents 1 Introduction .....................................................................................................1 1.1 1.2 1.3 2 Design Discussion .............................................................................................2 2.1 2.2 2.3 2.4 2.5 2.6 2.7 3 Overview ..............................................................................................1 Scope ...................................................................................................
3.3 vi EfiGetPlatformBinaryOem32Data ............................................................ 63 EfiGetPlatformBinaryTpmBinary.............................................................. 65 EfiGetPlatformBinarySystemRom ............................................................ 66 EfiGetPlatformPciExpressBase ................................................................ 67 EFI_LEGACY_BIOS_PLATFORM_PROTOCOL.GetPlatformHandle() ................. 68 EfiGetPlatformVgaHandle ........................
4 Example Code .............................................................................................. 152 4.1 4.2 5 Example of a Dummy EFI SMM Child Driver ............................................ 152 Example of a Dummy EFI Hardware SMM Child Driver ............................. 155 Legacy BIOS References ................................................................................ 158 5.1 5.2 5.3 5.4 5.5 5.6 BIOS INTs .....................................................................
Tables Table Table Table Table Table Table Table Table Table Table Table Table Table Table Table Table Table Table Table Table Table 1 Components of CSM ..............................................................................8 2 EfiCompatibility Protocols .......................................................................9 3 Functions in Legacy BIOS Protocol ......................................................... 10 4 Functions in the Legacy BIOS Platform Protocol ..............................
1 Introduction 1.1 Overview This specification describes the high-level design of the Compatibility Support Module (CSM) code that is required for an implementation of the Intel® Platform Innovation Framework for EFI (hereafter referred to as the "Framework"). The CSM provides compatibility support between the Framework and traditional, legacy BIOS code and allows booting a traditional OS or booting an EFI OS off a device that requires a traditional option ROM (OpROM).
2 Design Discussion 2.1 Definitions of Terms The following definitions, except where noted, are not EFI specific. See the master Framework glossary for definitions of other Framework terms; see “Typographic Conventions” later in this section for the URL. 16-bit legacy The traditional PC environment and includes traditional OpROMs and Compatibility16 code. Compatibility16 The traditional BIOS with POST and BIOS Setup removed. Executes in 16-bit real mode.
Design Discussion thunk The code to transition from native execution mode to 16-bit real mode and back. traditional OpROM 16-bit OpROMs that are executed in real mode. 2.2 CSM-Specific References The following reference is useful for implementing CSM code. See References in the master help system for additional related specifications. • 2.3 IBM Personal System/2 and Personal Computer BIOS Interface Technical Reference. Second edition. IBM Corporation, IBM No. S68X-2341-00, 1988.
Figure 1 Compatibility Overview Differences between Traditional BIOS and EFI An EFI system differs from the traditional BIOS POST in that only minimal system configuration takes place until the Boot Device Selection (BDS) phase (equivalent to traditional POST INT19). Video is not required until the BDS phase, nor are other OpROMs dispatched until the BDS phase. Likewise, BIOS Setup is entered from the BDS phase.
Design Discussion 2.3.2.3 Device OpROM Selection A BDS policy to initialize all devices might require the CSM code to be activated and invoked when a non-boot device has only a traditional OpROM associated with it. BDS Legacy Flow The figure below is a flowchart showing the decisions and operations that take place during BDS in a legacy environment.
Components of CSM The CSM code consists of the following six main components or functional areas: EFI Compatibility Support Module initialization code A set of modules to initialize the CSM data structures and the traditional Post Memory Manager (PMM). Dispatching traditional OpROMs: A set of EfiCompatibility drivers to simulate traditional INTs, and code to place traditional OpROMs within the traditional OpROM memory region and invoke the OpROMs.
Design Discussion Outside this additional functionality are the traditional OpROMs, regardless if they reside onboard or offboard.
Several pieces of code make up the CSM, as listed in the table below. Table 1 Components of CSM Component EfiCompatibility Description 32-bit code that interfaces with EFI EfiCompatibility is comprised of several EFI drivers. These drivers fall into the following four categories: • Drivers that are platform and hardware neutral. They provide the foundation of the CSM and do not change from platform to platform.
Design Discussion Table 2 EfiCompatibility Protocols Protocol Description Legacy BIOS Protocoll The primary protocol of the CSM. This protocol is platform and hardware neutral. Legacy BIOS Platform Protocol Provides the information that makes this platform unique compared to another platform using the same chipset. This protocol is platform specific. Legacy Region Protocol Manages the hardware that allows the region from physical address 0xC0000 to 0xFFFFF to be made read only or read-write.
EBDA, and CMOS. The data is also used by Legacy BIOS Protocol APIs to reprogram traditional devices to traditional resources. Compatibility16 does not configure low-level device hardware and instead leaves that operation to EFI. EFI does not assign IRQs to devices such as serial ports, but Compatibility16 requires them to be configured with the appropriate IRQs. The LegacyBios code must reconfigure any traditional devices that were configured by EFI into a valid Compatibility16 configuration.
Design Discussion PrepareToBootEfi() Allows an external agent to prepare for booting to an EFI-aware OS. It is a subset of actions taken by LegacyBoot(). It causes legacy drive numbers to be assigned. ShadowAllLegacyOproms() Allows an external agent to force the loading of legacy OpROMs. A side affect of this function is that all EFI drivers are disconnected and must be reconnected for proper EFI functioning.
2.4.2.3 GetPlatformInfo() Used to return binary objects or various pieces of data.. GetRoutingTable() Serves two purposes; it is used for PCI PIRQ routing and for $PIR table information. PlatformHooks() Any required hook after a CSM operation. PrepareToBoot() Allows any final processing to take place before booting a traditional OS. SmmInit() Finds any CompatibilitySmm modules that exist in EFI firmware volumes and registers them with the EFI SMM driver.
Design Discussion 2.4.2.4 Legacy 8259 Protocol The Legacy 8259 Protocol controls the programming of the 8259 PIC in both the EFI (32bit protected) environment and legacy (16-bit real-mode) environment. The table below lists the functions that are included in the Legacy 8259 Protocol. See EFI_LEGACY_8259_PROTOCOL in Code Definitions for the definitions of these functions. Table 6 Functions in Legacy 8259 Protocol Functions Description SetVectorBase() Sets the vector base for the 8259 PIC.
2.4.2.5 Legacy Interrupt Protocol The Legacy Interrupt Protocol manages the programming of PCI interrupts. The table below lists the functions that are included in the Legacy Interrupt Protocol. See EFI_LEGACY_INTERRUPT_PROTOCOL in Code Definitions for the definitions of these functions. Table 7 Functions in Legacy Interrupt Protocol Functions Description GetNumberPirqs() Returns the number of PIRQs that the chipset supports. GetLocation() Returns the PCI bus location of the chipset.
Design Discussion Compatibility16 Table There is a new table, EFI_COMPATIBILITY16_TABLE, introduced to the traditional legacy runtime BIOS for CSM support. This table is on a 16-byte boundary and has a signature of “$EFI” when read as a DWORD. The Compatibility16 code has a default table generated at build time. The most important fields are the Compatibility16CallSegment:Offset. EfiCompatibility uses this address to issue Compatability16 Functions.
Compatibility16InstallPciHandler() Allows the Compatibility16 code to install an IRQ handler for mass storage devices that do not have an OpROM associated with them. An example is Serial ATA (SATA). Compatibility16 Function Data Structures There are two major structures passed from EfiCompatibility to Compatibility16: • EFI_TO_COMPATIBILITY16_INIT_TABLE • EFI_TO_COMPATIBILITY16_BOOT_TABLE These tables describe the state of the machine at the time the function is issued.
Design Discussion EFI can use either of the following functions to accomplish the thunk: • EFI_LEGACY_BIOS_PROTOCOL.Int86() • EFI_LEGACY_BIOS_PROTOCOL.FarCall86() The 16-bit code returns to the EFI environment by performing an IRET or FAR RET. The reverse thunk is similar to a thunk but is used on the 16-bit to 32-bit to 16-bit transitions. There are no defined reverse thunks at this time. Its code is added for completeness.
2.5 Interactions between CSM and Legacy BIOS BDS and Legacy Drivers BDS must invoke the CSM by dispatching the Legacy BIOS Protocol if either of the following is true: 2.5.1.1 • A traditional OpROM is required. • A traditional boot option is found in the boot sequence Traditional OpROMs There are two cases where traditional OpROMs are required in an EFI environment, as follows: No EFI driver exists There are cases where a required device has no EFI driver but only a traditional OpROM.
Design Discussion Once it is determined that the EFI_LEGACY_BIOS_PROTOCOL.LegacyBoot() is used, then the EFI_LEGACY_BIOS_PLATFORM_PROTOCOL.PrepareToBoot() function is used to order the device boot sequence.
2.5.1.4 Traditional Installation The traditional BIOS driver is used to abstract the traditional BIOS for EFI. BDS installing the traditional code causes the Legacy BIOS Protocol initialization code to do the following actions: • Find the Legacy Region Protocol. • Find the Legacy Interrupt Protocol. • Find the Legacy BIOS Platform Protocol. • Find the Legacy 8259 Protocol. • Allocate the first 4 KB for interrupt vectors and BDA from traditional memory.
Design Discussion 2.5.2.1 Legacy BIOS Interface and Functions There is a table located within the traditional BIOS in either the 0xF000:xxxx or 0xE000:xxxx physical address range. The table is located on a 16-byte boundary and provides the physical address of the entry point for the Compatibility16 Functions. The Compatibility16 functions provide the platform-specific information that is required by the generic EfiCompatibility code.
2.5.2.6 Block I/O Emulation This driver is used when EFI needs to access a traditional floppy or hard disk. It translates EFI block I/O requests into the equivalent INT13 requests. 2.6 Assumptions External Assumptions The CSM code makes the following external assumptions: • When unloaded, EFI device drivers that have EFI OpROMs leave the hardware in a neutral state that allows an equivalent traditional OpROM to be invoked without any adverse device interaction.
Design Discussion • There are security problems in having multiple entities maintaining flash or NVRAM. • Compatibility16 code is chipset hardware neutral. • CompatibilitySmm code is not chipset hardware neutral. Having no updates has several ramifications to the Compatibility16 code, as follows: 2.6.2.
2.7 • Compatibility16 does not need to configure motherboard devices. The EFI PEI and DXE phases configure the devices during POST and the ACPI ASL configures devices at runtime. Plug and Play device nodes are not supported. This assumption implies that the ACPI device configuration selections include entries with and without IRQs. • Because the Compatibility16 contains traditional devices that use interrupts, it requires an interrupt vector table and interrupts located at the traditional locations.
Design Discussion 25
3 Code Definitions 3.1 Introduction This section contains definitions of the following protocols, functions, or data types. Table 10 EFICompatability Code and Compatabiloity16 code EfiCompatibility Code: EFI_LEGACY_BIOS_PROTOCOL Used to abstract the traditional BIOS for EFI. EFI_LEGACY_BIOS_PLATFORM_PROTOCOL Used to abstract the platform-specific traditional hardware and or policy decisions from the generic EfiCompatibility code.
Code Definitions EfiCompatibility Code 3.2 Legacy BIOS Protocol EFI_LEGACY_BIOS_PROTOCOL Summary Abstracts the traditional BIOS from the rest of EFI. The LegacyBoot() member function allows the BDS to support booting a traditional OS. EFI thunks drivers that make EFI bindings for BIOS INT services use all the other member functions.
Parameters Int86 Performs traditional software INT. See the Int86() function description. FarCall86 Performs a far call into Compatibility16 or traditional OpROM code. See the FarCall86() function description. CheckPciRom Checks if a traditional OpROM exists for this device. See the CheckPciRom() function description. InstallPciRom Loads a traditional OpROM in traditional OpROM address space. See the InstallPciRom() function description. LegacyBoot Boots a traditional OS.
Code Definitions EFI_LEGACY_BIOS_PROTOCOL.Int86() Summary Issues a traditional software INT. Prototype typedef BOOLEAN (EFIAPI *EFI_LEGACY_BIOS_INT86) ( IN EFI_LEGACY_BIOS_PROTOCOL IN UINT8 IN OUT *This, BiosInt, EFI_IA32_REGISTER_SET *Regs ) Parameters This Indicates the EFI_LEGACY_BIOS_PROTOCOL instance. BiosInt The software INT requested. Regs The IA-32 registers. Type EFI_IA32_REGISTER_SET is defined in “Related Definitions” below.
E Dword registers. Type EFI_DWORD_REGS is defined below. X Word registers. Type EFI_WORD_REGS is defined below. H Byte registers. Type EFI_BYTE_REGS is defined below.
Code Definitions //********************************************************* typedef struct { UINT32 CF:1; UINT32 Reserved1:1; UINT32 PF:1; UINT32 Reserved2:1; UINT32 AF:1; UINT32 Reserved3:1; UINT32 ZF:1; UINT32 SF:1; UINT32 TF:1; UINT32 IF:1; UINT32 DF:1; UINT32 OF:1; UINT32 IOPL:2; UINT32 NT:1; UINT32 Reserved4:2; UINT32 VM:1; UINT32 Reserved5:14; } EFI_EFLAGS_REG; //********************************************************* // EFI_WORD_REGS //********************************************************* t
UINT16 CX; UINT16 ReservedCX; UINT16 DX; UINT16 ReservedDX; UINT16 SI; UINT16 ReservedSI; UINT16 DI; UINT16 ReservedDI; EFI_FLAGS_REG Flags; UINT16 ReservedFlags; UINT16 ES; UINT16 CS; UINT16 SS; UINT16 DS; UINT16 FS; UINT16 GS; UINT16 BP; UINT16 ReservedBP; UINT16 SP; UINT16 ReservedSP; } EFI_WORD_REGS; //******************************************* // EFI_FLAGS_REG //******************************************* typedef struct { 32 UINT16 CF:1; UINT16 Reserved1:1
Code Definitions UINT16 Reserved2:1; UINT16 AF:1; UINT16 Reserved3:1; UINT16 ZF:1; UINT16 SF:1; UINT16 TF:1; UINT16 IF:1; UINT16 DF:1; UINT16 OF:1; UINT16 IOPL:2; UINT16 NT:1; UINT16 Reserved4:1; } EFI_FLAGS_REG; //********************************************************* // EFI_BYTE_REGS //********************************************************* typedef struct { UINT8 AL, AH; UINT16 ReservedAX; UINT8 BL, BH; UINT16 ReservedBX; UINT8 CL, CH; UINT16 ReservedCX; UINT8
Status Codes Returned FALSE INT completed. See TRUE INT was not completed. 34 Regs for status.
Code Definitions EFI_LEGACY_BIOS_PROTOCOL.FarCall86() Summary Performs a far call into Compatibility16 or traditional OpROM code. Prototype typedef BOOLEAN (EFIAPI *EFI_LEGACY_BIOS_FARCALL86) ( IN EFI_LEGACY_BIOS_PROTOCOL *This, IN UINT16 Segment, IN UINT16 Offset, IN EFI_IA32_REGISTER_SET *Regs, IN VOID *Stack, IN UINTN StackSize ) Parameters This Indicates the EFI_LEGACY_BIOS_PROTOCOL instance. Segment Segment of 16-bit mode call. Offset Offset of 16-bit mode call.
Status Codes Returned FALSE FarCall() completed. See Regs for status. TRUE FarCall() was not completed.
Code Definitions EFI_LEGACY_BIOS_PROTOCOL.CheckPciRom() Summary Tests to see if a traditional PCI ROM exists for this device.. Prototype typedef EFI_STATUS (EFIAPI *EFI_LEGACY_BIOS_CHECK_ROM) ( IN EFI_LEGACY_BIOS_PROTOCOL *This, IN EFI_HANDLE PciHandle OUT VOID **RomImage, OPTIONAL OUT UINTN *RomSize, OPTIONAL OUT UINTN *Flags ) Parameters This Indicates the EFI_LEGACY_BIOS_PROTOCOL instance. PciHandle The handle for this device.
EFI_LEGACY_BIOS_PROTOCOL.InstallPciRom() Summary Shadows an OpROM. Prototype typedef EFI_STATUS (EFIAPI *EFI_LEGACY_BIOS_INSTALL_ROM) ( IN EFI_LEGACY_BIOS_PROTOCOL *This, IN EFI_HANDLE PciHandle, IN VOID **RomImage, OUT UINTN *Flags OUT UINT8 *DiskStart, OPTIONAL OUT UINT8 *DiskEnd, OPTIONAL OUT VOID **RomShadowAddress, OPTIONAL OUT UINT32 *ShadowedRomSize OPTIONAL ) Parameters This Indicates the EFI_LEGACY_BIOS_PROTOCOL instance.
Code Definitions DiskEnd Disk number of the last device hooked by the ROM. RomShadowAddress Shadow address of PC-AT ROM. ShadowedRomSize Size in bytes of RomShadowAddress. Description This function loads a traditional PC-AT OpROM on the PciHandle device and returns information about how many disks were added by the OpROM and the shadow address and size. DiskStart and DiskEnd are INT13h drive letters. Thus 0x80 is C:.
EFI_LEGACY_BIOS_PROTOCOL.LegacyBoot() Summary Boots a traditional OS. Prototype typedef EFI_STATUS (EFIAPI *EFI_LEGACY_BIOS_BOOT) ( IN EFI_LEGACY_BIOS_PROTOCOL *This, IN BBS_BBS_DEVICE_PATH *BootOption, IN UINT32 LoadOptionsSize, IN VOID *LoadOptions ) Parameters This Indicates the EFI_LEGACY_BIOS_PROTOCOL instance. BootOption The EFI device path from BootXXXX variable. Type BBS_BBS_DEVICE_PATH is defined in "Related Definitions" below. LoadOptionSize Size of LoadOption.
Code Definitions • Reconfigure SIO devices from EFI mode (polled) into traditional mode (interrupt driven). • Shadow all PCI ROMs. • Set up BDA and EBDA standard areas before the legacy boot. • Construct the Compatibility16 boot memory map and pass it to the Compatibility16 code. • Invoke the Compatibility16 table function Compatibility16PrepareToBoot(). This invocation causes a thunk into the Compatibility16 code, which sets all appropriate internal data structures.
Status flags as defined by the BBS Specification. Type BBS_STATUS_FLAGS is defined in Compatibility16PrepareToBoot(). String ASCIIZ string that describes the boot device to a user. The length of this string n can be determined by subtracting 8 from the Header.Length entry. Status Codes Returned EFI_DEVICE_ERROR Failed to boot from any boot device and memory is uncorrupted. Note: This function normally never returns.
Code Definitions EFI_LEGACY_BIOS_PROTOCOL.UpdateKeyboardLedStatus() Summary Updates the BDA to reflect status of the Scroll Lock, Num Lock, and Caps Lock keys and LEDs. Prototype typedef EFI_STATUS (EFIAPI *EFI_LEGACY_BIOS_UPDATE_KEYBOARD_LED_STATUS) ( IN EFI_LEGACY_BIOS_PROTOCOL *This, IN UINT8 Leds ) Parameters This Indicates the EFI_LEGACY_BIOS_PROTOCOL instance.
EFI_LEGACY_BIOS_PROTOCOL.GetBbsInfo() Summary Presents BBS information to external agents. Prototype typedef EFI_STATUS (EFIAPI *EFI_LEGACY_BIOS_GET_BBS_INFO) ( IN EFI_LEGACY_BIOS_PROTOCOL *This, OUT UINT16 *HddCount, OUT HDD_INFO **HddInfo, OUT UINT16 *BbsCount, IN OUT BBS_TABLE **BbsTable ) Parameters This Indicates the EFI_LEGACY_BIOS_PROTOCOL instance. HddCount Number of HDD_INFO structures. Type HDD_INFO is defined in “Related Definitions” in Compatibility16PrepareToBoot().
Code Definitions EFI_LEGACY_BIOS_PROTOCOL.ShadowAllLegacyOproms() Summary Allows external agents to force loading of all legacy OpROMs. This function can be invoked before GetBbsInfo() to ensure all devices are counted. Prototype typedef EFI_STATUS (EFIAPI *EFI_LEGACY_BIOS_SHADOW_ALL_LEGACY_OPROMS) ( IN EFI_LEGACY_BIOS_PROTOCOL *This ) Parameters This Indicates the EFI_LEGACY_BIOS_PROTOCOL instance.
EFI_LEGACY_BIOS_PROTOCOL.PrepareToBootEfi() Summary This function is called when booting an EFI-aware OS with legacy hard disks. The legacy hard disks may or may not be the boot device but will be accessed by the EFI-aware OS. Prototype typedef EFI_STATUS (EFIAPI *EFI_LEGACY_BIOS_PREPARE_TO_BOOT) ( IN EFI_LEGACY_BIOS_PROTOCOL *This OUT UINT16 *BbsCount, OUT BBS_TABLE **BbsTable ) Parameters This Indicates the EFI_LEGACY_BIOS_PROTOCOL instance. BbsCount Number of BBS_TABLE structures.
Code Definitions EFI_LEGACY_BIOS_PROTOCOL.GetLegacyRegion() Summary This function is called when EFI needs to reserve an area in the 0xE0000 or 0xF0000 64 KB blocks. Prototype typedef EFI_STATUS (EFIAPI *EFI_LEGACY_BIOS_GET_LEGACY_REGION) ( IN EFI_LEGACY_BIOS_PROTOCOL *This, IN UINTN LegacyMemorySize, IN UINTN Region, IN UINTN Alignment, OUT VOID **LegacyMemoryAddress ) Parameters This Indicates the EFI_LEGACY_BIOS_PROTOCOL instance. LegacyMemorySize Requested size in bytes of the region.
Status Codes Returned EFI_SUCCESS The requested region was assigned. EFI_ACCESS_DENIED The function was previously invoked. Other The requested region was not assigned.
Code Definitions EFI_LEGACY_BIOS_PROTOCOL.CopyLegacyRegion() Summary This function is called when copying data to the region assigned by EFI_LEGACY_BIOS_PROTOCOL.GetLegacyRegion(). Prototype typedef EFI_STATUS (EFIAPI *EFI_LEGACY_BIOS_COPY_LEGACY_REGION) ( IN EFI_LEGACY_BIOS_PROTOCOL *This, IN UINTN LegacyMemorySize, IN VOID *LegacyMemoryAddress, IN VOID *LegacyMemorySourceAddress ) Parameters This Indicates the EFI_LEGACY_BIOS_PROTOCOL instance.
EFI_LEGACY_BIOS_PROTOCOL.BootUnconventionalDevice() Summary This function is called when either booting to an unconventional device such as a PARTIES partition and/or executing hard disk diagnostics. Prototype typedef EFI_STATUS (EFIAPI *EFI_LEGACY_BIOS_BOOT_UNCONVENTIONAL_DEVICE) ( IN EFI_LEGACY_BIOS_PROTOCOL *This, IN UDC_ATTRIBUTES Attributes, IN UINTN BbsEntry, IN VOID *BeerData, IN VOID *ServiceAreaData ) Parameters This Indicates the EFI_LEGACY_BIOS_PROTOCOL instance.
Code Definitions Description This function is called when booting from an unconventional device such as a PARTIES partition and/or executing hard disk diagnostics. All other BbsTable entries are set to ignore and, depending upon Attributes, one or two entries are created. If executing hard disk diagnostics, a BbsEntry is created and given the highest priority. If booting from an unconventional device, a BbsEntry is created and given the highest priority after the diagnostic entry.
Legacy BIOS Platform Protocol EFI_LEGACY_BIOS_PLATFORM_PROTOCOL The architecture assumes that the creator of this protocol is also the creator of the Compatibility16 code. Having a single creator ensures that IBV-specific code is coherent. Summary Abstracts the platform portion of the traditional BIOS. The Legacy BIOS Platform Protocol will match the IBV’s traditional BIOS code.
Code Definitions SmmInit Loads and initializes the traditional BIOS SMM handler. See the SmmInit() function description. PlatformHooks Allows platform to perform any required actions after a LegacyBios operation.. GetRoutingTable Gets $PIR table. See the GetRoutingTable() function description. TranslatePirq Translates the given PIRQ to the final value after traversing any PCI bridges. See the TranslatePirq() function description.
EFI_LEGACY_BIOS_PLATFORM_PROTOCOL.GetPlatformInfo() Summary Finds the binary data or other platform information. Refer to the sub-functions for additional information.
Code Definitions TableSize Size of data. Location Location to place table. 0x00 – Either 0xE0000 or 0xF0000 64 KB blocks. Bit 0 = 1 0xF0000 64 KB block. Bit 1 = 1 0xE0000 64 KB block. Multiple bits can be set. Alignment Bit-mapped address alignment granularity. The first nonzero bit from the right is the address granularity. LegacySegment Segment where EfiCompatibility code will place the table or data. LegacyOffset Offset where EfiCompatibility code will place the table or data.
Status Codes Returned EFI_SUCCESS The data was returned successfully. EFI_UNSUPPORTED Mode is not supported on this platform. EFI_NOT_FOUND Binary image not found.
Code Definitions 3.2.2.1 Mode Values for GetPlatformInfo() EfiGetPlatformBinaryMpTable Summary Returns the multiprocessor (MP) table information Parameters This Indicates the EFI_LEGACY_BIOS_PLATFORM_PROTOCOL instance. Mode EfiGetPlatformBinaryMpTable Table Pointer to the MP table. TableSize Size in bytes of the MP table. Location Location to place table. 0x00 – Either 0xE0000 or 0xF0000 64 KB blocks. Bit 0 = 1 0xF0000 64 KB block. Bit 1 = 1 0xE0000 64 KB block. Multiple bits can be set.
Status Codes Returned EFI_SUCCESS The MP table was returned. EFI_UNSUPPORTED The MP table is not supported on this platform.
Code Definitions EfiGetPlatformBinaryOemIntData Summary Returns any OEM-specific code and/or data. Parameters This Indicates the EFI_LEGACY_BIOS_PLATFORM_PROTOCOL instance. Mode EfiGetPlatformBinaryOemIntData Table Pointer to OEM legacy 16-bit code or data. TableSize Size of data. Location Location to place table. 0x00 – Either 0xE0000 or 0xF0000 64 KB blocks. Bit 0 = 1 0xF0000 64 KB block. Bit 1 = 1 0xE0000 64 KB block. Multiple bits can be set. Alignment Bit-mapped address alignment granularity.
Status Codes Returned EFI_SUCCESS The data was returned successfully. EFI_UNSUPPORTED Oem INT is not supported on this platform. Returns any OEM INT-specific code and/or data.
Code Definitions EfiGetPlatformBinaryOem16Data Summary Returns any 16-bit OEM-specific code and/or data. Parameters This Indicates the EFI_LEGACY_BIOS_PLATFORM_PROTOCOL instance. Mode EfiGetPlatformBinaryOem16Data Table Pointer to OEM legacy 16-bit code or data. TableSize Size of data. Location Location to place the table. 0x00 – Either 0xE0000 or 0xF0000 64 KB blocks. Bit 0 = 1 0xF0000 64 KB block. Bit 1 = 1 0xE0000 64 KB block. Multiple bits can be set.
table. The caller, not EfiGetPlatformBinaryOem16Data, copies the modified table to the allocated region in 0xF0000 or 0xE0000 block after the second invocation.. Status Codes Returned EFI_SUCCESS The data was returned successfully. EFI_UNSUPPORTED Oem16 is not supported on this platform.
Code Definitions EfiGetPlatformBinaryOem32Data Summary Returns any 32-bit OEM-specific code and/or data. Parameters This Indicates the EFI_LEGACY_BIOS_PLATFORM_PROTOCOL instance. Mode EfiGetPlatformBinaryOem32Data Table Pointer to OEM legacy 32-bit code or data. TableSize Size of data. Location Location to place the table. 0x00 – Either 0xE0000 or 0xF0000 64 KB blocks. Bit 0 = 1 0xF0000 64 KB block. Bit 1 = 1 0xE0000 64 KB block. Multiple bits can be set.
The second invocation has LegacySegment and LegacyOffset set to the location in the 0xF0000 or 0xE0000 block to which the table is to be copied. The second invocation allows any table address fix-ups to occur in the EFI memory copy of the table. The caller, not EfiGetPlatformBinaryOem32Data, copies the modified table to the allocated region in 0xF0000 or 0xE0000 block after the second invocation.. There are two generic mechanisms by which this mode can be used.
Code Definitions EfiGetPlatformBinaryTpmBinary Summary Gets the TPM (Trusted Platform Module) binary image associated with the onboard TPM device. Parameters This Indicates the EFI_LEGACY_BIOS_PLATFORM_PROTOCOL instance. Mode EfiGetPlatformBinaryTpmBinary Table TPM binary image for the onboard TPM device. TableSize Size of BinaryImage in bytes Location Location to place the table. 0x00 – Either 0xE0000 or 0xF0000 64 KB blocks. Bit 0 = 1 0xF0000 64 KB block. Bit 1 = 1 0xE0000 64 KB block.
EfiGetPlatformBinarySystemRom Summary Finds the Compatibility16 “ROM". Parameters This Indicates the EFI_LEGACY_BIOS_PLATFORM_PROTOCOL instance. Mode EfiGetPlatformBinarySystemRom Table System ROM image for the platform TableSize Size of Table in bytes Location Ignored Alignment Ignored LegacySegment Ignored LegacyOffset Ignored Description The mode finds the Compatibility16 “ROM” image. Status Codes Returned EFI_SUCCESS ROM image found. EFI_NOT_FOUND ROM not found.
Code Definitions EfiGetPlatformPciExpressBase Summary Gets the PciExpress base address Parameters This Indicates the EFI_LEGACY_BIOS_PLATFORM_PROTOCOL instance. Mode EfiGetPlatformPciExpressBase Table Ignored TableSize Ignored Location Base address of PciExpress memory mapped configuration address space.
EFI_LEGACY_BIOS_PLATFORM_PROTOCOL.GetPlatformHandle() Summary Returns a buffer of handles for the requested sub-function. Prototype typedef EFI_STATUS (EFIAPI *EFI_LEGACY_BIOS_PLATFORM_GET_PLATFORM_HANDLE) ( IN EFI_LEGACY_BIOS_PLATFORM_PROTOCOL *This, IN EFI_GET_PLATFORM_HANDLE_MODE Mode, IN UINT16 Type, OUT EFI_HANDLE **HandleBuffer, OUT UINTN *HandleCount, OUT VOID OPTIONAL **AdditionalData ) Parameters This Indicates the EFI_LEGACY_BIOS_PLATFORM_PROTOCOL instance.
Code Definitions AdditionalData Pointer to additional data returned – mode specific. Related Definitions //********************************************* // EFI_GET_PLATFORM_HANDLE_MODE //********************************************* typedef enum { EfiGetPlatformVgaHandle = 0, EfiGetPlatformIdeHandle = 1, EfiGetPlatformIsaBusHandle = 2, EfiGetPlatformUsbHandle = 3 } EFI_GET_PLATFORM_HANDLE_MODE; Description This function returns handles for the specific sub-function specified by Mode.
3.2.2.2 Mode Values for GetPlatformHandle() EfiGetPlatformVgaHandle Summary Returns the handle for the VGA device that should be used during a Compatibility16 boot. Parameters This Indicates the EFI_LEGACY_BIOS_PLATFORM_PROTOCOL instance. Mode EfiGetPlatformVgaHandle Type 0x00 HandleBuffer Buffer of all VGA handles found. HandleCount Number of VGA handles found.
Code Definitions EfiGetPlatformIdeHandle Summary Returns the handle for the IDE controller that should be used during a Compatibility16 boot. Parameters This Indicates the EFI_LEGACY_BIOS_PLATFORM_PROTOCOL instance. Mode EfiGetPlatformIdeHandle Type 0x00 HandleBuffer Buffer of all IDE handles found. HandleCount Number of IDE handles found. AdditionalData Pointer to HddInfo Information about all onboard IDE controllers.
EfiGetPlatformIsaBusHandle Summary Returns the handle for the ISA bus controller that should be used during a Compatibility16 boot. Parameters This Indicates the EFI_LEGACY_BIOS_PLATFORM_PROTOCOL instance. Mode EfiGetPlatformIsaBusHandle Type 0x00 HandleBuffer Buffer of all ISA bus handles found. HandleCount Number of ISA bus handles found.
Code Definitions EfiGetPlatformUsbHandle Summary Returns the handle for the USB device that should be used during a Compatibility16 boot. Parameters This Indicates the EFI_LEGACY_BIOS_PLATFORM_PROTOCOL instance. Mode EfiGetPlatformIsaBusHandle Type 0x00 HandleBuffer Buffer of all USB handles found. HandleCount Number of USB bus handles found. AdditionalData NULL Description This mode returns the Compatibility16 policy for the device that should be the USB device used during a Compatibility16 boot.
EFI_LEGACY_BIOS_PLATFORM_PROTOCOL.SmmInit() Summary Loads and registers the Compatibility16 handler with the EFI SMM code. Prototype typedef EFI_STATUS (EFIAPI *EFI_LEGACY_BIOS_PLATFORM_SMM_INIT) ( IN EFI_LEGACY_BIOS_PLATFORM_PROTOCOL IN VOID ootTable *This, *EfiToCompatibility16B ); Parameters This Indicates the EFI_LEGACY_BIOS_PLATFORM_PROTOCOL instance. EfiToCompatibility16BootTable The boot table passed to the Compatibility16.
Code Definitions EFI_LEGACY_BIOS_PLATFORM_PROTOCOL.PlatformHooks() Summary Allows platform to perform any required action after a LegacyBios operation.
Compatibility16Table Pointer to the Compatibility16 Table. AdditionalData Pointer to additional data returned – mode specific..
Code Definitions 3.2.2.3 Mode Values for PlatformHooks() EfiPrepareToScanRom Summary Allows any preprocessing before scanning OpROMs. Parameters This Indicates the EFI_LEGACY_BIOS_PLATFORM_PROTOCOL instance. Mode EfiPlatformHookPrepareToScanRom Type 0 DeviceHandle Handle of device OpROM is associated with. Type EFI_HANDLE is defined in InstallProtocolInterface() in the EFI 1.10 Specification. ShadowAddress Address where OpROM is shadowed.
EfiShadowServiceRoms Summary Shadows legacy OpROMS that may not have a physical device associated with them. Examples are PXE base code and BIS. Parameters This Indicates the EFI_LEGACY_BIOS_PLATFORM_PROTOCOL instance. Mode EfiPlatformHookShadowServiceRoms Type 0 DeviceHandle 0 ShadowAddress First free OpROM area, after other OpROMs have been dispatched.. Compatibility16Table Pointer to the Compatability16 Table.
Code Definitions EfiAfterRomInit Summary Allows platform to perform any required operation after an OpROM has completed its initialization.. Parameters This Indicates the EFI_LEGACY_BIOS_PLATFORM_PROTOCOL instance. Mode EfiPlatformHookAfterRomInit Type 0 DeviceHandle Handle of device OpROM is associated with. Type EFI_HANDLE is defined in InstallProtocolInterface() in the EFI 1.10 Specification. ShadowAddress Address where OpROM is shadowed.
EFI_LEGACY_BIOS_PLATFORM_PROTOCOL.GetRoutingTable() Summary Returns information associated with PCI IRQ routing.
Code Definitions EFI_LEGACY_IRQ_PRIORITY_TABLE_ENTRY and is used to prioritize the allocation of IRQs to PCI. Type EFI_LEGACY_IRQ_PRIORITY_TABLE_ENTRY is defined in "Related Definitions" below. IrqPriorityTableEntries Number of entries in the priority table.
//********************************************* // EFI_LEGACY_PIRQ_ENTRY //********************************************* typedef struct { UINT8 Pirq; UINT16 IrqMask; } EFI_LEGACY_PIRQ_ENTRY; Pirq If nonzero, a value assigned by the IBV. IrqMask If nonzero, the IRQs that can be assigned to this device.
Code Definitions Signature “$PIR”. MinorVersion 0x00. MajorVersion 0x01 for table version 1.0. TableSize 0x20 + RoutingTableEntries * 0x10. Bus PCI interrupt router bus. DevFunc PCI interrupt router device/function. PciOnlyIrq If nonzero, bit map of IRQs reserved for PCI. CompatibleVid Vendor ID of a compatible PCI interrupt router. CompatibleDid Device ID of a compatible PCI interrupt router. Minport If nonzero, a value passed directly to the IRQ miniport’s Initialize function.
Irq IRQ for this entry. Used Status of this IRQ. PCI_UNUSED 0x00 – This IRQ has not been assigned to PCI. PCI_USED 0xFF – This IRQ has been assigned to PCI. LEGACY_USED 0xFE – This IRQ has been used by an SIO legacy device and cannot be used by PCI. Status Codes Returned EFI_SUCCESS 84 Data was returned successfully.
Code Definitions EFI_LEGACY_BIOS_PLATFORM_PROTOCOL.TranslatePirq() Summary Translates the given PIRQ accounting for bridges. Prototype typedef EFI_STATUS (EFIAPI *EFI_LEGACY_BIOS_PLATFORM_TRANSLATE_PIRQ) ( IN EFI_LEGACY_BIOS_PLATFORM_PROTOCOL *This, IN UINTN PciBus, IN UINTN PciDevice, IN UINTN PciFunction, IN OUT UINT8 *Pirq, OUT UINT8 *PciIrq ) Parameters This Indicates the EFI_LEGACY_BIOS_PLATFORM_PROTOCOL instance. PciBus PCI bus number for this device.
EFI_LEGACY_BIOS_PLATFORM_PROTOCOL.PrepareToBoot() Summary Attempts to boot a traditional OS. Prototype typedef EFI_STATUS (EFIAPI *EFI_LEGACY_BIOS_PLATFORM_PREPARE_TO_BOOT) ( IN EFI_LEGACY_BIOS_PLATFORM_PROTOCOL *This, IN BBS_BBS_DEVICE_PATH *BbsDevicePath, IN VOID *BbsTable, IN UINT32 LoadOptionsSize, IN VOID *LoadOptions, IN VOID *EfiToLegacyBootTable ) Parameters This Indicates the EFI_LEGACY_BIOS_PLATFORM_PROTOCOL instance. BbsDevicePath EFI Device Path from BootXXXX variable.
Code Definitions Description This function assigns priorities to BBS table entries. Status Codes Returned EFI_SUCCESS Ready to boot.
Legacy Region Protocol EFI_LEGACY_REGION_PROTOCOL Summary Abstracts the hardware control of the physical address region 0xC0000–0xFFFFF for the traditional BIOS.
Code Definitions EFI_LEGACY_REGION_PROTOCOL.Decode() Summary Sets hardware to decode or not decode a region. Prototype typedef EFI_STATUS (EFIAPI *EFI_LEGACY_REGION_DECODE) ( IN EFI_LEGACY_REGION_PROTOCOL *This, IN UINT32 Start, IN UINT32 Length, IN BOOLEAN *On ); Parameters This Indicates the EFI_LEGACY_REGION_PROTOCOL instance Start Start of region to decode. Length Size in bytes of the region. On Decode/nondecode flag.
EFI_LEGACY_REGION_PROTOCOL.Lock() Summary Sets a region to read only. Prototype typedef EFI_STATUS (EFIAPI *EFI_LEGACY_REGION_LOCK) ( IN EFI_LEGACY_REGION_PROTOCOL *This, IN UINT32 Start, IN UINT32 Length, OUT UINT32 *Granularity OPTIONAL ); Parameters This Indicates the EFI_LEGACY_REGION_PROTOCOL instance Start Start of the region to lock. Length Length of the region. Granularity Lock attribute affects this granularity in bytes.
Code Definitions EFI_LEGACY_REGION_PROTOCOL.BootLock() Summary Sets a region to read only and ensures that flash is locked from being inadvertently modified. Prototype typedef EFI_STATUS (EFIAPI *EFI_LEGACY_REGION_BOOT_LOCK) ( IN EFI_LEGACY_REGION_PROTOCOL *This, IN UINT32 Start, IN UINT32 Length, OUT UINT32 *Granularity OPTIONAL ); Parameters This Indicates the EFI_LEGACY_REGION_PROTOCOL instance Start Start of the region to lock.
EFI_LEGACY_REGION_PROTOCOL.UnLock() Summary Sets a region to read-write. Prototype typedef EFI_STATUS (EFIAPI *EFI_LEGACY_REGION_UNLOCK) ( IN EFI_LEGACY_REGION_PROTOCOL *This, IN UINT32 Start, IN UINT32 Length, OUT UINT32 *Granularity OPTIONAL ); Parameters This Indicates the EFI_LEGACY_REGION_PROTOCOL instance Start Start of the region to lock. Length Length of the region Granularity Lock attribute affects this granularity in bytes.
Code Definitions Legacy 8259 Protocol EFI_LEGACY_8259_PROTOCOL Summary Abstracts the 8259 and APIC hardware control between EFI usage and Compatibility16 usage.
Sets the IRQ and edge\level masks for 16-bit real mode and 32-bit protected mode. See the Setmask() function description. SetMode Sets PIC mode to 16-bit real mode or 32-bit protected mode. See the SetMode() function description. GetVector Gets the base vector assigned to an IRQ. See the GetVector() function description. EnableIrq Enables an IRQ. See the EnableIrq() function description. DisableIrq Disables an IRQ. See the DisableIrq() function description.
Code Definitions EFI_LEGACY_8259_PROTOCOL.SetVectorBase() Summary Sets the base address for the 8259 master and slave PICs. Prototype typedef EFI_STATUS (EFIAPI *EFI_LEGACY_8259_SET_VECTOR_BASE) ( IN EFI_LEGACY_8259_PROTOCOL *This, IN UINT8 MasterBase, IN UINT8 SlaveBase ) Parameters This Indicates the EFI_LEGACY_8259_PROTOCOL instance. MasterBase Interrupt vectors for IRQ0–IRQ7. SlaveBase Interrupt vectors for IRQ8–IRQ15.
EFI_LEGACY_8259_PROTOCOL.GetMask() Summary Gets the current 16-bit real mode and 32-bit protected-mode IRQ masks. Prototype typedef EFI_STATUS (EFIAPI *EFI_LEGACY_8259_GET_MASK) ( IN EFI_LEGACY_8259_PROTOCOL *This, OUT UINT16 *LegacyMask, OPTIONAL OUT UINT16 *LegacyEdgeLevel, OPTIONAL OUT UINT16 *ProtectedMask, OPTIONAL OUT UINT16 *ProtectedEdgeLevel OPTIONAL ) Parameters This Indicates the EFI_LEGACY_8259_PROTOCOL instance. LegacyMask 16-bit mode interrupt mask for IRQ0–IRQ15.
Code Definitions EFI_LEGACY_8259_PROTOCOL.SetMask() Summary Sets the current 16-bit real mode and 32-bit protected-mode IRQ masks. Prototype typedef EFI_STATUS (EFIAPI *EFI_LEGACY_8259_SET_MASK) ( IN EFI_LEGACY_8259_PROTOCOL *This, INT UINT16 *LegacyMask, OPTIONAL IN UINT16 *LegacyEdgeLevel, OPTIONAL IN UINT16 *ProtectedMask, OPTIONAL IN UINT16 *ProtectedEdgeLevel OPTIONAL ) Parameters This Indicates the EFI_LEGACY_8259_PROTOCOL instance. LegacyMask 16-bit mode interrupt mask for IRQ0–IRQ15.
EFI_LEGACY_8259_PROTOCOL.SetMode() Summary Sets the mode of the PICs. Prototype typedef EFI_STATUS (EFIAPI *EFI_LEGACY_8259_SET_MODE) ( IN EFI_LEGACY_8259_PROTOCOL *This, IN EFI_8259_MODE Mode, IN UINT16 *Mask, OPTIONAL IN UINT16 *EdgeLevel OPTIONAL ) Parameters This Indicates the EFI_LEGACY_8259_PROTOCOL instance. Mode 16-bit real or 32-bit protected mode. Type EFI_8259_MODE is defined in "Related Definitions" below. Mask The value with which to set the interrupt mask.
Code Definitions Efi8259ProtectedMode, Efi8259MaxMode } EFI_8259_MODE; Status Codes Returned EFI_SUCCESS The mode was set successfully. EFI_INVALID_PARAMETER The mode was not set.
EFI_LEGACY_8259_PROTOCOL.GetVector() Summary Translates the IRQ into a vector. Prototype typedef EFI_STATUS (EFIAPI *EFI_LEGACY_8259_GET_VECTOR) ( IN EFI_LEGACY_8259_PROTOCOL *This, IN EFI_8259_IRQ Irq OUT UINT8 *Vector ) Parameters This Indicates the EFI_LEGACY_8259_PROTOCOL instance. Irq IRQ0–IRQ15. Type EFI_8259_IRQ is defined in "Related Definitions" below. Vector The vector that is assigned to the IRQ. Description This function retrieves the vector that is assigned to the IRQ.
Code Definitions Efi8259Irq6, Efi8259Irq7, Efi8259Irq8, Efi8259Irq9, Efi8259Irq10, Efi8259Irq11, Efi8259Irq12, Efi8259Irq13, Efi8259Irq14, Efi8259Irq15, Efi8259IrqMax } EFI_8259_IRQ; Status Codes Returned EFI_SUCCESS The EFI_INVALID_PARAMETER Irq Vector that matches Irq was returned. is not valid.
EFI_LEGACY_8259_PROTOCOL.EnableIrq() Summary Enables the specified IRQ. Prototype typedef EFI_STATUS (EFIAPI *EFI_LEGACY_8259_ENABLE_IRQ) ( IN EFI_LEGACY_8259_PROTOCOL *This, IN EFI_8259_IRQ Irq, IN BOOLEAN LevelTriggered ) Parameters This Indicates the EFI_LEGACY_8259_PROTOCOL instance. Irq 8259 IRQ0–IRQ15. Type EFI_8259_IRQ is defined in EFI_LEGACY_8259_PROTOCOL.GetVector(). LevelTriggered 0 = Edge triggered; 1 = Level triggered.
Code Definitions EFI_LEGACY_8259_PROTOCOL.DisableIrq() Summary Disables the specified IRQ. Prototype typedef EFI_STATUS (EFIAPI *EFI_LEGACY_8259_DISABLE_IRQ) ( IN EFI_LEGACY_8259_PROTOCOL *This, IN EFI_8259_IRQ Irq ) Parameters This Indicates the EFI_LEGACY_8259_PROTOCOL instance. Irq 8259 IRQ0–IRQ15. Type EFI_8259_IRQ is defined in EFI_LEGACY_8259_PROTOCOL.GetVector(). Description This function disables the specified environment’s 8259 PIC.
EFI_LEGACY_8259_PROTOCOL.GetInterruptLine() Summary Reads the PCI configuration space to get the interrupt number that is assigned to the card. Prototype typedef EFI_STATUS (EFIAPI *EFI_LEGACY_8259_GET_INTERRUPT_LINE) ( IN EFI_LEGACY_8259_PROTOCOL *This, IN EFI_HANDLE PciHandle, OUT UINT8 *Vector ) Parameters This Indicates the EFI_LEGACY_8259_PROTOCOL instance. PciHandle PCI function for which to return the vector. Type EFI_HANDLE is defined in InstallProtocolInterface() in the EFI 1.
Code Definitions EFI_LEGACY_8259_PROTOCOL.EndOfInterrupt() Summary Issues the End of Interrupt (EOI) commands to PICs. Prototype typedef EFI_STATUS (EFIAPI *EFI_LEGACY_8259_END_OF_INTERRUPT) ( IN EFI_LEGACY_8259_PROTOCOL *This, IN EFI_8259_IRQ Irq ) Parameters This Indicates the EFI_LEGACY_8259_PROTOCOL instance. Irq The interrupt for which to issue the EOI command. Type EFI_8259_IRQ is defined in EFI_LEGACY_8259_PROTOCOL.GetVector().
Legacy Interrupt Protocol EFI_LEGACY_INTERRUPT_PROTOCOL Summary Abstracts the PIRQ programming from the generic EFI Compatibility Support Modules (CSMs).
Code Definitions EFI_LEGACY_INTERRUPT_PROTOCOL.GetNumberPirqs() Summary Gets the number of PIRQs that this hardware supports. Prototype typedef EFI_STATUS (EFIAPI *EFI_LEGACY_INTERRUPT_GET_NUMBER_PIRQS) ( IN EFI_LEGACY_INTERRUPT_PROTOCOL OUT UINT8 *This, *NumberPirqs ) Parameters This Indicates the EFI_LEGACY_INTERRUPT_PROTOCOL instance. NumberPirqs Number of PIRQs that are supported. Description This function gets the number of PIRQs that are supported by the hardware.
EFI_LEGACY_INTERRUPT_PROTOCOL.GetLocation() Summary Gets the PCI location associated with this protocol. Prototype typedef EFI_STATUS (EFIAPI *EFI_LEGACY_INTERRUPT_GET_LOCATION) ( IN EFI_LEGACY_INTERRUPT_PROTOCOL *This, OUT UINT8 *Bus, OUT UINT8 *Device, OUT UINT8 *Function ) Parameters This Indicates the EFI_LEGACY_INTERRUPT_PROTOCOL instance. Bus PCI bus number of this device. Device PCI device number of this device. Function PCI function number of this device.
Code Definitions EFI_LEGACY_INTERRUPT_PROTOCOL.ReadPirq() Summary Reads the given PIRQ register and returns the IRQ that is assigned to it. Prototype typedef EFI_STATUS (EFIAPI *EFI_LEGACY_INTERRUPT_READ_PIRQ) ( IN EFI_LEGACY_INTERRUPT_PROTOCOL *This, IN UINT8 PirqNumber, OUT UINT8 *PirqData ) Parameters This Indicates the EFI_LEGACY_INTERRUPT_PROTOCOL instance. PirqNumber PIRQ A = 0, PIRQ B = 1, and so on.
EFI_LEGACY_INTERRUPT_PROTOCOL.WritePirq() Summary Writes data to the specified PIRQ register. Prototype typedef EFI_STATUS (EFIAPI *EFI_LEGACY_INTERRUPT_WRITE_PIRQ) ( IN EFI_LEGACY_INTERRUPT_PROTOCOL *This, IN UINT8 PirqNumber, IN UINT8 PirqData ) Parameters This Indicates the EFI_LEGACY_INTERRUPT_PROTOCOL instance. PirqNumber PIRQ A = 0, PIRQB = 1, and so on. PirqData IRQ assigned to this PIRQ Description This function writes the indicated PIRQ register with the requested data.
Code Definitions 3.3 Compatibility16 Code Compatibility16 Code The runtime Compatibility16 code (traditional 16-bit runtime code) is loaded as a binary file during the installation of EFI_LEGACY_BIOS_PROTOCOL. EFI_LEGACY_BIOS_PLATFORM_PROTOCOL.GetSystemRom() is invoked, which finds the appropriate binary file. The GUID referring to this binary is IBV specific and may be specific for an OEM supported by the IBV. GUID IBV or OEM specific Legacy BIOS Interface 3.3.2.
UINT16 PnPInstallationCheckOffset; UINT32 EfiSystemTable; UINT32 OemIdStringPointer; UINT32 AcpiRsdPtrPointer; UINT16 OemRevision; UINT32 E820Pointer; UINT32 E820Length; UINT32 IrqRoutingTablePointer; UINT32 IrqRoutingTableLength; UINT32 MpTablePtr; UINT32 MpTableLength; UINT16 OemIntSegment; UINT16 OemIntOffset; UINT16 Oem32Segment; UINT16 Oem32Offset; UINT16 Oem16Segment; UINT16 Oem16Offset; UINT16 TpmSegment; UINT16 TpmOffset; UINT32 IbvPointer; UINT32 PciExpressB
Code Definitions TableChecksum The value required such that byte checksum of TableLength equals zero. TableLength The length of this table. EfiMajorRevision The major EFI revision for which this table was generated. EfiMinorRevision The minor EFI revision for which this table was generated. TableMajorRevision The major revision of this table. TableMinorRevision The minor revision of this table. Reserved Reserved for future usage.
E820Pointer The 32-bit physical address where INT15 E820 data is stored within the traditional BIOS. The EfiCompatibility code will fill in the E820Pointer value and copy the data to the indicated area. E820Length The length of the E820 data and is filled in by the EfiCompatibility code. IrqRoutingTablePointer The 32-bit physical address where the $PIR table is stored in the traditional BIOS. The EfiCompatibility code will fill in the IrqRoutingTablePointer value and copy the data to the indicated area.
Code Definitions must be filled in prior to EfiCompatibility code issuing the Compatibility16 function Compatibility16InitializeYourself(). Compatibility16InitializeYourself() is defined in Compatability16 Functions. LastpciBus Maximum PCI bus number assigned. UmaAddress Start Address of Upper Memory Area (UMA) to be set as Read/Write. If UmaAddress is a valid address in the shadow RAM, it also indicates that the region from 0xC0000 to (UmaAddress – 1) can be used for Option ROM.
HiPermanentMemory Address and Size HiPermanentMemoryAddress HiPermanentMemorySize Conclusion 0 0 No high memory available for permanent allocation. 0 S (<> 0) No high memory available for permanent allocation. N (<> 0 and < 1MB) 0 No high memory available for permanent allocation. N (<> 0 and < 1MB) S (<> 0) No high memory available for permanent allocation. N (<> 0 and >= 1MB) 0 No high memory available for permanent allocation.
Code Definitions Prototype typedef enum { Compatibility16InitializeYourself 0000, Compatibility16UpdateBbs 0001, Compatibility16PrepareToBoot 0002, Compatibility16Boot 0003, Compatibility16RetrieveLastBootDevice 0004, Compatibility16DispatchOprom 0005, Compatibility16GetTableAddress 0006, Compatibility16SetKeyboardLeds 0007, Compatibility16InstallPciHandler 0008, } EFI_COMPATIBILITY_FUNCTIONS; 117
Parameters Compatibility16InitializeYourself Causes the Compatibility16 code to do any internal initialization required. See the Compatibility16InitializeYourself() function description. Compatibility16UpdateBbs Causes the Compatibility16 BIOS to perform any drive number translations to match the boot sequence. See the Compatibility16UpdateBbs() function description. Compatibility16PrepareToBoot Allows the Compatibility16 code to perform any final actions before booting.
Code Definitions Compatibility16InitializeYourself() Summary Causes the Compatibility16 code to do any internal initialization required. The EFI_TO_COMPATIBILITY16_INIT_TABLE pointer is passed into this function.
The CSM16 should use LowPmmMemory and LowPmmMemorySizeInBytes fields for the low memory that can be used for PMM. HiPmmMemory Starting address of the high memory block. HiPmmMemorySizeInBytes Length of high memory block. ReverseThunkCallSegment The segment of the reverse thunk call code. ReverseThunkCallOffset The offset of the reverse thunk call code. Number820Entries The number of E820 entries copied to the Compatibility16 BIOS. OsMemoryAbove1Mb The amount of usable memory above 1 MB, e.g.
Code Definitions Compatibility16UpdateBbs() Summary Causes the Compatibility16 BIOS to perform any drive number translations to match the boot sequence.
Compatibility16PrepareToBoot() Summary Allows the Compatibility16 code to perform any final actions before booting. The Compatibility16 code is read/write. Input Registers AX = Compatibility16PrepareToBoot ES:BX = Pointer to EFI_TO_COMPATIBILITY16_BOOT_TABLE structure Output Registers AX = Returned status codes Related Definitions The following data types and structures are defined in this section.
Code Definitions // // Legacy SIO state // DEVICE_PRODUCER_DATA_HEADER SioData; UINT16 DevicePathType; UINT16 PciIrqMask; UINT32 NumberE820Entries; // // Controller & Drive Identify[2] per controller information // HDD_INFO HddInfo[MAX_IDE_CONTROLLER]; UINT32 NumberBbsEntries; UINT32 BbsTable; UINT32 SmmTable; UINT32 OsMemoryAbove1Mb; UnconventionalDeviceTable; UINT32 } EFI_TO_COMPATIBILITY16_BOOT_TABLE; MajorVersion The EfiCompatibility major version number.
The default boot type. Following are the defined values: 1. FD = Floppy 2. HD = Hard Disk 3. CDROM = CD-ROM 4. PCMCIA = PCMCIA 5. USB = USB 6. NET = Networks 7. BEV = BBS BEV devices PciIrqMask Mask of which IRQs have been assigned to PCI. NumberE820Entries Number of E820 entries. The number can change from the Compatibility16InitializeYourself() function. HddInfo Hard disk drive information, including raw Identify Drive data. Type HDD_INFO is defined below.
Code Definitions DEVICE_PRODUCER_FLOPPY Floppy; UINT8 MousePresent; LEGACY_DEVICE_FLAGS Flags; } DEVICE_PRODUCER_DATA_HEADER; Serial Data for serial port x. Type DEVICE_PRODUCER_SERIAL is defined below. Parallel Data for parallel port x. Type DEVICE_PRODUCER_PARALLEL is defined below. Floppy Data for floppy. Type DEVICE_PRODUCER_FLOPPY is defined below. MousePresent Flag to indicate if mouse is present. Flags Miscellaneous Boolean state information passed to CSM.
//**************************************************** // Serial Mode values //**************************************************** #define DEVICE_SERIAL_MODE_NORMAL 0x00 #define DEVICE_SERIAL_MODE_IRDA 0x01 #define DEVICE_SERIAL_MODE_ASK_IR 0x02 #define DEVICE_SERIAL_MODE_DUPLEX_HALF 0x00 #define DEVICE_SERIAL_MODE_DUPLEX_FULL 0x10 //**************************************************** // DEVICE_PRODUCER_PARALLEL //**************************************************** typedef struct { UINT16 Add
Code Definitions // Parallel Mode values //**************************************************** #define DEVICE_PARALLEL_MODE_MODE_OUTPUT_ONLY 0x00 #define DEVICE_PARALLEL_MODE_MODE_BIDIRECTIONAL 0x01 #define DEVICE_PARALLEL_MODE_MODE_EPP 0x02 #define DEVICE_PARALLEL_MODE_MODE_ECP 0x03 //**************************************************** // DEVICE_PRODUCER_FLOPPY //**************************************************** typedef struct { UINT16 Address; UINT8 Irq; UINT8 Dma; UINT8 NumberOfFlopp
typedef struct { UINT32 A20Kybd:1; UINT32 A20Port92:1 UINT32 Reserved:30; } LEGACY_DEVICE_FLAGS; A20Kybd A20 controller by keyboard controller. A20Port92 A20 controlled by port 0x92. Reserved Reserved for future usage. A20Kybd and A20Port92 are not mutually exclusive.
Code Definitions Status of IDE device. Values are defined below. There is one HDD_INFO structure per IDE controller. The IdentifyDrive is per drive. Index 0 is master and index 1 is slave. Bus PCI bus of IDE controller. Device PCI device of IDE controller. Function PCI function of IDE controller. CommandBaseAddress Command ports base address. ControlBaseAddress Control ports base address.
//************************************************* // ATAPI_IDENTIFY //************************************************* typedef struct { UINT16 Raw[256]; } ATAPI_IDENTIFY; Raw Raw data from the IDE IdentifyDrive command.
Code Definitions UINT16 DescStringSegment; UINT32 InitPerReserved; UINT32 AdditionalIrq13Handler; UINT32 AdditionalIrq18Handler; UINT32 AdditionalIrq19Handler; UINT32 AdditionalIrq40Handler; UINT8 AssignedDriveNumber; UINT32 AdditionalIrq41Handler; UINT32 AdditionalIrq46Handler; UINT32 IBV1; UINT32 IBV2; } BBS_TABLE; BootPriority The boot priority for this boot device. Values are defined below. Bus The PCI bus for this boot device. Device The PCI device for this boot device.
DescString Segment:offset address of an ASCIIZ description string describing this device. InitPerReserved Reserved. AdditionalIrq??Handler The use of these fields is IBV dependent. They can be used to flag that an OpROM has hooked the specified IRQ. The OpROM may be BBS compliant as some SCSI BBS-compliant OpROMs also hook IRQ vectors in order to run their BIOS Setup.
Code Definitions //**************************************************** // DeviceType values //**************************************************** #define BBS_FLOPPY 0x01 #define BBS_HARDDISK 0x02 #define BBS_CDROM 0x03 #define BBS_PCMCIA 0x04 #define BBS_USB 0x05 #define BBS_EMBED_NETWORK 0x06 #define BBS_BEV_DEVICE 0x80 #define BBS_UNKNOWN 0xff //**************************************************** // BBS_STATUS_FLAGS //**************************************************** typedef
Failed 0 = Not known if boot failure occurred. 1 = Boot attempted failed. MediaPresent State of media present. 00 = No bootable media is present in the device. 01 = Unknown if a bootable media present. 10 = Media is present and appears bootable. 11 = Reserved. Reserved2 Reserved for future use. //**************************************************** // SMM_TABLE //**************************************************** // // SMM Table definitions // SMM table has a header that provides the number of entries.
Code Definitions //**************************************************** // SMM_ENTRY //**************************************************** typedef struct { SMM_ATTRIBUTES SmmAttributes; SMM_FUNCTION SmmFunction; UINTx SmmPort; UINTx SmmData; } SMM_ENTRY; SmmAttributes Describes the access mechanism, SmmPort, and SmmData sizes. Type SMM_ATTRIBUTES is defined below. SmmFunction Function Soft SMI is to perform. Type SMM_FUNCTION is defined below.
UINT16 Type : 3; UINT16 PortGranularity : 3; UINT16 DataGranularity : 3; UINT16 Reserved : 7; } SMM_ATTRIBUTES; Type Access mechanism used to generate the soft SMI. Defined types are below. The other values are reserved for future usage. PortGranularity Size of "port" in bits. Defined values are below. DataGranularity Size of data in bits. Defined values are below. Reserved Reserved for future use.
Code Definitions //**************************************************** #define DATA_SIZE_8 0x00 #define DATA_SIZE_16 0x01 #define DATA_SIZE_32 0x02 #define DATA_SIZE_64 0x03 //**************************************************** // SMM_FUNCTION //**************************************************** typedef struct { UINT16 Function : 15; UINT16 Owner : 1; } SMM_FUNCTION; Function Function this Soft SMI is to initiate. Defined functions are below. Owner The definer of the function.
Table 12 Function Value Descriptions INT15_D042 System Configuration Data functions accessed via INT15 AX=0xD042. GET_USB_BOOT_INFO Retrieves USB boot device information for integration with BBS. The other values are reserved for future use. DMI_PNP_50_57 Process the DMI Plug and Play functions 0x50 through 0x57 via SMM code.
Code Definitions UINT8 BbtTableEntryNumberForHddDiag; UINT8 BeerData[128]; UINT8 ServiceAreaData[64]; } UD_TABLE; Attributes This field contains the bit-mapped attributes of the PARTIES information. Type UDC_ATTRIBUTES is defined below. DeviceNumber This field contains the zero-based device on which the selected ServiceDataArea is present. It is 0 for master and 1 for the slave device.
//**************************************************** // UDC_ATTRIBUTES //**************************************************** typedef struct { UINT8 DirectoryServiceValidity UINT8 RabcaUsedFlag UINT8 ExecuteHddDiagnosticsFlag UINT8 Reserved : 1; : 1; : 1; : 5; } UDC_ATTRIBUTES; DirectoryServiceValidity This bit set indicates that the ServiceAreaData is valid. RacbaUsedFlag This bit set indicates to use the Reserve Area Boot Code Address (RACBA) only if DirectoryServiceValidity is 0.
Code Definitions Compatibility16Boot() Summary Causes the Compatibility16 BIOS to boot. The Compatibility16 code is Read/Only. Input Registers AX = Compatibility16Boot Output Registers AX = Returned status codes Related Definitions typedef struct { } EFI_COMPATIBILITY16_BOOT; Status Codes Returned EFI_SUCCESS 0x0000 EFI_TBD 0x8000 – The master boot record is missing or corrupted.
Compatibility16RetrieveLastBootDevice() Summary Allows the Compatibility16 code to get the last device from which a boot was attempted. This is stored in CMOS and is the priority number of the last attempted boot device. Input Registers AX = Compatibility16RetrieveLastBootDevice Output Registers AX = Returned status codes BX = Priority number of the boot device.
Code Definitions Compatibility16DispatchOprom() Summary Allows the Compatibility16 code rehook INT13, INT18, and/or INT19 after dispatching a legacy OpROM. Input Registers AX = Compatibility16DispatchOprom ES:BX = Pointer to EFI_DISPATCH_OPROM_TABLE Output Registers AX = Returned status codes BX = Number of non-BBS-compliant devices found. Equals 0 if BBS compliant.
PciBus The PCI bus. PciDeviceFunction The PCI device * 0x08 | PCI function. NumberBbsEntries The number of valid BBS table entries upon entry and exit. The IBV code may increase this number, if BBS-compliant devices also hook INTs in order to force the OpROM BIOS Setup to be executed. BbsTable Pointer to the BBS table.
Code Definitions Compatibility16GetTableAddress() Summary Finds a free area in the 0xFxxxx or 0xExxxx region of the specified length and returns the address of that region. Input Registers AX = Compatibility16GetTableAddress BX = Allocation region 00 = Allocate from either 0xE0000 or 0xF0000 64 KB blocks. Bit 0 = 1 Allocate from 0xF0000 64 KB block Bit 1 = 1 Allocate from 0xE0000 64 KB block CX = Requested length in bytes. DX = Required address alignment. Bit mapped.
Compatibility16SetKeyboardLeds() Summary Enables the EfiCompatibility module to do any nonstandard processing of keyboard LEDs or state. Input Registers AX = Compatibility16SetKeyboardLeds CL = LED status.
Code Definitions Compatibility16InstallPciHandler() Summary Enables the EfiCompatibility module to install an interrupt handler for PCI mass media devices that do not have an OpROM associated with them. An example is SATA.
// Secondary section // UINT8 SecondaryIrq; UINT8 SecondaryReserved; UINT16 SecondaryControl; UINT16 SecondaryBase; UINT16 SecondaryBusMaster; } EFI_LEGACY_INSTALL_PCI_HANDLER; PciBus The PCI bus of the device. PciDeviceFun The PCI device in bits 7:3 and function in bits 2:0. PciSegment The PCI segment of the device. PciClass The PCI class code of the device. PciSubclass The PCI subclass code of the device. PciInterface The PCI interface code of the device.
Code Definitions SecondaryControl The secondary device control I/O base. SecondaryBase The secondary device I/O base. SecondaryBusMaster The secondary device bus master I/O base.
3.3.3.2 Legacy Soft SMI Summary SMM code is provided from the same IBV as the Compatibility16 and the Legacy BIOS Platform Protocol code. The soft SMI structures in SMM_TABLE (defined in Compatibility16PrepareToBoot()) are meant to establish a common standard but are not required to be implemented by the IBV. If the structures are used, then the recommended interface between the SMM code and Compatibility16 code is defined below. Input Registers EAX, AX, AL = SmmTable.SmmEntry.
Code Definitions 151
4 Example Code 4.1 Example of a Dummy EFI SMM Child Driver User defined areas are highlighted like this in yellow. /*++ Module Name: UnitTestChild.c Abstract: This is a generic template for a child of the IchSmm driver. --*/ #include "Efi.h" #include "EfiRuntimeLib.h" #include "GetFvImage.
Example Code EFI_DRIVER_ENTRY_POINT(InitializeChild) EFI_STATUS InitializeChild ( IN EFI_HANDLE IN EFI_SYSTEM_TABLE ) /*++ ImageHandle, *SystemTable Routine Description: Initializes the SMM Handler Driver Arguments: ImageHandle SystemTable Returns: None --*/ { EFI_STATUS BOOLEAN EFI_HANDLE UINT8* UINTN Status; InSmm; Handle; Buffer; BufferSize; EFI_SMM_SW_DISPATCH_CONTEXT EFI_HANDLE SwContext = { 0 }; SwHandle = 0; Status = BufferSize = InSmm = 0; Handle = Buffer = NULL; // // Initialize the EFI Runt
mSmmBase->GetSmstLocation(mSmmBase, &mSmst); // Locate SwDispatch protocol Status = gBS->LocateProtocol(&gEfiSmmSwDispatchProtocolGuid, NULL, &mSwDispatch); if (EFI_ERROR(Status)) { DEBUG(( EFI_D_ERROR, "Couldn't find SmmSwDispatch protocol: %r\n", Status)); return Status; } // // Register for callbacks // // Pick a value for the context and register for it SwContext.
Example Code 4.2 Example of a Dummy EFI Hardware SMM Child Driver User defined areas are highlighted like this. /*++ Module Name: YourName.c Abstract: This is a generic template for a child of the IchSmm driver. Revision History --*/ #include "Efi.h" #include "EfiRuntimeLib.h" #include "GetFvImage.
//////////////////////////////////////////// EFI_DRIVER_ENTRY_POINT(InitializeChild) EFI_STATUS InitializeChild ( IN EFI_HANDLE IN EFI_SYSTEM_TABLE ) /*++ ImageHandle, *SystemTable Routine Description: Initializes the SMM Handler Driver Arguments: ImageHandle SystemTable Returns: None --*/ { Your code here // // Initialize the EFI Runtime Library // EfiInitializeSmmDriverLib (ImageHandle, SystemTable); Status = gBS->LocateProtocol(&gEfiSmmBaseProtocolGuid, NULL, &mSmmBase); if (EFI_ERROR(Status)) { return
Example Code // Register for the Your event. This defines the hardware path // and bits associated with the hardware SMM. These are defined // by the Framework. // YourContext.Type = Framework assigned type; YourContext.
5 Legacy BIOS References 5.1 BIOS INTs This document lists only the INTs to be supported and does not list all subfunctions unless they are not required. Refer to the IBM* Personal System/2 and Personal Computer BIOS Interface Technical Reference or any of the AMI* or Phoenix* BIOS manuals for full information on all subfunctions. INT 0x02 - NMI There needs to be a NMI handler. INT 0x05 - Print Screen This INT must be supported. Note that this INT modifies memory location 50:00.
Legacy BIOS References INT 0x09 - Keyboard This INT must be supported. It is called on every make or break keystroke. The 32byte buffer starting at 40:1E is updated at the address pointed by the keyboard-buffer tail pointer. The keyboard-buffer tail pointer at memory location 40:1C is incremented by 2 unless it extends past the keyboard-buffer, in which case it wraps.
INT 0x10 - Video This INT is supported by the video OpROM. There is no native planar BIOS support. INT 0x11 - Equipment Determination This INT must be supported. This INT returns the data at memory location 40:10. Memory Location 40:10 This location is a Word memory location and contains the equipment list. INT 0x12 - Base Memory Size This INT must be supported and returns the value at memory location 40:13.
Legacy BIOS References INT 0x1D - Video Parameter Table Set by the video BIOS. INT 0x1E - Floppy Diskette Drive Parameters Points to an 11-byte data structure. INT 0x1F - Video Graphics Characters Set by the video BIOS. INT 0x40 - Floppy Diskette Services This INT must be supported if non-floppy controllers are present. INT 0x41 - HDD C: Drive Parameters Points to a 16-byte data structure for drive C:. INT 0x46 - HDD D: Drive Parameters Points to a 16-byte data structure for drive D:.
5.2 Fixed BIOS Entry Points The fixed entry points in F000: xxxx must be supported for traditional reasons. The table below lists the fixed BIOS entry points.
Legacy BIOS References 5.3 Fixed CMOS Locations The table below lists the fixed CMOS locations.
5.4 BDA and EBDA Memory Addresses The BIOS Data Area (BDA) starts at 40:0 and is 257 bytes in length. Byte 40:100 is byted by INT 0x05.
Legacy BIOS References Start Location Length in bytes Description Modified by Legacy BIOS INT Using It 0x75 1 Number of HDDs attached No 13 0x76 2 Reserved No 13 0x78 1 LPT 1 time-out Yes 14 0x79 1 LPT 2 time-out Yes 14 0x7A 1 LPT 3 time-out Yes 14 0x7B 1 Reserved No 0x7C 1 COM 1 time-out Yes 0x7D 1 COM 2 time-out Yes 0x7E 1 COM 3 time-out Yes 0x7F 1 COM 4 time-out Yes 0x80 2 Keyboard buffer start ptr 16 0x82 2 Keyboard buffer end ptr 16 0x84 7 Vi
Start Location Length in bytes Description Modified by Legacy BIOS 0xAC 0x54 Reserved No 0x100 1 Print Screen status Yes 166 INT Using It 05 Comments
Legacy BIOS References 5.5 EBDA (Extended BIOS Data Area) This area starts at the segment pointed to by the contents of 40:0E.
5.6.2.1 IA-32 Faults, Exceptions, and Traps The table below lists the IA-32 faults, exceptions, and traps.
Legacy BIOS References 5.6.2.2 IA-32 Interrupts The table below lists the IA-32 interrupts.
5.6.3.1 PAL-Based Interrupts The table below lists the PAL-based interrupts for the Itanium® processor family. Table 20 PAL-Based Interrupts Type 5.6.3.2 Name PALE Entry Description Abort Machine Checks (MCA) PALE_CHECK An immediate action hardware error has occurred. Abort Processor Reset PALE_RESET A processor has been powered on or a reset request sent to it. Initialization interrupts INIT PALE_INIT A processor has received an initialization interrupt.
Legacy BIOS References instruction. The saving of the context is necessary as IVE microcode uses all the Itanium architecture registers. When the IA-32 handler does an Iret instruction, this instruction is trapped by Itanium architecture and the Itanium architecture trap handler restores the caller context and returns through an RFI. It is possible that IA-32 code may not do an Iret but does “ret 2.” There are several ways to handle this situation.
Type Name Description Instruction Access Rights Instruction Access-Bit Instruction Key Miss Instruction TLB Key Permission Lower-Privilege Transfer Trap NaT Consumption Page Not Present Single Step Trap Used Speculation Taken Branch Trap Unaligned Reference Unsupported Data Reference VHPT Translation Mixed EFI and Traditional Environment The mixed EFI and traditional environment imposes several complexities over the EFIonly environment. The main complexity is a transition to/from 32-bit/16-bit mode.
Legacy BIOS References 5.6.4.1 13. Invoke the timer tick interrupt, if needed. 14. Copy the 16-bit register stack to the EFI stack. 15. Return the carry flag state for successful/unsuccessful completion. IA-32 The Legacy section supports all the traditional BIOS software and hardware interrupts. 5.6.4.2 Itanium Processor Family See the comments on executing 16-bit code.
6 Glossary 16-bit legacy: The traditional PC environment and includes traditional OpROMs and Compatibility16 code. BDA: BIOS Data Area. Compatibility16: The traditional BIOS with POST and BIOS Setup removed. Executes in 16-bit real mode. CompatibilitySmm: Any IBV-provided SMM code to perform traditional functions that are not provided by EFI. CSM: Compatibility Support Module. The combination of EfiCompatibility, CompatibilitySmm, and Compatibility16. EBDA: Extended BIOS Data Area.