summaryrefslogtreecommitdiff
path: root/IntelFrameworkPkg/Include/Framework/Legacy16.h
diff options
context:
space:
mode:
Diffstat (limited to 'IntelFrameworkPkg/Include/Framework/Legacy16.h')
-rw-r--r--IntelFrameworkPkg/Include/Framework/Legacy16.h365
1 files changed, 177 insertions, 188 deletions
diff --git a/IntelFrameworkPkg/Include/Framework/Legacy16.h b/IntelFrameworkPkg/Include/Framework/Legacy16.h
index 186c63bf32..e31844249a 100644
--- a/IntelFrameworkPkg/Include/Framework/Legacy16.h
+++ b/IntelFrameworkPkg/Include/Framework/Legacy16.h
@@ -25,60 +25,55 @@
#include <Base.h>
-//
-// 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 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 +86,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 +126,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 +141,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 +202,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 +258,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 +281,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 +299,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 +344,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;
//