summaryrefslogtreecommitdiff
path: root/MdePkg/Include/IndustryStandard
diff options
context:
space:
mode:
authorqhuang8 <qhuang8@6f19259b-4bc3-4df7-8a09-765794883524>2008-11-11 22:21:08 +0000
committerqhuang8 <qhuang8@6f19259b-4bc3-4df7-8a09-765794883524>2008-11-11 22:21:08 +0000
commit766f4bc13745f77fbcd68efc7d689f493c67b833 (patch)
tree1a372a4fc15014535d578b7e4217254e88ca341d /MdePkg/Include/IndustryStandard
parent8e1ac15ab89d289a42bd687a91b94d1c4284d3f1 (diff)
downloadedk2-platforms-766f4bc13745f77fbcd68efc7d689f493c67b833.tar.xz
Revert all the #pramga(1) related patches to r6434, we need to review all the updates carefully.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@6461 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdePkg/Include/IndustryStandard')
-rw-r--r--MdePkg/Include/IndustryStandard/Acpi10.h57
-rw-r--r--MdePkg/Include/IndustryStandard/Acpi20.h62
-rw-r--r--MdePkg/Include/IndustryStandard/Acpi30.h94
-rw-r--r--MdePkg/Include/IndustryStandard/AlertStandardFormatTable.h9
-rw-r--r--MdePkg/Include/IndustryStandard/Atapi.h52
-rw-r--r--MdePkg/Include/IndustryStandard/ElTorito.h10
-rw-r--r--MdePkg/Include/IndustryStandard/HighPrecisionEventTimerTable.h4
-rw-r--r--MdePkg/Include/IndustryStandard/IScsiBootFirmwareTable.h38
-rw-r--r--MdePkg/Include/IndustryStandard/Mbr.h9
-rw-r--r--MdePkg/Include/IndustryStandard/MemoryMappedConfigurationSpaceAccessTable.h7
-rw-r--r--MdePkg/Include/IndustryStandard/Pci22.h31
-rw-r--r--MdePkg/Include/IndustryStandard/Pci23.h3
-rw-r--r--MdePkg/Include/IndustryStandard/Pci30.h4
-rw-r--r--MdePkg/Include/IndustryStandard/Sal.h26
-rw-r--r--MdePkg/Include/IndustryStandard/Scsi.h3
-rw-r--r--MdePkg/Include/IndustryStandard/SerialPortConsoleRedirectionTable.h10
-rw-r--r--MdePkg/Include/IndustryStandard/SmBios.h21
-rw-r--r--MdePkg/Include/IndustryStandard/Tpm12.h1
-rw-r--r--MdePkg/Include/IndustryStandard/Usb.h9
-rw-r--r--MdePkg/Include/IndustryStandard/WatchdogActionTable.h6
-rw-r--r--MdePkg/Include/IndustryStandard/WatchdogResourceTable.h7
21 files changed, 241 insertions, 222 deletions
diff --git a/MdePkg/Include/IndustryStandard/Acpi10.h b/MdePkg/Include/IndustryStandard/Acpi10.h
index dbd61a2e40..bd05553e04 100644
--- a/MdePkg/Include/IndustryStandard/Acpi10.h
+++ b/MdePkg/Include/IndustryStandard/Acpi10.h
@@ -23,10 +23,11 @@ typedef struct {
UINT32 Length;
} EFI_ACPI_COMMON_HEADER;
+//
+// Common ACPI description table header. This structure prefaces most ACPI tables.
+//
#pragma pack(1)
-///
-/// Common ACPI description table header. This structure prefaces most ACPI tables.
-///
+
typedef struct {
UINT32 Signature;
UINT32 Length;
@@ -38,8 +39,8 @@ typedef struct {
UINT32 CreatorId;
UINT32 CreatorRevision;
} EFI_ACPI_DESCRIPTION_HEADER;
-#pragma pack()
+#pragma pack()
//
// Define for Desriptor
//
@@ -62,11 +63,10 @@ typedef struct {
// Ensure proper structure formats
//
#pragma pack(1)
-
-///
-/// The commond definition of QWORD, DWORD, and WORD
-/// Address Space Descriptors
-///
+//
+// The commond definition of QWORD, DWORD, and WORD
+// Address Space Descriptors
+//
typedef struct {
UINT8 Desc;
UINT16 Len;
@@ -124,6 +124,10 @@ typedef struct {
#define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_TYPE_STATIC (0 << 5)
//
+// Ensure proper structure formats
+//
+#pragma pack(1)
+//
// ACPI 1.0b table structures
//
@@ -204,16 +208,16 @@ typedef struct {
// Fixed ACPI Description Table Fixed Feature Flags
// All other bits are reserved and must be set to 0.
//
-#define EFI_ACPI_1_0_WBINVD BIT0
-#define EFI_ACPI_1_0_WBINVD_FLUSH BIT1
-#define EFI_ACPI_1_0_PROC_C1 BIT2
-#define EFI_ACPI_1_0_P_LVL2_UP BIT3
-#define EFI_ACPI_1_0_PWR_BUTTON BIT4
-#define EFI_ACPI_1_0_SLP_BUTTON BIT5
-#define EFI_ACPI_1_0_FIX_RTC BIT6
-#define EFI_ACPI_1_0_RTC_S4 BIT7
-#define EFI_ACPI_1_0_TMR_VAL_EXT BIT8
-#define EFI_ACPI_1_0_DCK_CAP BIT9
+#define EFI_ACPI_1_0_WBINVD (1 << 0)
+#define EFI_ACPI_1_0_WBINVD_FLUSH (1 << 1)
+#define EFI_ACPI_1_0_PROC_C1 (1 << 2)
+#define EFI_ACPI_1_0_P_LVL2_UP (1 << 3)
+#define EFI_ACPI_1_0_PWR_BUTTON (1 << 4)
+#define EFI_ACPI_1_0_SLP_BUTTON (1 << 5)
+#define EFI_ACPI_1_0_FIX_RTC (1 << 6)
+#define EFI_ACPI_1_0_RTC_S4 (1 << 7)
+#define EFI_ACPI_1_0_TMR_VAL_EXT (1 << 8)
+#define EFI_ACPI_1_0_DCK_CAP (1 << 9)
///
/// Firmware ACPI Control Structure
@@ -232,7 +236,7 @@ typedef struct {
/// Firmware Control Structure Feature Flags
/// All other bits are reserved and must be set to 0.
///
-#define EFI_ACPI_1_0_S4BIOS_F BIT0
+#define EFI_ACPI_1_0_S4BIOS_F (1 << 0)
///
/// Multiple APIC Description Table header definition. The rest of the table
@@ -253,7 +257,7 @@ typedef struct {
/// Multiple APIC Flags
/// All other bits are reserved and must be set to 0.
///
-#define EFI_ACPI_1_0_PCAT_COMPAT BIT0
+#define EFI_ACPI_1_0_PCAT_COMPAT (1 << 0)
//
// Multiple APIC Description Table APIC structure types
@@ -284,7 +288,7 @@ typedef struct {
///
/// Local APIC Flags. All other bits are reserved and must be 0.
///
-#define EFI_ACPI_1_0_LOCAL_APIC_ENABLED BIT0
+#define EFI_ACPI_1_0_LOCAL_APIC_ENABLED (1 << 0)
///
/// IO APIC Structure
@@ -320,11 +324,6 @@ typedef struct {
UINT32 GlobalSystemInterruptVector;
} EFI_ACPI_1_0_NON_MASKABLE_INTERRUPT_SOURCE_STRUCTURE;
-//
-// Ensure proper structure formats
-//
-#pragma pack(1)
-
///
/// Local APIC NMI Structure
///
@@ -336,8 +335,6 @@ typedef struct {
UINT8 LocalApicInti;
} EFI_ACPI_1_0_LOCAL_APIC_NMI_STRUCTURE;
-#pragma pack()
-
///
/// Smart Battery Description Table (SBST)
///
@@ -397,4 +394,6 @@ typedef struct {
///
#define EFI_ACPI_1_0_SECONDARY_SYSTEM_DESCRIPTION_TABLE_SIGNATURE SIGNATURE_32('S', 'S', 'D', 'T')
+#pragma pack()
+
#endif
diff --git a/MdePkg/Include/IndustryStandard/Acpi20.h b/MdePkg/Include/IndustryStandard/Acpi20.h
index 4476bf9f22..9c1db57a42 100644
--- a/MdePkg/Include/IndustryStandard/Acpi20.h
+++ b/MdePkg/Include/IndustryStandard/Acpi20.h
@@ -32,8 +32,6 @@ typedef struct {
UINT64 Address;
} EFI_ACPI_2_0_GENERIC_ADDRESS_STRUCTURE;
-#pragma pack()
-
//
// Generic Address Space Address IDs
//
@@ -99,10 +97,6 @@ typedef struct {
///
#define EFI_ACPI_2_0_EXTENDED_SYSTEM_DESCRIPTION_TABLE_REVISION 0x01
-//
-// Ensure proper structure formats
-//
-#pragma pack(1)
///
/// Fixed ACPI Description Table Structure (FADT)
///
@@ -160,38 +154,37 @@ typedef struct {
EFI_ACPI_2_0_GENERIC_ADDRESS_STRUCTURE XGpe0Blk;
EFI_ACPI_2_0_GENERIC_ADDRESS_STRUCTURE XGpe1Blk;
} EFI_ACPI_2_0_FIXED_ACPI_DESCRIPTION_TABLE;
-#pragma pack()
///
/// FADT Version (as defined in ACPI 2.0 spec.)
///
#define EFI_ACPI_2_0_FIXED_ACPI_DESCRIPTION_TABLE_REVISION 0x03
-//
-// Fixed ACPI Description Table Boot Architecture Flags
-// All other bits are reserved and must be set to 0.
-//
-#define EFI_ACPI_2_0_LEGACY_DEVICES BIT0
-#define EFI_ACPI_2_0_8042 BIT1
+///
+/// Fixed ACPI Description Table Boot Architecture Flags
+/// All other bits are reserved and must be set to 0.
+///
+#define EFI_ACPI_2_0_LEGACY_DEVICES (1 << 0)
+#define EFI_ACPI_2_0_8042 (1 << 1)
//
// Fixed ACPI Description Table Fixed Feature Flags
// All other bits are reserved and must be set to 0.
//
-#define EFI_ACPI_2_0_WBINVD BIT0
-#define EFI_ACPI_2_0_WBINVD_FLUSH BIT1
-#define EFI_ACPI_2_0_PROC_C1 BIT2
-#define EFI_ACPI_2_0_P_LVL2_UP BIT3
-#define EFI_ACPI_2_0_PWR_BUTTON BIT4
-#define EFI_ACPI_2_0_SLP_BUTTON BIT5
-#define EFI_ACPI_2_0_FIX_RTC BIT6
-#define EFI_ACPI_2_0_RTC_S4 BIT7
-#define EFI_ACPI_2_0_TMR_VAL_EXT BIT8
-#define EFI_ACPI_2_0_DCK_CAP BIT9
-#define EFI_ACPI_2_0_RESET_REG_SUP BIT10
-#define EFI_ACPI_2_0_SEALED_CASE BIT11
-#define EFI_ACPI_2_0_HEADLESS BIT12
-#define EFI_ACPI_2_0_CPU_SW_SLP BIT13
+#define EFI_ACPI_2_0_WBINVD (1 << 0)
+#define EFI_ACPI_2_0_WBINVD_FLUSH (1 << 1)
+#define EFI_ACPI_2_0_PROC_C1 (1 << 2)
+#define EFI_ACPI_2_0_P_LVL2_UP (1 << 3)
+#define EFI_ACPI_2_0_PWR_BUTTON (1 << 4)
+#define EFI_ACPI_2_0_SLP_BUTTON (1 << 5)
+#define EFI_ACPI_2_0_FIX_RTC (1 << 6)
+#define EFI_ACPI_2_0_RTC_S4 (1 << 7)
+#define EFI_ACPI_2_0_TMR_VAL_EXT (1 << 8)
+#define EFI_ACPI_2_0_DCK_CAP (1 << 9)
+#define EFI_ACPI_2_0_RESET_REG_SUP (1 << 10)
+#define EFI_ACPI_2_0_SEALED_CASE (1 << 11)
+#define EFI_ACPI_2_0_HEADLESS (1 << 12)
+#define EFI_ACPI_2_0_CPU_SW_SLP (1 << 13)
///
/// Firmware ACPI Control Structure
@@ -217,7 +210,7 @@ typedef struct {
/// Firmware Control Structure Feature Flags
/// All other bits are reserved and must be set to 0.
///
-#define EFI_ACPI_2_0_S4BIOS_F BIT0
+#define EFI_ACPI_2_0_S4BIOS_F (1 << 0)
///
/// Multiple APIC Description Table header definition. The rest of the table
@@ -238,7 +231,7 @@ typedef struct {
/// Multiple APIC Flags
/// All other bits are reserved and must be set to 0.
///
-#define EFI_ACPI_2_0_PCAT_COMPAT BIT0
+#define EFI_ACPI_2_0_PCAT_COMPAT (1 << 0)
//
// Multiple APIC Description Table APIC structure types
@@ -273,7 +266,7 @@ typedef struct {
///
/// Local APIC Flags. All other bits are reserved and must be 0.
///
-#define EFI_ACPI_2_0_LOCAL_APIC_ENABLED BIT0
+#define EFI_ACPI_2_0_LOCAL_APIC_ENABLED (1 << 0)
///
/// IO APIC Structure
@@ -309,11 +302,6 @@ typedef struct {
UINT32 GlobalSystemInterrupt;
} EFI_ACPI_2_0_NON_MASKABLE_INTERRUPT_SOURCE_STRUCTURE;
-//
-// Ensure proper structure formats
-//
-#pragma pack(1)
-
///
/// Local APIC NMI Structure
///
@@ -335,8 +323,6 @@ typedef struct {
UINT64 LocalApicAddress;
} EFI_ACPI_2_0_LOCAL_APIC_ADDRESS_OVERRIDE_STRUCTURE;
-#pragma pack()
-
///
/// IO SAPIC Structure
///
@@ -517,4 +503,6 @@ typedef struct {
///
#define EFI_ACPI_2_0_MEMORY_MAPPED_CONFIGURATION_BASE_ADDRESS_TABLE_SIGNATURE SIGNATURE_32('M', 'C', 'F', 'G')
+#pragma pack()
+
#endif
diff --git a/MdePkg/Include/IndustryStandard/Acpi30.h b/MdePkg/Include/IndustryStandard/Acpi30.h
index 207f060bee..75b5f8eba8 100644
--- a/MdePkg/Include/IndustryStandard/Acpi30.h
+++ b/MdePkg/Include/IndustryStandard/Acpi30.h
@@ -1,5 +1,5 @@
/** @file
- ACPI 3.0 definitions from the ACPI Specification Revision 3.0b October 10, 2006.
+ ACPI 3.0 definitions from the ACPI Specification Revision 3.0b October 10, 2006
Copyright (c) 2006 - 2008, Intel Corporation
All rights reserved. This program and the accompanying materials
@@ -31,8 +31,6 @@ typedef struct {
UINT8 AccessSize;
UINT64 Address;
} EFI_ACPI_3_0_GENERIC_ADDRESS_STRUCTURE;
-
-#pragma pack()
//
// Generic Address Space Address IDs
@@ -108,10 +106,6 @@ typedef struct {
///
#define EFI_ACPI_3_0_EXTENDED_SYSTEM_DESCRIPTION_TABLE_REVISION 0x01
-//
-// Ensure proper structure formats
-//
-#pragma pack(1)
///
/// Fixed ACPI Description Table Structure (FADT)
///
@@ -169,7 +163,6 @@ typedef struct {
EFI_ACPI_3_0_GENERIC_ADDRESS_STRUCTURE XGpe0Blk;
EFI_ACPI_3_0_GENERIC_ADDRESS_STRUCTURE XGpe1Blk;
} EFI_ACPI_3_0_FIXED_ACPI_DESCRIPTION_TABLE;
-#pragma pack()
///
/// FADT Version (as defined in ACPI 3.0 spec.)
@@ -192,36 +185,36 @@ typedef struct {
// Fixed ACPI Description Table Boot Architecture Flags
// All other bits are reserved and must be set to 0.
//
-#define EFI_ACPI_3_0_LEGACY_DEVICES BIT0
-#define EFI_ACPI_3_0_8042 BIT1
-#define EFI_ACPI_3_0_VGA_NOT_PRESENT BIT2
-#define EFI_ACPI_3_0_MSI_NOT_SUPPORTED BIT3
-#define EFI_ACPI_3_0_PCIE_ASPM_CONTROLS BIT4
+#define EFI_ACPI_3_0_LEGACY_DEVICES (1 << 0)
+#define EFI_ACPI_3_0_8042 (1 << 1)
+#define EFI_ACPI_3_0_VGA_NOT_PRESENT (1 << 2)
+#define EFI_ACPI_3_0_MSI_NOT_SUPPORTED (1 << 3)
+#define EFI_ACPI_3_0_PCIE_ASPM_CONTROLS (1 << 4)
//
// Fixed ACPI Description Table Fixed Feature Flags
// All other bits are reserved and must be set to 0.
//
-#define EFI_ACPI_3_0_WBINVD BIT0
-#define EFI_ACPI_3_0_WBINVD_FLUSH BIT1
-#define EFI_ACPI_3_0_PROC_C1 BIT2
-#define EFI_ACPI_3_0_P_LVL2_UP BIT3
-#define EFI_ACPI_3_0_PWR_BUTTON BIT4
-#define EFI_ACPI_3_0_SLP_BUTTON BIT5
-#define EFI_ACPI_3_0_FIX_RTC BIT6
-#define EFI_ACPI_3_0_RTC_S4 BIT7
-#define EFI_ACPI_3_0_TMR_VAL_EXT BIT8
-#define EFI_ACPI_3_0_DCK_CAP BIT9
-#define EFI_ACPI_3_0_RESET_REG_SUP BIT10
-#define EFI_ACPI_3_0_SEALED_CASE BIT11
-#define EFI_ACPI_3_0_HEADLESS BIT12
-#define EFI_ACPI_3_0_CPU_SW_SLP BIT13
-#define EFI_ACPI_3_0_PCI_EXP_WAK BIT14
-#define EFI_ACPI_3_0_USE_PLATFORM_CLOCK BIT15
-#define EFI_ACPI_3_0_S4_RTC_STS_VALID BIT16
-#define EFI_ACPI_3_0_REMOTE_POWER_ON_CAPABLE BIT17
-#define EFI_ACPI_3_0_FORCE_APIC_CLUSTER_MODEL BIT18
-#define EFI_ACPI_3_0_FORCE_APIC_PHYSICAL_DESTINATION_MODE BIT19
+#define EFI_ACPI_3_0_WBINVD (1 << 0)
+#define EFI_ACPI_3_0_WBINVD_FLUSH (1 << 1)
+#define EFI_ACPI_3_0_PROC_C1 (1 << 2)
+#define EFI_ACPI_3_0_P_LVL2_UP (1 << 3)
+#define EFI_ACPI_3_0_PWR_BUTTON (1 << 4)
+#define EFI_ACPI_3_0_SLP_BUTTON (1 << 5)
+#define EFI_ACPI_3_0_FIX_RTC (1 << 6)
+#define EFI_ACPI_3_0_RTC_S4 (1 << 7)
+#define EFI_ACPI_3_0_TMR_VAL_EXT (1 << 8)
+#define EFI_ACPI_3_0_DCK_CAP (1 << 9)
+#define EFI_ACPI_3_0_RESET_REG_SUP (1 << 10)
+#define EFI_ACPI_3_0_SEALED_CASE (1 << 11)
+#define EFI_ACPI_3_0_HEADLESS (1 << 12)
+#define EFI_ACPI_3_0_CPU_SW_SLP (1 << 13)
+#define EFI_ACPI_3_0_PCI_EXP_WAK (1 << 14)
+#define EFI_ACPI_3_0_USE_PLATFORM_CLOCK (1 << 15)
+#define EFI_ACPI_3_0_S4_RTC_STS_VALID (1 << 16)
+#define EFI_ACPI_3_0_REMOTE_POWER_ON_CAPABLE (1 << 17)
+#define EFI_ACPI_3_0_FORCE_APIC_CLUSTER_MODEL (1 << 18)
+#define EFI_ACPI_3_0_FORCE_APIC_PHYSICAL_DESTINATION_MODE (1 << 19)
///
/// Firmware ACPI Control Structure
@@ -247,7 +240,7 @@ typedef struct {
/// Firmware Control Structure Feature Flags
/// All other bits are reserved and must be set to 0.
///
-#define EFI_ACPI_3_0_S4BIOS_F BIT0
+#define EFI_ACPI_3_0_S4BIOS_F (1 << 0)
//
// Differentiated System Description Table,
@@ -278,7 +271,7 @@ typedef struct {
/// Multiple APIC Flags
/// All other bits are reserved and must be set to 0.
///
-#define EFI_ACPI_3_0_PCAT_COMPAT BIT0
+#define EFI_ACPI_3_0_PCAT_COMPAT (1 << 0)
//
// Multiple APIC Description Table APIC structure types
@@ -313,7 +306,7 @@ typedef struct {
///
/// Local APIC Flags. All other bits are reserved and must be 0.
///
-#define EFI_ACPI_3_0_LOCAL_APIC_ENABLED BIT0
+#define EFI_ACPI_3_0_LOCAL_APIC_ENABLED (1 << 0)
///
/// IO APIC Structure
@@ -372,11 +365,6 @@ typedef struct {
UINT16 Flags;
UINT32 GlobalSystemInterrupt;
} EFI_ACPI_3_0_NON_MASKABLE_INTERRUPT_SOURCE_STRUCTURE;
-
-//
-// Ensure proper structure formats
-//
-#pragma pack(1)
///
/// Local APIC NMI Structure
@@ -399,8 +387,6 @@ typedef struct {
UINT64 LocalApicAddress;
} EFI_ACPI_3_0_LOCAL_APIC_ADDRESS_OVERRIDE_STRUCTURE;
-#pragma pack()
-
///
/// IO SAPIC Structure
///
@@ -447,7 +433,7 @@ typedef struct {
/// Platform Interrupt Source Flags.
/// All other bits are reserved and must be set to 0.
///
-#define EFI_ACPI_3_0_CPEI_PROCESSOR_OVERRIDE BIT0
+#define EFI_ACPI_3_0_CPEI_PROCESSOR_OVERRIDE (1 << 0)
///
/// Smart Battery Description Table (SBST)
@@ -488,7 +474,7 @@ typedef struct {
///
typedef struct {
EFI_ACPI_DESCRIPTION_HEADER Header;
- UINT32 Reserved1; ///< Must be set to 1
+ UINT32 Reserved1; // Must be set to 1
UINT64 Reserved2;
} EFI_ACPI_3_0_SYSTEM_RESOURCE_AFFINITY_TABLE_HEADER;
@@ -497,11 +483,11 @@ typedef struct {
///
#define EFI_ACPI_3_0_SYSTEM_RESOURCE_AFFINITY_TABLE_REVISION 0x02
-//
-// SRAT structure types.
-// All other values between 0x02 an 0xFF are reserved and
-// will be ignored by OSPM.
-//
+///
+/// SRAT structure types.
+/// All other values between 0x02 an 0xFF are reserved and
+/// will be ignored by OSPM.
+///
#define EFI_ACPI_3_0_PROCESSOR_LOCAL_APIC_SAPIC_AFFINITY 0x00
#define EFI_ACPI_3_0_MEMORY_AFFINITY 0x01
@@ -524,10 +510,6 @@ typedef struct {
///
#define EFI_ACPI_3_0_PROCESSOR_LOCAL_APIC_SAPIC_ENABLED (1 << 0)
-//
-// Ensure proper structure formats
-//
-#pragma pack(1)
///
/// Memory Affinity Structure Definition
///
@@ -545,8 +527,6 @@ typedef struct {
UINT64 Reserved3;
} EFI_ACPI_3_0_MEMORY_AFFINITY_STRUCTURE;
-#pragma pack()
-
//
// Memory Flags. All other bits are reserved and must be 0.
//
@@ -698,4 +678,6 @@ typedef struct {
///
#define EFI_ACPI_3_0_ISCSI_BOOT_FIRMWARE_TABLE_SIGNATURE SIGNATURE_32('i', 'B', 'F', 'T')
+#pragma pack()
+
#endif
diff --git a/MdePkg/Include/IndustryStandard/AlertStandardFormatTable.h b/MdePkg/Include/IndustryStandard/AlertStandardFormatTable.h
index 13a0b90768..ef2462e654 100644
--- a/MdePkg/Include/IndustryStandard/AlertStandardFormatTable.h
+++ b/MdePkg/Include/IndustryStandard/AlertStandardFormatTable.h
@@ -16,6 +16,11 @@
#include <IndustryStandard/Acpi.h>
+//
+// Ensure proper structure formats
+//
+#pragma pack (1)
+
///
/// Information Record header that appears at the beginning of each record
///
@@ -136,4 +141,6 @@ typedef EFI_ACPI_DESCRIPTION_HEADER EFI_ACPI_ASF_DESCRIPTION_HEADER;
///
#define EFI_ACPI_ASF_DESCRIPTION_TABLE_SIGNATURE SIGNATURE_32 ('A', 'S', 'F', '!')
-#endif
+#pragma pack ()
+
+#endif // _ALERT_STANDARD_FORMAT_TABLE_H
diff --git a/MdePkg/Include/IndustryStandard/Atapi.h b/MdePkg/Include/IndustryStandard/Atapi.h
index 3986366c02..0f34d8dfc4 100644
--- a/MdePkg/Include/IndustryStandard/Atapi.h
+++ b/MdePkg/Include/IndustryStandard/Atapi.h
@@ -16,6 +16,8 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#ifndef _ATAPI_H_
#define _ATAPI_H_
+#pragma pack(1)
+
///
/// ATAPI_IDENTIFY_DATA is defined in ATA-6
///
@@ -139,9 +141,9 @@ typedef struct {
UINT8 additional_sense_bytes_18_253[253 - 18 + 1];
} ATAPI_REQUEST_SENSE_DATA;
-//
-// The followings are defined in SFF-8070i(ATAPI Removable Rewritable Specification)
-//
+///
+/// The followings are defined in SFF-8070i(ATAPI Removable Rewritable Specification)
+///
///
/// READ CAPACITY Data
@@ -304,6 +306,8 @@ typedef union {
ATAPI_READ_FORMAT_CAP_CMD ReadFormatCapacity;
} ATAPI_PACKET_COMMAND;
+#pragma pack()
+
#define ATAPI_MAX_DMA_EXT_CMD_SECTORS 0x10000
#define ATAPI_MAX_DMA_CMD_SECTORS 0x100
@@ -338,6 +342,7 @@ typedef union {
#define ATA_CMD_READ_LONG_WITH_RETRY 0x23 ///< defined in ATA-5
#define ATA_CMD_READ_SECTORS_EXT 0x24 ///< defined in ATA-6
+
//
// Class 2: PIO Data-Out Commands
//
@@ -386,6 +391,7 @@ typedef union {
#define ATA_SMART_ENABLE_OPERATION 0xd8
#define ATA_SMART_RETURN_STATUS 0xda
+
///
/// Class 4: DMA Command
///
@@ -395,7 +401,9 @@ typedef union {
#define ATA_CMD_WRITE_DMA 0xca ///< defined in ATA-6
#define ATA_CMD_WRITE_DMA_WITH_RETRY 0xcb ///< defined in ATA-4
#define ATA_CMD_WRITE_DMA_EXT 0x35 ///< defined in ATA-6
-
+
+
+
///
/// default content of device control register, disable INT,
/// Bit3 is set to 1 according ATA-1
@@ -411,12 +419,12 @@ typedef union {
#define ATA_REQUEST_SENSE_ERROR (0x70) ///< defined in SFF-8070i
-//
-// Sense Key, Additional Sense Codes and Additional Sense Code Qualifier
-// defined in MultiMedia Commands (MMC, MMC-2)
-//
-// Sense Key
-//
+///
+/// Sense Key, Additional Sense Codes and Additional Sense Code Qualifier
+/// defined in MultiMedia Commands (MMC, MMC-2)
+///
+/// Sense Key
+///
#define ATA_SK_NO_SENSE (0x0)
#define ATA_SK_RECOVERY_ERROR (0x1)
#define ATA_SK_NOT_READY (0x2)
@@ -434,9 +442,9 @@ typedef union {
#define ATA_SK_MISCOMPARE (0xE)
#define ATA_SK_RESERVED_F (0xF)
-//
-// Additional Sense Codes
-//
+///
+/// Additional Sense Codes
+///
#define ATA_ASC_NOT_READY (0x04)
#define ATA_ASC_MEDIA_ERR1 (0x10)
#define ATA_ASC_MEDIA_ERR2 (0x11)
@@ -458,9 +466,9 @@ typedef union {
//
#define ATA_ASCQ_IN_PROGRESS (0x01)
-//
-// Error Register
-//
+///
+/// Error Register
+///
#define ATA_ERRREG_BBK BIT7 ///< Bad block detected defined in ATA-1
#define ATA_ERRREG_UNC BIT6 ///< Uncorrectable Data defined in ATA-3
#define ATA_ERRREG_MC BIT5 ///< Media Change defined in ATA-3
@@ -470,9 +478,9 @@ typedef union {
#define ATA_ERRREG_TK0NF BIT1 ///< Track 0 Not Found defined in ATA-3
#define ATA_ERRREG_AMNF BIT0 ///< Address Mark Not Found defined in ATA-3
-//
-// Status Register
-//
+///
+/// Status Register
+///
#define ATA_STSREG_BSY BIT7 ///< Controller Busy defined in ATA-6
#define ATA_STSREG_DRDY BIT6 ///< Drive Ready defined in ATA-6
#define ATA_STSREG_DWF BIT5 ///< Drive Write Fault defined in ATA-6
@@ -482,9 +490,9 @@ typedef union {
#define ATA_STSREG_IDX BIT1 ///< Index defined in ATA-3
#define ATA_STSREG_ERR BIT0 ///< Error defined in ATA-6
-//
-// Device Control Register
-//
+///
+/// Device Control Register
+///
#define ATA_CTLREG_SRST BIT2 ///< Software Reset
#define ATA_CTLREG_IEN_L BIT1 ///< Interrupt Enable #
diff --git a/MdePkg/Include/IndustryStandard/ElTorito.h b/MdePkg/Include/IndustryStandard/ElTorito.h
index 4933dd786f..12375015ef 100644
--- a/MdePkg/Include/IndustryStandard/ElTorito.h
+++ b/MdePkg/Include/IndustryStandard/ElTorito.h
@@ -19,9 +19,9 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#ifndef _ELTORITO_H_
#define _ELTORITO_H_
-//
-// CDROM_VOLUME_DESCRIPTOR.Types, defined in ISO 9660
-//
+///
+/// CDROM_VOLUME_DESCRIPTOR.Types, defined in ISO 9660
+///
#define CDVOL_TYPE_STANDARD 0x0
#define CDVOL_TYPE_CODED 0x1
#define CDVOL_TYPE_END 0xFF
@@ -55,6 +55,8 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#define ELTORITO_HARD_DISK 0x04
+#pragma pack(1)
+
///
/// CD-ROM Volume Descriptor
///
@@ -134,4 +136,6 @@ typedef union {
} ELTORITO_CATALOG;
+#pragma pack()
+
#endif
diff --git a/MdePkg/Include/IndustryStandard/HighPrecisionEventTimerTable.h b/MdePkg/Include/IndustryStandard/HighPrecisionEventTimerTable.h
index bb6c25740e..ef1fe149cf 100644
--- a/MdePkg/Include/IndustryStandard/HighPrecisionEventTimerTable.h
+++ b/MdePkg/Include/IndustryStandard/HighPrecisionEventTimerTable.h
@@ -34,8 +34,6 @@ typedef struct {
UINT8 PageProtectionAndOemAttribute;
} EFI_ACPI_HIGH_PRECISION_EVENT_TIMER_TABLE_HEADER;
-#pragma pack()
-
///
/// HPET Revision (defined in spec)
///
@@ -49,4 +47,6 @@ typedef struct {
#define EFI_ACPI_4KB_PAGE_PROTECTION 1
#define EFI_ACPI_64KB_PAGE_PROTECTION 2
+#pragma pack()
+
#endif
diff --git a/MdePkg/Include/IndustryStandard/IScsiBootFirmwareTable.h b/MdePkg/Include/IndustryStandard/IScsiBootFirmwareTable.h
index cf3c4326fe..7fc7ac6377 100644
--- a/MdePkg/Include/IndustryStandard/IScsiBootFirmwareTable.h
+++ b/MdePkg/Include/IndustryStandard/IScsiBootFirmwareTable.h
@@ -1,6 +1,6 @@
/** @file
- The definition for iSCSI Boot Firmware Table, it's defined in Microsoft's
- iSCSI Boot Firmware Table(iBFT) as Defined in ACPI 3.0b Specification.
+ The definition for iSCSI Boot Firmware Table, it's defined in
+ Microsoft iBFT document.
Copyright (c) 2006 - 2008, Intel Corporation
All rights reserved. This program and the accompanying materials
@@ -46,6 +46,8 @@ typedef enum {
IpPrefixOriginUnchanged = 16
} IP_PREFIX_VALUE;
+#pragma pack(1)
+
///
/// iBF Table Header
///
@@ -83,9 +85,8 @@ typedef struct {
UINT16 Target1Offset;
} EFI_ACPI_ISCSI_BOOT_FIRMWARE_TABLE_CONTROL_STRUCTURE;
-#define EFI_ACPI_ISCSI_BOOT_FIRMWARE_TABLE_CONTROL_STRUCTURE_VERSION 0x1
-
-#define EFI_ACPI_ISCSI_BOOT_FIRMWARE_TABLE_CONTROL_STRUCTURE_FLAG_BOOT_FAILOVER BIT0
+#define EFI_ACPI_ISCSI_BOOT_FIRMWARE_TABLE_CONTROL_STRUCTURE_VERSION 0x1
+#define EFI_ACPI_ISCSI_BOOT_FIRMWARE_TABLE_CONTROL_STRUCTURE_FLAG_BOOT_FAILOVER 0x1
///
/// Initiator Structure
@@ -100,10 +101,9 @@ typedef struct {
UINT16 IScsiNameOffset;
} EFI_ACPI_ISCSI_BOOT_FIRMWARE_TABLE_INITIATOR_STRUCTURE;
-#define EFI_ACPI_ISCSI_BOOT_FIRMWARE_TABLE_INITIATOR_STRUCTURE_VERSION 0x1
-
-#define EFI_ACPI_ISCSI_BOOT_FIRMWARE_TABLE_INITIATOR_STRUCTURE_FLAG_BLOCK_VALID BIT0
-#define EFI_ACPI_ISCSI_BOOT_FIRMWARE_TABLE_INITIATOR_STRUCTURE_FLAG_BOOT_SELECTED BIT1
+#define EFI_ACPI_ISCSI_BOOT_FIRMWARE_TABLE_INITIATOR_STRUCTURE_VERSION 0x1
+#define EFI_ACPI_ISCSI_BOOT_FIRMWARE_TABLE_INITIATOR_STRUCTURE_FLAG_BLOCK_VALID 0x1
+#define EFI_ACPI_ISCSI_BOOT_FIRMWARE_TABLE_INITIATOR_STRUCTURE_FLAG_BOOT_SELECTED 0x2
///
/// NIC Structure
@@ -124,11 +124,10 @@ typedef struct {
UINT16 HostNameOffset;
} EFI_ACPI_ISCSI_BOOT_FIRMWARE_TABLE_NIC_STRUCTURE;
-#define EFI_ACPI_ISCSI_BOOT_FIRMWARE_TABLE_NIC_STRUCTURE_VERSION 0x1
-
-#define EFI_ACPI_ISCSI_BOOT_FIRMWARE_TABLE_NIC_STRUCTURE_FLAG_BLOCK_VALID BIT0
-#define EFI_ACPI_ISCSI_BOOT_FIRMWARE_TABLE_NIC_STRUCTURE_FLAG_BOOT_SELECTED BIT1
-#define EFI_ACPI_ISCSI_BOOT_FIRMWARE_TABLE_NIC_STRUCTURE_FLAG_GLOBAL BIT2
+#define EFI_ACPI_ISCSI_BOOT_FIRMWARE_TABLE_NIC_STRUCTURE_VERSION 0x1
+#define EFI_ACPI_ISCSI_BOOT_FIRMWARE_TABLE_NIC_STRUCTURE_FLAG_BLOCK_VALID 0x1
+#define EFI_ACPI_ISCSI_BOOT_FIRMWARE_TABLE_NIC_STRUCTURE_FLAG_BOOT_SELECTED 0x2
+#define EFI_ACPI_ISCSI_BOOT_FIRMWARE_TABLE_NIC_STRUCTURE_FLAG_GLOBAL 0x4
///
/// Target Structure
@@ -152,12 +151,13 @@ typedef struct {
UINT16 ReverseCHAPSecretOffset;
} EFI_ACPI_ISCSI_BOOT_FIRMWARE_TABLE_TARGET_STRUCTURE;
-#define EFI_ACPI_ISCSI_BOOT_FIRMWARE_TABLE_TARGET_STRUCTURE_VERSION 0x1
+#define EFI_ACPI_ISCSI_BOOT_FIRMWARE_TABLE_TARGET_STRUCTURE_VERSION 0x1
+#define EFI_ACPI_ISCSI_BOOT_FIRMWARE_TABLE_TARGET_STRUCTURE_FLAG_BLOCK_VALID 0x1
+#define EFI_ACPI_ISCSI_BOOT_FIRMWARE_TABLE_TARGET_STRUCTURE_FLAG_BOOT_SELECTED 0x2
+#define EFI_ACPI_ISCSI_BOOT_FIRMWARE_TABLE_TARGET_STRUCTURE_FLAG_RADIUS_CHAP 0x4
+#define EFI_ACPI_ISCSI_BOOT_FIRMWARE_TABLE_TARGET_STRUCTURE_FLAG_RADIUS_RCHAP 0x8
-#define EFI_ACPI_ISCSI_BOOT_FIRMWARE_TABLE_TARGET_STRUCTURE_FLAG_BLOCK_VALID BIT0
-#define EFI_ACPI_ISCSI_BOOT_FIRMWARE_TABLE_TARGET_STRUCTURE_FLAG_BOOT_SELECTED BIT1
-#define EFI_ACPI_ISCSI_BOOT_FIRMWARE_TABLE_TARGET_STRUCTURE_FLAG_RADIUS_CHAP BIT2
-#define EFI_ACPI_ISCSI_BOOT_FIRMWARE_TABLE_TARGET_STRUCTURE_FLAG_RADIUS_RCHAP BIT3
+#pragma pack()
#endif
diff --git a/MdePkg/Include/IndustryStandard/Mbr.h b/MdePkg/Include/IndustryStandard/Mbr.h
index 39120c7a21..8dd9d59f26 100644
--- a/MdePkg/Include/IndustryStandard/Mbr.h
+++ b/MdePkg/Include/IndustryStandard/Mbr.h
@@ -27,9 +27,10 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#define MBR_SIZE 512
-///
-/// MBR Partition Entry
-///
+#pragma pack(1)
+//
+// MBR Partition Entry
+//
typedef struct {
UINT8 BootIndicator;
UINT8 StartHead;
@@ -54,4 +55,6 @@ typedef struct {
UINT16 Signature;
} MASTER_BOOT_RECORD;
+#pragma pack()
+
#endif
diff --git a/MdePkg/Include/IndustryStandard/MemoryMappedConfigurationSpaceAccessTable.h b/MdePkg/Include/IndustryStandard/MemoryMappedConfigurationSpaceAccessTable.h
index fe4adb7c8c..515a7b3001 100644
--- a/MdePkg/Include/IndustryStandard/MemoryMappedConfigurationSpaceAccessTable.h
+++ b/MdePkg/Include/IndustryStandard/MemoryMappedConfigurationSpaceAccessTable.h
@@ -16,6 +16,11 @@
#ifndef _MEMORY_MAPPED_CONFIGURATION_SPACE_ACCESS_TABLE_H_
#define _MEMORY_MAPPED_CONFIGURATION_SPACE_ACCESS_TABLE_H_
+//
+// Ensure proper structure formats
+//
+#pragma pack(1)
+
///
/// Memory Mapped Configuration Space Access Table (MCFG)
/// This table is a basic description table header followed by
@@ -43,4 +48,6 @@ typedef struct {
///
#define EFI_ACPI_MEMORY_MAPPED_CONFIGURATION_SPACE_ACCESS_TABLE_REVISION 0x01
+#pragma pack()
+
#endif
diff --git a/MdePkg/Include/IndustryStandard/Pci22.h b/MdePkg/Include/IndustryStandard/Pci22.h
index 88f39fbae7..d88b28f825 100644
--- a/MdePkg/Include/IndustryStandard/Pci22.h
+++ b/MdePkg/Include/IndustryStandard/Pci22.h
@@ -26,6 +26,7 @@
#define PCI_MAX_FUNC 7
+#pragma pack(1)
typedef struct {
UINT16 VendorId;
UINT16 DeviceId;
@@ -122,9 +123,9 @@ typedef struct {
UINT16 BridgeControl; ///< Bridge Control
} PCI_CARDBUS_CONTROL_REGISTER;
-//
-// Definitions of PCI class bytes and manipulation macros.
-//
+///
+/// Definitions of PCI class bytes and manipulation macros.
+///
#define PCI_CLASS_OLD 0x00
#define PCI_CLASS_OLD_OTHER 0x00
#define PCI_CLASS_OLD_VGA 0x01
@@ -349,9 +350,9 @@ typedef struct {
#define PCI_MAXGNT_OFFSET 0x3E ///< Max Grant Register
#define PCI_MAXLAT_OFFSET 0x3F ///< Max Latency Register
-//
-// defined in PCI-to-PCI Bridge Architecture Specification
-//
+///
+/// defined in PCI-to-PCI Bridge Architecture Specification
+///
#define PCI_BRIDGE_PRIMARY_BUS_REGISTER_OFFSET 0x18
#define PCI_BRIDGE_SECONDARY_BUS_REGISTER_OFFSET 0x19
#define PCI_BRIDGE_SUBORDINATE_BUS_REGISTER_OFFSET 0x1a
@@ -375,6 +376,8 @@ typedef union {
UINT32 Uint32;
} PCI_CONFIG_ACCESS_CF8;
+#pragma pack()
+
#define EFI_PCI_COMMAND_IO_SPACE BIT0 ///< 0x0001
#define EFI_PCI_COMMAND_MEMORY_SPACE BIT1 ///< 0x0002
#define EFI_PCI_COMMAND_BUS_MASTER BIT2 ///< 0x0004
@@ -386,9 +389,9 @@ typedef union {
#define EFI_PCI_COMMAND_SERR BIT8 ///< 0x0100
#define EFI_PCI_COMMAND_FAST_BACK_TO_BACK BIT9 ///< 0x0200
-//
-// defined in PCI-to-PCI Bridge Architecture Specification
-//
+///
+/// defined in PCI-to-PCI Bridge Architecture Specification
+///
#define EFI_PCI_BRIDGE_CONTROL_PARITY_ERROR_RESPONSE BIT0 ///< 0x0001
#define EFI_PCI_BRIDGE_CONTROL_SERR BIT1 ///< 0x0002
#define EFI_PCI_BRIDGE_CONTROL_ISA BIT2 ///< 0x0004
@@ -402,9 +405,9 @@ typedef union {
#define EFI_PCI_BRIDGE_CONTROL_TIMER_STATUS BIT10 ///< 0x0400
#define EFI_PCI_BRIDGE_CONTROL_DISCARD_TIMER_SERR BIT11 ///< 0x0800
-//
-// Following are the PCI-CARDBUS bridge control bit, defined in PC Card Standard
-//
+///
+/// Following are the PCI-CARDBUS bridge control bit, defined in PC Card Standard
+///
#define EFI_PCI_BRIDGE_CONTROL_IREQINT_ENABLE BIT7 ///< 0x0080
#define EFI_PCI_BRIDGE_CONTROL_RANGE0_MEMORY_TYPE BIT8 ///< 0x0100
#define EFI_PCI_BRIDGE_CONTROL_RANGE1_MEMORY_TYPE BIT9 ///< 0x0200
@@ -423,6 +426,7 @@ typedef union {
///
#define EFI_PCI_CARDBUS_BRIDGE_CAPABILITY_PTR 0x14
+#pragma pack(1)
//
// PCI Capability List IDs and records
//
@@ -432,7 +436,6 @@ typedef union {
#define EFI_PCI_CAPABILITY_ID_SLOTID 0x04
#define EFI_PCI_CAPABILITY_ID_MSI 0x05
#define EFI_PCI_CAPABILITY_ID_HOTPLUG 0x06
-
typedef struct {
UINT8 CapabilityID;
UINT8 NextItemPtr;
@@ -593,4 +596,6 @@ typedef union {
EFI_LEGACY_EXPANSION_ROM_HEADER *PcAt;
} EFI_PCI_ROM_HEADER;
+#pragma pack()
+
#endif
diff --git a/MdePkg/Include/IndustryStandard/Pci23.h b/MdePkg/Include/IndustryStandard/Pci23.h
index 29d692321e..e1289f75c6 100644
--- a/MdePkg/Include/IndustryStandard/Pci23.h
+++ b/MdePkg/Include/IndustryStandard/Pci23.h
@@ -32,6 +32,7 @@
//
#define EFI_PCI_CAPABILITY_ID_PCIX 0x07
+#pragma pack(1)
///
/// Capability EFI_PCI_CAPABILITY_ID_PCIX, defined in PCI-X Addendum to the PCI Local Bus Specification
///
@@ -52,6 +53,8 @@ typedef struct {
UINT32 SplitTransCtrlRegDn;
} EFI_PCI_CAPABILITY_PCIX_BRDG;
+#pragma pack()
+
#define PCI_CODE_TYPE_EFI_IMAGE 0x03
#endif
diff --git a/MdePkg/Include/IndustryStandard/Pci30.h b/MdePkg/Include/IndustryStandard/Pci30.h
index 04bded621c..3bcf2327f1 100644
--- a/MdePkg/Include/IndustryStandard/Pci30.h
+++ b/MdePkg/Include/IndustryStandard/Pci30.h
@@ -30,6 +30,8 @@
///
#define EFI_PCI_CAPABILITY_ID_PCIEXP 0x10
+#pragma pack(1)
+
///
/// defined in PCI Firmware Specification
///
@@ -50,4 +52,6 @@ typedef struct {
UINT16 DMTFCLPEntryPointOffset;
} PCI_3_0_DATA_STRUCTURE;
+#pragma pack()
+
#endif
diff --git a/MdePkg/Include/IndustryStandard/Sal.h b/MdePkg/Include/IndustryStandard/Sal.h
index 37e7dbe71b..b792df6f6e 100644
--- a/MdePkg/Include/IndustryStandard/Sal.h
+++ b/MdePkg/Include/IndustryStandard/Sal.h
@@ -341,6 +341,7 @@ typedef struct _SAL_UPDATE_PAL_INFO_BLOCK {
///
/// SAL System Table Definitions
///
+#pragma pack(1)
typedef struct {
///
/// The ASCII string representation of "SST_" which confirms the presence of the table.
@@ -391,6 +392,7 @@ typedef struct {
///
UINT8 Reserved2[8];
} SAL_SYSTEM_TABLE_HEADER;
+#pragma pack()
#define EFI_SAL_ST_HEADER_SIGNATURE "SST_"
#define EFI_SAL_REVISION 0x0320
@@ -414,6 +416,7 @@ typedef struct {
#define EFI_SAL_ST_PTC_SIZE 16
#define EFI_SAL_ST_AP_WAKEUP_SIZE 16
+#pragma pack(1)
///
/// Format Entrypoint Descriptor Entry
///
@@ -426,6 +429,7 @@ typedef struct {
UINT64 Reserved2[2];
} SAL_ST_ENTRY_POINT_DESCRIPTOR;
+#pragma pack(1)
///
/// Format Platform Features Descriptor Entry
///
@@ -434,7 +438,7 @@ typedef struct {
UINT8 PlatformFeatures;
UINT8 Reserved[14];
} SAL_ST_PLATFORM_FEATURES;
-
+#pragma pack()
//
// Value of Platform Feature List
//
@@ -442,6 +446,7 @@ typedef struct {
#define SAL_PLAT_FEAT_PLAT_IPI_HINT 0x02
#define SAL_PLAT_FEAT_PROC_IPI_HINT 0x04
+#pragma pack(1)
///
/// Format of Translation Register Descriptor Entry
///
@@ -454,13 +459,14 @@ typedef struct {
UINT64 EncodedPageSize;
UINT64 Reserved1;
} SAL_ST_TR_DECRIPTOR;
-
+#pragma pack()
//
// Type of Translation Register
//
#define EFI_SAL_ST_TR_USAGE_INSTRUCTION 00
#define EFI_SAL_ST_TR_USAGE_DATA 01
+#pragma pack(1)
///
/// Definition of Coherence Domain Information
///
@@ -468,7 +474,9 @@ typedef struct {
UINT64 NumberOfProcessors;
UINT64 LocalIDRegister;
} SAL_COHERENCE_DOMAIN_INFO;
+#pragma pack()
+#pragma pack(1)
///
/// Format of Purge Translation Cache Coherence Domain Entry
///
@@ -478,7 +486,9 @@ typedef struct {
UINT32 NumberOfDomains;
SAL_COHERENCE_DOMAIN_INFO *DomainInformation;
} SAL_ST_CACHE_COHERENCE_DECRIPTOR;
+#pragma pack()
+#pragma pack(1)
///
/// Format of Application Processor Wake-Up Descriptor Entry
///
@@ -488,6 +498,7 @@ typedef struct {
UINT8 Reserved[6];
UINT64 ExternalInterruptVector;
} SAL_ST_AP_WAKEUP_DECRIPTOR;
+#pragma pack()
///
/// Format of Firmware Interface Table (FIT) Entry
@@ -637,9 +648,6 @@ typedef struct {
#define PROC_CR_LID_VALID_BIT_MASK 0x4
#define PROC_STATIC_STRUCT_VALID_BIT_MASK 0x8
#define CPU_INFO_VALID_BIT_MASK 0x1000000
-
-#pragma pack(1)
-
///
/// Definition of Processor Machine Check Error Record
///
@@ -658,8 +666,6 @@ typedef struct {
PSI_STATIC_STRUCT PsiValidData;
} SAL_PROCESSOR_ERROR_RECORD;
-#pragma pack()
-
///
/// GUID of Platform Memory Device Error Info
///
@@ -785,7 +791,6 @@ typedef struct {
UINT8 SegmentNumber;
UINT8 Reserved[5];
} PCI_COMP_INFO;
-
///
/// Definition of Platform PCI Component Error Info
///
@@ -819,8 +824,6 @@ typedef struct {
#define SEL_EVENT_DATA1_VALID_BIT_MASK 0x80;
#define SEL_EVENT_DATA2_VALID_BIT_MASK 0x100;
#define SEL_EVENT_DATA3_VALID_BIT_MASK 0x200;
-
-#pragma pack(1)
///
/// Definition of Platform SEL Device Error Info Record
///
@@ -839,7 +842,6 @@ typedef struct {
UINT8 Data2;
UINT8 Data3;
} SAL_SEL_DEVICE_ERROR_RECORD;
-#pragma pack()
///
/// GUID of Platform SMBIOS Device Error Info
@@ -913,4 +915,6 @@ typedef union {
UINT8 *Raw;
} SAL_ERROR_RECORDS_POINTERS;
+#pragma pack()
+
#endif
diff --git a/MdePkg/Include/IndustryStandard/Scsi.h b/MdePkg/Include/IndustryStandard/Scsi.h
index 8b7c3d4855..ccb3590bdf 100644
--- a/MdePkg/Include/IndustryStandard/Scsi.h
+++ b/MdePkg/Include/IndustryStandard/Scsi.h
@@ -191,6 +191,7 @@
//
#define EFI_SCSI_TYPE_UNKNOWN 0x1F ///< Unknown or no device type
+#pragma pack(1)
///
/// Standard INQUIRY data format
///
@@ -236,6 +237,8 @@ typedef struct {
UINT8 BlockSize0;
} EFI_SCSI_DISK_CAPACITY_DATA;
+#pragma pack()
+
//
// Sense Key
//
diff --git a/MdePkg/Include/IndustryStandard/SerialPortConsoleRedirectionTable.h b/MdePkg/Include/IndustryStandard/SerialPortConsoleRedirectionTable.h
index 297e7b31a7..b6f6140ee6 100644
--- a/MdePkg/Include/IndustryStandard/SerialPortConsoleRedirectionTable.h
+++ b/MdePkg/Include/IndustryStandard/SerialPortConsoleRedirectionTable.h
@@ -18,15 +18,16 @@
#include <IndustryStandard/Acpi.h>
+//
+// Ensure proper structure formats
+//
+#pragma pack(1)
+
///
/// SPCR Revision (defined in spec)
///
#define EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_REVISION 0x01
-//
-// Ensure proper structure formats
-//
-#pragma pack(1)
///
/// Serial Port Console Redirection Table Format
///
@@ -53,6 +54,7 @@ typedef struct {
UINT8 PciSegment;
UINT32 Reserved2;
} EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE;
+
#pragma pack()
//
diff --git a/MdePkg/Include/IndustryStandard/SmBios.h b/MdePkg/Include/IndustryStandard/SmBios.h
index 4926e5c8b2..e44e239f6f 100644
--- a/MdePkg/Include/IndustryStandard/SmBios.h
+++ b/MdePkg/Include/IndustryStandard/SmBios.h
@@ -17,6 +17,7 @@
///
/// Smbios Table Entry Point Structure
///
+#pragma pack(1)
typedef struct {
UINT8 AnchorString[4];
UINT8 EntryPointStructureChecksum;
@@ -45,7 +46,6 @@ typedef struct {
typedef UINT8 SMBIOS_TABLE_STRING;
-#pragma pack(1)
///
/// BIOS Information (Type 0)
///
@@ -63,7 +63,6 @@ typedef struct {
UINT8 EmbeddedControllerFirmwareMajorRelease;
UINT8 EmbeddedControllerFirmwareMinorRelease;
} SMBIOS_TABLE_TYPE0;
-#pragma pack()
///
/// System Information (Type 1)
@@ -80,7 +79,6 @@ typedef struct {
SMBIOS_TABLE_STRING Family;
} SMBIOS_TABLE_TYPE1;
-#pragma pack(1)
///
/// Base Board (or Module) Information (Type 2)
///
@@ -98,7 +96,6 @@ typedef struct {
UINT8 NumberOfContainedObjectHandles;
UINT16 ContainedObjectHandles[1];
} SMBIOS_TABLE_TYPE2;
-#pragma pack()
typedef struct {
UINT8 ContainedElementType;
@@ -164,7 +161,6 @@ typedef struct {
UINT16 ProcessorFamily2;
} SMBIOS_TABLE_TYPE4;
-#pragma pack(1)
///
/// Memory Controller Information (Type 5, Obsolete)
///
@@ -212,7 +208,6 @@ typedef struct {
UINT8 SystemCacheType;
UINT8 Associativity;
} SMBIOS_TABLE_TYPE7;
-#pragma pack()
///
/// Port Connector Information (Type 8)
@@ -226,7 +221,6 @@ typedef struct {
UINT8 PortType;
} SMBIOS_TABLE_TYPE8;
-#pragma pack(1)
///
/// System Slots (Type 9)
///
@@ -247,7 +241,6 @@ typedef struct {
UINT8 BusNum;
UINT8 DevFuncNum;
} SMBIOS_TABLE_TYPE9;
-#pragma pack()
typedef struct {
UINT8 DeviceType;
@@ -289,7 +282,6 @@ typedef struct {
SMBIOS_TABLE_STRING CurrentLanguages;
} SMBIOS_TABLE_TYPE13;
-#pragma pack(1)
typedef struct {
UINT8 ItemType;
UINT16 ItemHandle;
@@ -380,7 +372,6 @@ typedef struct {
UINT32 DeviceErrorAddress;
UINT32 ErrorResolution;
} SMBIOS_TABLE_TYPE18;
-#pragma pack()
///
/// Memory Array Mapped Address (Type 19)
@@ -417,7 +408,6 @@ typedef struct {
UINT8 NumberOfButtons;
} SMBIOS_TABLE_TYPE21;
-#pragma pack(1)
///
/// Portable Battery (Type 22)
///
@@ -451,7 +441,6 @@ typedef struct {
UINT16 TimerInterval;
UINT16 Timeout;
} SMBIOS_TABLE_TYPE23;
-#pragma pack()
///
/// Hardware Security (Type 24)
@@ -565,7 +554,6 @@ typedef struct {
UINT8 BootStatus[1];
} SMBIOS_TABLE_TYPE32;
-#pragma pack(1)
///
/// 64-bit Memory Error Information (Type 33)
///
@@ -601,7 +589,6 @@ typedef struct {
UINT16 ComponentHandle;
UINT16 ThresholdHandle;
} SMBIOS_TABLE_TYPE35;
-#pragma pack()
///
/// Management Device Threshold Data (Type 36)
@@ -616,7 +603,6 @@ typedef struct {
UINT16 UpperThresholdNonRecoverable;
} SMBIOS_TABLE_TYPE36;
-#pragma pack(1)
typedef struct {
UINT8 DeviceLoad;
UINT16 DeviceHandle;
@@ -632,7 +618,6 @@ typedef struct {
UINT8 MemoryDeviceCount;
MEMORY_DEVICE MemoryDevice[1];
} SMBIOS_TABLE_TYPE37;
-#pragma pack()
///
/// IPMI Device Information (Type 38)
@@ -668,7 +653,6 @@ typedef struct {
UINT16 InputCurrentProbeHandle;
} SMBIOS_TABLE_TYPE39;
-#pragma pack(1)
typedef struct {
UINT8 EntryLength;
UINT16 ReferencedHandle;
@@ -698,7 +682,6 @@ typedef struct {
UINT8 BusNum;
UINT8 DevFuncNum;
} SMBIOS_TABLE_TYPE41;
-#pragma pack()
///
/// Inactive (Type 126)
@@ -766,4 +749,6 @@ typedef union {
UINT8 *Raw;
} SMBIOS_STRUCTURE_POINTER;
+#pragma pack()
+
#endif
diff --git a/MdePkg/Include/IndustryStandard/Tpm12.h b/MdePkg/Include/IndustryStandard/Tpm12.h
index a0fc4562aa..0c5fac2f97 100644
--- a/MdePkg/Include/IndustryStandard/Tpm12.h
+++ b/MdePkg/Include/IndustryStandard/Tpm12.h
@@ -24,6 +24,7 @@
//
// Structures are all packed on 1-byte alignment
//
+
#pragma pack (1)
//
diff --git a/MdePkg/Include/IndustryStandard/Usb.h b/MdePkg/Include/IndustryStandard/Usb.h
index 5ec270c7a1..ec86d8b794 100644
--- a/MdePkg/Include/IndustryStandard/Usb.h
+++ b/MdePkg/Include/IndustryStandard/Usb.h
@@ -62,6 +62,7 @@
//
// USB standard descriptors and reqeust
//
+#pragma pack(1)
///
/// Format of Setup Data for USB Device Requests
@@ -96,7 +97,6 @@ typedef struct {
UINT8 NumConfigurations;
} USB_DEVICE_DESCRIPTOR;
-#pragma pack(1)
///
/// Standard Configuration Descriptor
/// USB 2.0 spec, Section 9.6.3
@@ -111,7 +111,6 @@ typedef struct {
UINT8 Attributes;
UINT8 MaxPower;
} USB_CONFIG_DESCRIPTOR;
-#pragma pack()
///
/// Standard Interface Descriptor
@@ -129,7 +128,6 @@ typedef struct {
UINT8 Interface;
} USB_INTERFACE_DESCRIPTOR;
-#pragma pack(1)
///
/// Standard Endpoint Descriptor
/// USB 2.0 spec, Section 9.6.6
@@ -142,7 +140,6 @@ typedef struct {
UINT16 MaxPacketSize;
UINT8 Interval;
} USB_ENDPOINT_DESCRIPTOR;
-#pragma pack()
///
/// UNICODE String Descriptor
@@ -154,6 +151,9 @@ typedef struct {
CHAR16 String[1];
} EFI_USB_STRING_DESCRIPTOR;
+#pragma pack()
+
+
typedef enum {
//
// USB request type
@@ -352,6 +352,7 @@ typedef struct hid_descriptor {
UINT8 NumDescriptors;
EFI_USB_HID_CLASS_DESCRIPTOR HidClassDesc[1];
} EFI_USB_HID_DESCRIPTOR;
+
#pragma pack()
#endif
diff --git a/MdePkg/Include/IndustryStandard/WatchdogActionTable.h b/MdePkg/Include/IndustryStandard/WatchdogActionTable.h
index e94061383d..f2026ecd87 100644
--- a/MdePkg/Include/IndustryStandard/WatchdogActionTable.h
+++ b/MdePkg/Include/IndustryStandard/WatchdogActionTable.h
@@ -18,6 +18,10 @@
#include <IndustryStandard/Acpi.h>
+//
+// Ensure proper structure formats
+//
+#pragma pack(1)
///
/// Watchdog Action Table definition.
///
@@ -49,6 +53,8 @@ typedef struct {
UINT32 Mask;
} EFI_ACPI_WATCHDOG_ACTION_1_0_WATCHDOG_ACTION_INSTRUCTION_ENTRY;
+#pragma pack()
+
///
/// WDAT Revision (defined in spec)
///
diff --git a/MdePkg/Include/IndustryStandard/WatchdogResourceTable.h b/MdePkg/Include/IndustryStandard/WatchdogResourceTable.h
index d1dba4f479..90154b3d3e 100644
--- a/MdePkg/Include/IndustryStandard/WatchdogResourceTable.h
+++ b/MdePkg/Include/IndustryStandard/WatchdogResourceTable.h
@@ -17,6 +17,11 @@
#include <IndustryStandard/Acpi.h>
+//
+// Ensure proper structure formats
+//
+#pragma pack(1)
+
///
/// Watchdog Resource Table definition.
///
@@ -34,6 +39,8 @@ typedef struct {
UINT8 Units;
} EFI_ACPI_WATCHDOG_RESOURCE_1_0_TABLE;
+#pragma pack()
+
//
// WDRT Revision (defined in spec)
//