X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=IntelFrameworkPkg%2FInclude%2FFramework%2FLegacy16.h;h=1d74ddc58243aa9098811cedddcf6a9fc67c72f4;hp=6ccb51d600a9b9a48e4ffd23fc557f193101daa6;hb=0f899407a356d80ee211b181878b0b432e7c3fff;hpb=c2c8503b373188c26744154d9e19f4934c70b1c5 diff --git a/IntelFrameworkPkg/Include/Framework/Legacy16.h b/IntelFrameworkPkg/Include/Framework/Legacy16.h index 6ccb51d600..1d74ddc582 100644 --- a/IntelFrameworkPkg/Include/Framework/Legacy16.h +++ b/IntelFrameworkPkg/Include/Framework/Legacy16.h @@ -16,7 +16,8 @@ Module Name: FrameworkLegacy16.h @par Revision Reference: - These definitions are from Compatibility Support Module Spec Version 0.96. + These definitions are from Compatibility Support Module Spec + Version 0.97. **/ @@ -25,60 +26,55 @@ #include -// -// All structures defined in this header file are packed on byte boundary -// #pragma pack(1) -typedef UINT8 SERIAL_MODE; -typedef UINT8 PARALLEL_MODE; +typedef UINT8 SERIAL_MODE; +typedef UINT8 PARALLEL_MODE; -/////////////////////////////////////////////////////////////////////////////// +// // EFI_COMPATIBILITY16_TABLE is located at a 16-byte boundary starting with the // signature "$EFI" -/////////////////////////////////////////////////////////////////////////////// - -#define EFI_COMPATIBILITY16_TABLE_SIGNATURE EFI_SIGNATURE_32 ('I', 'F', 'E', '$') - +// +#define EFI_COMPATIBILITY16_TABLE_SIGNATURE SIGNATURE_32 ('I', 'F', 'E', '$') typedef struct { - UINT32 Signature; // "$EFI" - UINT8 TableChecksum; - UINT8 TableLength; - UINT8 EfiMajorRevision; - UINT8 EfiMinorRevision; - UINT8 TableMajorRevision; - UINT8 TableMinorRevision; - UINT16 Reserved; - UINT16 Compatibility16CallSegment; - UINT16 Compatibility16CallOffset; - UINT16 PnPInstallationCheckSegment; - UINT16 PnPInstallationCheckOffset; - UINT32 EfiSystemTable; // The physical address of EFI_SYSTEM_TABLE - 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 PciExpressBase; - UINT8 LastPciBus; + UINT32 Signature; + UINT8 TableChecksum; + UINT8 TableLength; + UINT8 EfiMajorRevision; + UINT8 EfiMinorRevision; + UINT8 TableMajorRevision; + UINT8 TableMinorRevision; + UINT16 Reserved; + UINT16 Compatibility16CallSegment; + UINT16 Compatibility16CallOffset; + UINT16 PnPInstallationCheckSegment; + UINT16 PnPInstallationCheckOffset; + UINT32 EfiSystemTable; // The physical address of EFI_SYSTEM_TABLE + 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 PciExpressBase; + UINT8 LastPciBus; } EFI_COMPATIBILITY16_TABLE; -/////////////////////////////////////////////////////////////////////////////// +// // Functions provided by the CSM binary -/////////////////////////////////////////////////////////////////////////////// +// typedef enum { Legacy16InitializeYourself = 0x0000, Legacy16UpdateBbs = 0x0001, @@ -91,34 +87,34 @@ typedef enum { Legacy16InstallPciHandler = 0x0008 } EFI_COMPATIBILITY_FUNCTIONS; -/////////////////////////////////////////////////////////////////////////////// +// // EFI_TO_COMPATIBILITY16_INIT_TABLE -/////////////////////////////////////////////////////////////////////////////// +// typedef struct { - UINT32 BiosLessThan1MB; - UINT32 HiPmmMemory; - UINT32 HiPmmMemorySizeInBytes; - UINT16 ReverseThunkCallSegment; - UINT16 ReverseThunkCallOffset; - UINT32 NumberE820Entries; - UINT32 OsMemoryAbove1Mb; - UINT32 ThunkStart; - UINT32 ThunkSizeInBytes; - UINT32 LowPmmMemory; - UINT32 LowPmmMemorySizeInBytes; + UINT32 BiosLessThan1MB; + UINT32 HiPmmMemory; + UINT32 HiPmmMemorySizeInBytes; + UINT16 ReverseThunkCallSegment; + UINT16 ReverseThunkCallOffset; + UINT32 NumberE820Entries; + UINT32 OsMemoryAbove1Mb; + UINT32 ThunkStart; + UINT32 ThunkSizeInBytes; + UINT32 LowPmmMemory; + UINT32 LowPmmMemorySizeInBytes; } EFI_TO_COMPATIBILITY16_INIT_TABLE; -/////////////////////////////////////////////////////////////////////////////// +// // EFI_TO_COMPATIBILITY16_BOOT_TABLE -/////////////////////////////////////////////////////////////////////////////// +// // // DEVICE_PRODUCER_SERIAL & its modes // typedef struct { - UINT16 Address; - UINT8 Irq; - SERIAL_MODE Mode; + UINT16 Address; + UINT8 Irq; + SERIAL_MODE Mode; } DEVICE_PRODUCER_SERIAL; #define DEVICE_SERIAL_MODE_NORMAL 0x00 @@ -131,10 +127,10 @@ typedef struct { // DEVICE_PRODUCER_PARALLEL & its modes // typedef struct { - UINT16 Address; - UINT8 Irq; - UINT8 Dma; - PARALLEL_MODE Mode; + UINT16 Address; + UINT8 Irq; + UINT8 Dma; + PARALLEL_MODE Mode; } DEVICE_PRODUCER_PARALLEL; #define DEVICE_PARALLEL_MODE_MODE_OUTPUT_ONLY 0x00 @@ -146,52 +142,52 @@ typedef struct { // DEVICE_PRODUCER_FLOPPY // typedef struct { - UINT16 Address; - UINT8 Irq; - UINT8 Dma; - UINT8 NumberOfFloppy; + UINT16 Address; + UINT8 Irq; + UINT8 Dma; + UINT8 NumberOfFloppy; } DEVICE_PRODUCER_FLOPPY; // // LEGACY_DEVICE_FLAGS // typedef struct { - UINT32 A20Kybd : 1; - UINT32 A20Port90 : 1; - UINT32 Reserved : 30; + UINT32 A20Kybd : 1; + UINT32 A20Port90 : 1; + UINT32 Reserved : 30; } LEGACY_DEVICE_FLAGS; // // DEVICE_PRODUCER_DATA_HEADER // typedef struct { - DEVICE_PRODUCER_SERIAL Serial[4]; - DEVICE_PRODUCER_PARALLEL Parallel[3]; - DEVICE_PRODUCER_FLOPPY Floppy; - UINT8 MousePresent; - LEGACY_DEVICE_FLAGS Flags; + DEVICE_PRODUCER_SERIAL Serial[4]; + DEVICE_PRODUCER_PARALLEL Parallel[3]; + DEVICE_PRODUCER_FLOPPY Floppy; + UINT8 MousePresent; + LEGACY_DEVICE_FLAGS Flags; } DEVICE_PRODUCER_DATA_HEADER; // // ATAPI_IDENTIFY // typedef struct { - UINT16 Raw[256]; + UINT16 Raw[256]; } ATAPI_IDENTIFY; // // HDD_INFO & its status // typedef struct { - UINT16 Status; - UINT32 Bus; - UINT32 Device; - UINT32 Function; - UINT16 CommandBaseAddress; - UINT16 ControlBaseAddress; - UINT16 BusMasterAddress; - UINT8 HddIrq; - ATAPI_IDENTIFY IdentifyDrive[2]; + UINT16 Status; + UINT32 Bus; + UINT32 Device; + UINT32 Function; + UINT16 CommandBaseAddress; + UINT16 ControlBaseAddress; + UINT16 BusMasterAddress; + UINT8 HddIrq; + ATAPI_IDENTIFY IdentifyDrive[2]; } HDD_INFO; #define HDD_PRIMARY 0x01 @@ -207,52 +203,52 @@ typedef struct { // BBS_STATUS_FLAGS // typedef struct { - UINT16 OldPosition : 4; - UINT16 Reserved1 : 4; - UINT16 Enabled : 1; - UINT16 Failed : 1; - UINT16 MediaPresent : 2; - UINT16 Reserved2 : 4; + UINT16 OldPosition : 4; + UINT16 Reserved1 : 4; + UINT16 Enabled : 1; + UINT16 Failed : 1; + UINT16 MediaPresent : 2; + UINT16 Reserved2 : 4; } BBS_STATUS_FLAGS; // // BBS_TABLE, device type values & boot priority values // typedef struct { - UINT16 BootPriority; - UINT32 Bus; - UINT32 Device; - UINT32 Function; - UINT8 Class; - UINT8 SubClass; - UINT16 MfgStringOffset; - UINT16 MfgStringSegment; - UINT16 DeviceType; - BBS_STATUS_FLAGS StatusFlags; - UINT16 BootHandlerOffset; - UINT16 BootHandlerSegment; - UINT16 DescStringOffset; - UINT16 DescStringSegment; - UINT32 InitPerReserved; - UINT32 AdditionalIrq13Handler; - UINT32 AdditionalIrq18Handler; - UINT32 AdditionalIrq19Handler; - UINT32 AdditionalIrq40Handler; - UINT8 AssignedDriveNumber; - UINT32 AdditionalIrq41Handler; - UINT32 AdditionalIrq46Handler; - UINT32 IBV1; - UINT32 IBV2; + UINT16 BootPriority; + UINT32 Bus; + UINT32 Device; + UINT32 Function; + UINT8 Class; + UINT8 SubClass; + UINT16 MfgStringOffset; + UINT16 MfgStringSegment; + UINT16 DeviceType; + BBS_STATUS_FLAGS StatusFlags; + UINT16 BootHandlerOffset; + UINT16 BootHandlerSegment; + UINT16 DescStringOffset; + UINT16 DescStringSegment; + UINT32 InitPerReserved; + UINT32 AdditionalIrq13Handler; + UINT32 AdditionalIrq18Handler; + UINT32 AdditionalIrq19Handler; + UINT32 AdditionalIrq40Handler; + UINT8 AssignedDriveNumber; + UINT32 AdditionalIrq41Handler; + UINT32 AdditionalIrq46Handler; + UINT32 IBV1; + UINT32 IBV2; } BBS_TABLE; -#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 +#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 #define BBS_DO_NOT_BOOT_FROM 0xFFFC #define BBS_LOWEST_PRIORITY 0xFFFD @@ -263,10 +259,10 @@ typedef struct { // SMM_ATTRIBUTES & relating type, port and data size constants // typedef struct { - UINT16 Type : 3; - UINT16 PortGranularity : 3; - UINT16 DataGranularity : 3; - UINT16 Reserved : 7; + UINT16 Type : 3; + UINT16 PortGranularity : 3; + UINT16 DataGranularity : 3; + UINT16 Reserved : 7; } SMM_ATTRIBUTES; #define STANDARD_IO 0x00 @@ -286,8 +282,8 @@ typedef struct { // SMM_FUNCTION & relating constants // typedef struct { - UINT16 Function : 15; - UINT16 Owner : 1; + UINT16 Function : 15; + UINT16 Owner : 1; } SMM_FUNCTION; #define INT15_D042 0x0000 @@ -304,41 +300,41 @@ typedef struct { // properly to reflect that assumption. // typedef struct { - SMM_ATTRIBUTES SmmAttributes; - SMM_FUNCTION SmmFunction; - UINT8 SmmPort; - UINT8 SmmData; + SMM_ATTRIBUTES SmmAttributes; + SMM_FUNCTION SmmFunction; + UINT8 SmmPort; + UINT8 SmmData; } SMM_ENTRY; // // SMM_TABLE // typedef struct { - UINT16 NumSmmEntries; - SMM_ENTRY SmmEntry; + UINT16 NumSmmEntries; + SMM_ENTRY SmmEntry; } SMM_TABLE; // // UDC_ATTRIBUTES // typedef struct { - UINT8 DirectoryServiceValidity : 1; - UINT8 RabcaUsedFlag : 1; - UINT8 ExecuteHddDiagnosticsFlag : 1; - UINT8 Reserved : 5; + UINT8 DirectoryServiceValidity : 1; + UINT8 RabcaUsedFlag : 1; + UINT8 ExecuteHddDiagnosticsFlag : 1; + UINT8 Reserved : 5; } UDC_ATTRIBUTES; // // UD_TABLE // typedef struct { - UDC_ATTRIBUTES Attributes; - UINT8 DeviceNumber; - UINT8 BbsTableEntryNumberForParentDevice; - UINT8 BbsTableEntryNumberForBoot; - UINT8 BbsTableEntryNumberForHddDiag; - UINT8 BeerData[128]; - UINT8 ServiceAreaData[64]; + UDC_ATTRIBUTES Attributes; + UINT8 DeviceNumber; + UINT8 BbsTableEntryNumberForParentDevice; + UINT8 BbsTableEntryNumberForBoot; + UINT8 BbsTableEntryNumberForHddDiag; + UINT8 BeerData[128]; + UINT8 ServiceAreaData[64]; } UD_TABLE; // @@ -349,61 +345,55 @@ typedef struct { #define MAX_IDE_CONTROLLER 8 typedef struct { - UINT16 MajorVersion; - UINT16 MinorVersion; - UINT32 AcpiTable; // 4 GB range - UINT32 SmbiosTable; // 4 GB range - UINT32 SmbiosTableLength; - + UINT16 MajorVersion; + UINT16 MinorVersion; + UINT32 AcpiTable; // 4 GB range + UINT32 SmbiosTable; // 4 GB range + UINT32 SmbiosTableLength; // // Legacy SIO state // - DEVICE_PRODUCER_DATA_HEADER SioData; - - UINT16 DevicePathType; - UINT16 PciIrqMask; - UINT32 NumberE820Entries; - + 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; - UINT32 UnconventionalDeviceTable; + HDD_INFO HddInfo[MAX_IDE_CONTROLLER]; + UINT32 NumberBbsEntries; + UINT32 BbsTable; + UINT32 SmmTable; + UINT32 OsMemoryAbove1Mb; + UINT32 UnconventionalDeviceTable; } EFI_TO_COMPATIBILITY16_BOOT_TABLE; -/////////////////////////////////////////////////////////////////////////////// +// // EFI_LEGACY_INSTALL_PCI_HANDLER -/////////////////////////////////////////////////////////////////////////////// +// typedef struct { - UINT8 PciBus; - UINT8 PciDeviceFun; - UINT8 PciSegment; - UINT8 PciClass; - UINT8 PciSubclass; - UINT8 PciInterface; - + UINT8 PciBus; + UINT8 PciDeviceFun; + UINT8 PciSegment; + UINT8 PciClass; + UINT8 PciSubclass; + UINT8 PciInterface; // // Primary section // - UINT8 PrimaryIrq; - UINT8 PrimaryReserved; - UINT16 PrimaryControl; - UINT16 PrimaryBase; - UINT16 PrimaryBusMaster; - + UINT8 PrimaryIrq; + UINT8 PrimaryReserved; + UINT16 PrimaryControl; + UINT16 PrimaryBase; + UINT16 PrimaryBusMaster; // // Secondary Section // - UINT8 SecondaryIrq; - UINT8 SecondaryReserved; - UINT16 SecondaryControl; - UINT16 SecondaryBase; - UINT16 SecondaryBusMaster; + UINT8 SecondaryIrq; + UINT8 SecondaryReserved; + UINT16 SecondaryControl; + UINT16 SecondaryBase; + UINT16 SecondaryBusMaster; } EFI_LEGACY_INSTALL_PCI_HANDLER; //