]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdePkg/Include/Pi/PiFirmwareFile.h
Update the structure of EFI_NETWORK_INTERFACE_IDENTIFIER_PROTOCOL, PXE_HW_UNDI, PXE_S...
[mirror_edk2.git] / MdePkg / Include / Pi / PiFirmwareFile.h
index 12e80fdd678252038d29f55a675fa1e3db84a123..3e020b4208b49036b74ec97a55171e7ad7959d93 100644 (file)
@@ -1,17 +1,17 @@
 /** @file\r
   The firmware file related definitions in PI.\r
 \r
-  Copyright (c) 2006 - 2010, Intel Corporation                                                         \r
-  All rights reserved. This program and the accompanying materials                          \r
-  are licensed and made available under the terms and conditions of the BSD License         \r
-  which accompanies this distribution.  The full text of the license may be found at        \r
-  http://opensource.org/licenses/bsd-license.php                                            \r
+Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>\r
+This program and the accompanying materials are licensed and made available under \r
+the terms and conditions of the BSD License that accompanies this distribution.  \r
+The full text of the license may be found at\r
+http://opensource.org/licenses/bsd-license.php.                                            \r
 \r
-  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
-  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.              \r
 \r
   @par Revision Reference:\r
-  PI Version 1.2\r
+  PI Version 1.2.\r
 \r
 **/\r
 \r
@@ -34,8 +34,7 @@ typedef union {
     ///\r
     /// If the FFS_ATTRIB_CHECKSUM (see definition below) bit of the Attributes\r
     /// field is set to one, the IntegrityCheck.Checksum.File field is an 8-bit\r
-    /// checksum of the entire file The State field and the file tail are assumed to be zero\r
-    /// and the checksum is calculated such that the entire file sums to zero.\r
+    /// checksum of the file data.\r
     /// If the FFS_ATTRIB_CHECKSUM bit of the Attributes field is cleared to zero,\r
     /// the IntegrityCheck.Checksum.File field must be initialized with a value of\r
     /// 0xAA. The IntegrityCheck.Checksum.File field is valid any time the\r
@@ -51,7 +50,7 @@ typedef union {
 \r
 ///\r
 /// FFS_FIXED_CHECKSUM is the checksum value used when the\r
-/// FFS_ATTRIB_CHECKSUM attribute bit is clear\r
+/// FFS_ATTRIB_CHECKSUM attribute bit is clear.\r
 ///\r
 #define FFS_FIXED_CHECKSUM  0xAA\r
 \r
@@ -171,23 +170,31 @@ typedef struct {
   EFI_FFS_FILE_STATE        State;\r
   \r
   ///\r
-  /// If FFS_ATTRIB_LARGE_FILE is set in Attributes then ExtendedSize exists and Size must be set to zero.\r
+  /// If FFS_ATTRIB_LARGE_FILE is set in Attributes, then ExtendedSize exists and Size must be set to zero.\r
   /// If FFS_ATTRIB_LARGE_FILE is not set then EFI_FFS_FILE_HEADER is used.\r
   ///\r
-  EFI_FFS_FILE_STATE        ExtendedSize;\r
+  UINT32                    ExtendedSize;\r
 } EFI_FFS_FILE_HEADER2;\r
 \r
+#define IS_FFS_FILE2(FfsFileHeaderPtr) \\r
+    (((((EFI_FFS_FILE_HEADER *) (UINTN) FfsFileHeaderPtr)->Attributes) & FFS_ATTRIB_LARGE_FILE) == FFS_ATTRIB_LARGE_FILE)\r
+\r
+#define FFS_FILE_SIZE(FfsFileHeaderPtr) \\r
+    ((UINT32) (*((UINT32 *) ((EFI_FFS_FILE_HEADER *) (UINTN) FfsFileHeaderPtr)->Size) & 0x00ffffff))\r
+\r
+#define FFS_FILE2_SIZE(FfsFileHeaderPtr) \\r
+    (((EFI_FFS_FILE_HEADER2 *) (UINTN) FfsFileHeaderPtr)->ExtendedSize)\r
+\r
 typedef UINT8 EFI_SECTION_TYPE;\r
 \r
 ///\r
-/// Pseudo type. It is\r
-/// used as a wild card when retrieving sections. The section\r
-/// type EFI_SECTION_ALL matches all section types.\r
+/// Pseudo type. It is used as a wild card when retrieving sections.\r
+///  The section type EFI_SECTION_ALL matches all section types.\r
 ///\r
 #define EFI_SECTION_ALL                   0x00\r
 \r
 ///\r
-/// Encapsulation section Type values\r
+/// Encapsulation section Type values.\r
 ///\r
 #define EFI_SECTION_COMPRESSION           0x01\r
 \r
@@ -196,7 +203,7 @@ typedef UINT8 EFI_SECTION_TYPE;
 #define EFI_SECTION_DISPOSABLE            0x03\r
 \r
 ///\r
-/// Leaf section Type values\r
+/// Leaf section Type values.\r
 ///\r
 #define EFI_SECTION_PE32                  0x10\r
 #define EFI_SECTION_PIC                   0x11\r
@@ -212,7 +219,7 @@ typedef UINT8 EFI_SECTION_TYPE;
 #define EFI_SECTION_SMM_DEPEX             0x1C\r
 \r
 ///\r
-/// Common section header\r
+/// Common section header.\r
 /// \r
 typedef struct {\r
   ///\r
@@ -236,8 +243,8 @@ typedef struct {
   EFI_SECTION_TYPE  Type;\r
   \r
   ///\r
-  /// If Size is 0xFFFFFF then ExtendedSize contains the size of the section. If\r
-  /// Size is not equal to 0xFFFFFF then this field does not exist.  \r
+  /// If Size is 0xFFFFFF, then ExtendedSize contains the size of the section. If\r
+  /// Size is not equal to 0xFFFFFF, then this field does not exist.  \r
   ///\r
   UINT32            ExtendedSize;\r
 } EFI_COMMON_SECTION_HEADER2;\r
@@ -264,7 +271,7 @@ typedef struct {
   ///\r
   EFI_COMMON_SECTION_HEADER   CommonHeader;\r
   ///\r
-  /// UINT32 that indicates the size of the section data after decompression.\r
+  /// The UINT32 that indicates the size of the section data after decompression.\r
   ///\r
   UINT32                      UncompressedLength;\r
   ///\r
@@ -301,19 +308,19 @@ typedef EFI_COMMON_SECTION_HEADER   EFI_DISPOSABLE_SECTION;
 typedef EFI_COMMON_SECTION_HEADER2  EFI_DISPOSABLE_SECTION2;\r
 \r
 ///\r
-/// Leaf section which could be used to determine the dispatch order of DXEs.\r
+/// The leaf section which could be used to determine the dispatch order of DXEs.\r
 /// \r
 typedef EFI_COMMON_SECTION_HEADER   EFI_DXE_DEPEX_SECTION;\r
 typedef EFI_COMMON_SECTION_HEADER2  EFI_DXE_DEPEX_SECTION2;\r
 \r
 ///\r
-/// Leaf section which contains a PI FV.\r
+/// The leaf section which contains a PI FV.\r
 /// \r
 typedef EFI_COMMON_SECTION_HEADER   EFI_FIRMWARE_VOLUME_IMAGE_SECTION;\r
 typedef EFI_COMMON_SECTION_HEADER2  EFI_FIRMWARE_VOLUME_IMAGE_SECTION2;\r
 \r
 ///\r
-/// Leaf section which contains a single GUID.\r
+/// The leaf section which contains a single GUID.\r
 /// \r
 typedef struct {\r
   ///\r
@@ -328,7 +335,7 @@ typedef struct {
 \r
 typedef struct {\r
   ///\r
-  /// Common section header. CommonHeader.Type = EFI_SECTION_FREEFORM_SUBTYPE_GUID.\r
+  /// The common section header. CommonHeader.Type = EFI_SECTION_FREEFORM_SUBTYPE_GUID.\r
   ///\r
   EFI_COMMON_SECTION_HEADER2    CommonHeader;\r
   ///\r
@@ -338,20 +345,20 @@ typedef struct {
 } EFI_FREEFORM_SUBTYPE_GUID_SECTION2;\r
 \r
 ///\r
-/// Attributes of EFI_GUID_DEFINED_SECTION\r
+/// Attributes of EFI_GUID_DEFINED_SECTION.\r
 /// \r
 #define EFI_GUIDED_SECTION_PROCESSING_REQUIRED  0x01\r
 #define EFI_GUIDED_SECTION_AUTH_STATUS_VALID    0x02\r
 ///\r
-/// Leaf section which is encapsulation defined by specific GUID\r
+/// The leaf section which is encapsulation defined by specific GUID.\r
 /// \r
 typedef struct {\r
   ///\r
-  /// Common section header. CommonHeader.Type = EFI_SECTION_GUID_DEFINED.\r
+  /// The common section header. CommonHeader.Type = EFI_SECTION_GUID_DEFINED.\r
   ///\r
   EFI_COMMON_SECTION_HEADER   CommonHeader;\r
   ///\r
-  /// GUID that defines the format of the data that follows. It is a vendor-defined section type.\r
+  /// The GUID that defines the format of the data that follows. It is a vendor-defined section type.\r
   ///\r
   EFI_GUID                    SectionDefinitionGuid;\r
   ///\r
@@ -359,18 +366,18 @@ typedef struct {
   ///\r
   UINT16                      DataOffset;\r
   ///\r
-  /// Bit field that declares some specific characteristics of the section contents.\r
+  /// The bit field that declares some specific characteristics of the section contents.\r
   ///\r
   UINT16                      Attributes;\r
 } EFI_GUID_DEFINED_SECTION;\r
 \r
 typedef struct {\r
   ///\r
-  /// Common section header. CommonHeader.Type = EFI_SECTION_GUID_DEFINED.\r
+  /// The common section header. CommonHeader.Type = EFI_SECTION_GUID_DEFINED.\r
   ///\r
   EFI_COMMON_SECTION_HEADER2    CommonHeader;\r
   ///\r
-  /// GUID that defines the format of the data that follows. It is a vendor-defined section type.\r
+  /// The GUID that defines the format of the data that follows. It is a vendor-defined section type.\r
   ///  \r
   EFI_GUID                      SectionDefinitionGuid;\r
   ///\r
@@ -378,19 +385,19 @@ typedef struct {
   ///  \r
   UINT16                        DataOffset;\r
   ///\r
-  /// Bit field that declares some specific characteristics of the section contents.\r
+  /// The bit field that declares some specific characteristics of the section contents.\r
   ///  \r
   UINT16                        Attributes;\r
 } EFI_GUID_DEFINED_SECTION2;\r
 \r
 ///\r
-/// Leaf section which contains PE32+ image.\r
+/// The leaf section which contains PE32+ image.\r
 /// \r
 typedef EFI_COMMON_SECTION_HEADER   EFI_PE32_SECTION;\r
 typedef EFI_COMMON_SECTION_HEADER2  EFI_PE32_SECTION2;\r
 \r
 ///\r
-/// Leaf section which used to determine the dispatch order of PEIMs.\r
+/// The leaf section used to determine the dispatch order of PEIMs.\r
 /// \r
 typedef EFI_COMMON_SECTION_HEADER   EFI_PEI_DEPEX_SECTION;\r
 typedef EFI_COMMON_SECTION_HEADER2  EFI_PEI_DEPEX_SECTION2;\r
@@ -408,13 +415,13 @@ typedef EFI_COMMON_SECTION_HEADER   EFI_PIC_SECTION;
 typedef EFI_COMMON_SECTION_HEADER2  EFI_PIC_SECTION2;\r
 \r
 ///\r
-/// Leaf section which constains the position-independent-code image.\r
+/// The leaf section which constains the position-independent-code image.\r
 /// \r
 typedef EFI_COMMON_SECTION_HEADER   EFI_TE_SECTION;\r
 typedef EFI_COMMON_SECTION_HEADER2  EFI_TE_SECTION2;\r
 \r
 ///\r
-/// Leaf section which contains an array of zero or more bytes.\r
+/// The leaf section which contains an array of zero or more bytes.\r
 /// \r
 typedef EFI_COMMON_SECTION_HEADER   EFI_RAW_SECTION;\r
 typedef EFI_COMMON_SECTION_HEADER2  EFI_RAW_SECTION2;\r
@@ -423,7 +430,7 @@ typedef EFI_COMMON_SECTION_HEADER2  EFI_RAW_SECTION2;
 /// The SMM dependency expression section is a leaf section that contains a dependency expression that\r
 /// is used to determine the dispatch order for SMM drivers. Before the SMRAM invocation of the\r
 /// SMM driver's entry point, this dependency expression must evaluate to TRUE. See the Platform\r
-/// Initialization Specification, Volume 2for details regarding the format of the dependency expression.\r
+/// Initialization Specification, Volume 2for details regarding the format of the dependency expression.\r
 /// The dependency expression may refer to protocols installed in either the UEFI or the SMM protocol\r
 /// database. EFI_SMM_DEPEX_SECTION2 must be used if the section is 16MB or larger.\r
 /// \r
@@ -431,7 +438,7 @@ typedef EFI_COMMON_SECTION_HEADER EFI_SMM_DEPEX_SECTION;
 typedef EFI_COMMON_SECTION_HEADER2 EFI_SMM_DEPEX_SECTION2;\r
 \r
 ///\r
-/// Leaf section which contains a unicode string that \r
+/// The leaf section which contains a unicode string that \r
 /// is human readable file name.\r
 /// \r
 typedef struct {\r
@@ -449,7 +456,7 @@ typedef struct {
 } EFI_USER_INTERFACE_SECTION2;\r
 \r
 ///\r
-/// Leaf section which contains a numeric build number and\r
+/// The leaf section which contains a numeric build number and\r
 /// an optional unicode string that represents the file revision. \r
 /// \r
 typedef struct {\r
@@ -472,8 +479,14 @@ typedef struct {
   CHAR16                        VersionString[1];\r
 } EFI_VERSION_SECTION2;\r
 \r
+#define IS_SECTION2(SectionHeaderPtr) \\r
+    ((UINT32) (*((UINT32 *) ((EFI_COMMON_SECTION_HEADER *) (UINTN) SectionHeaderPtr)->Size) & 0x00ffffff) == 0x00ffffff)\r
+\r
 #define SECTION_SIZE(SectionHeaderPtr) \\r
-    ((UINT32) (*((UINT32 *) ((EFI_COMMON_SECTION_HEADER *) SectionHeaderPtr)->Size) & 0x00ffffff))\r
+    ((UINT32) (*((UINT32 *) ((EFI_COMMON_SECTION_HEADER *) (UINTN) SectionHeaderPtr)->Size) & 0x00ffffff))\r
+\r
+#define SECTION2_SIZE(SectionHeaderPtr) \\r
+    (((EFI_COMMON_SECTION_HEADER2 *) (UINTN) SectionHeaderPtr)->ExtendedSize)\r
 \r
 #pragma pack()\r
 \r