/** @file\r
The firmware file related definitions in PI.\r
\r
- Copyright (c) 2006 - 2008, Intel Corporation All rights reserved.\r
+ @par Revision Reference:\r
+ Version 1.4.\r
+\r
+ Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>\r
\r
This program and the accompanying materials are licensed and made available\r
under the terms and conditions of the BSD License which accompanies this\r
- distribution. The full text of the license may be found at:\r
+ distribution. 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
\r
- File Name: PiFirmwareFile.h\r
-\r
- @par Revision Reference:\r
- Version 1.0.\r
-\r
**/\r
\r
#ifndef __PI_FIRMWARE_FILE_H__\r
#pragma pack(1)\r
//\r
// Used to verify the integrity of the file.\r
-// \r
+//\r
typedef union {\r
struct {\r
UINT8 Header;\r
\r
//\r
// File Types Definitions\r
-// \r
+//\r
#define EFI_FV_FILETYPE_ALL 0x00\r
#define EFI_FV_FILETYPE_RAW 0x01\r
#define EFI_FV_FILETYPE_FREEFORM 0x02\r
#define EFI_FV_FILETYPE_DRIVER 0x07\r
#define EFI_FV_FILETYPE_COMBINED_PEIM_DRIVER 0x08\r
#define EFI_FV_FILETYPE_APPLICATION 0x09\r
+#define EFI_FV_FILETYPE_SMM 0x0A\r
#define EFI_FV_FILETYPE_FIRMWARE_VOLUME_IMAGE 0x0B\r
+#define EFI_FV_FILETYPE_COMBINED_SMM_DXE 0x0C\r
+#define EFI_FV_FILETYPE_SMM_CORE 0x0D\r
+#define EFI_FV_FILETYPE_MM_STANDALONE 0x0E\r
+#define EFI_FV_FILETYPE_MM_CORE_STANDALONE 0x0F\r
#define EFI_FV_FILETYPE_OEM_MIN 0xc0\r
#define EFI_FV_FILETYPE_OEM_MAX 0xdf\r
#define EFI_FV_FILETYPE_DEBUG_MIN 0xe0\r
#define EFI_FV_FILETYPE_FFS_MIN 0xf0\r
#define EFI_FV_FILETYPE_FFS_MAX 0xff\r
#define EFI_FV_FILETYPE_FFS_PAD 0xf0\r
-// \r
+//\r
// FFS File Attributes.\r
-// \r
+//\r
+#define FFS_ATTRIB_LARGE_FILE 0x01\r
+#define FFS_ATTRIB_DATA_ALIGNMENT2 0x02\r
#define FFS_ATTRIB_FIXED 0x04\r
#define FFS_ATTRIB_DATA_ALIGNMENT 0x38\r
#define FFS_ATTRIB_CHECKSUM 0x40\r
//\r
-// FFS_FIXED_CHECKSUM is the default checksum value used when the\r
+// FFS_FIXED_CHECKSUM is the checksum value used when the\r
// FFS_ATTRIB_CHECKSUM attribute bit is clear\r
-// note this is NOT an architecturally defined value, but is in this file for\r
-// implementation convenience\r
//\r
-#define FFS_FIXED_CHECKSUM 0x5A\r
+#define FFS_FIXED_CHECKSUM 0xAA\r
\r
-// \r
+//\r
// FFS File State Bits.\r
-// \r
+//\r
#define EFI_FILE_HEADER_CONSTRUCTION 0x01\r
#define EFI_FILE_HEADER_VALID 0x02\r
#define EFI_FILE_DATA_VALID 0x04\r
)\r
\r
//\r
-// Each file begins with the header that describe the \r
+// Each file begins with the header that describe the\r
// contents and state of the files.\r
-// \r
+//\r
typedef struct {\r
EFI_GUID Name;\r
EFI_FFS_INTEGRITY_CHECK IntegrityCheck;\r
EFI_FFS_FILE_STATE State;\r
} EFI_FFS_FILE_HEADER;\r
\r
+typedef struct {\r
+ EFI_GUID Name;\r
+ EFI_FFS_INTEGRITY_CHECK IntegrityCheck;\r
+ EFI_FV_FILETYPE Type;\r
+ EFI_FFS_FILE_ATTRIBUTES Attributes;\r
+ UINT8 Size[3];\r
+ EFI_FFS_FILE_STATE State;\r
+ UINT64 ExtendedSize;\r
+} EFI_FFS_FILE_HEADER2;\r
+\r
+#define MAX_FFS_SIZE 0x1000000\r
\r
typedef UINT8 EFI_SECTION_TYPE;\r
\r
#define EFI_SECTION_FREEFORM_SUBTYPE_GUID 0x18\r
#define EFI_SECTION_RAW 0x19\r
#define EFI_SECTION_PEI_DEPEX 0x1B\r
+#define EFI_SECTION_SMM_DEPEX 0x1C\r
\r
typedef struct {\r
UINT8 Size[3];\r
EFI_SECTION_TYPE Type;\r
} EFI_COMMON_SECTION_HEADER;\r
\r
+typedef struct {\r
+ UINT8 Size[3];\r
+ EFI_SECTION_TYPE Type;\r
+ UINT32 ExtendedSize;\r
+} EFI_COMMON_SECTION_HEADER2;\r
+\r
+#define MAX_SECTION_SIZE 0x1000000\r
+\r
//\r
-// Leaf section type that contains an \r
+// Leaf section type that contains an\r
// IA-32 16-bit executable image.\r
-// \r
+//\r
typedef EFI_COMMON_SECTION_HEADER EFI_COMPATIBILITY16_SECTION;\r
+typedef EFI_COMMON_SECTION_HEADER2 EFI_COMPATIBILITY16_SECTION2;\r
\r
//\r
// CompressionType of EFI_COMPRESSION_SECTION.\r
-// \r
+//\r
#define EFI_NOT_COMPRESSED 0x00\r
#define EFI_STANDARD_COMPRESSION 0x01\r
//\r
-// An encapsulation section type in which the \r
+// An encapsulation section type in which the\r
// section data is compressed.\r
-// \r
+//\r
typedef struct {\r
EFI_COMMON_SECTION_HEADER CommonHeader;\r
UINT32 UncompressedLength;\r
UINT8 CompressionType;\r
} EFI_COMPRESSION_SECTION;\r
\r
+typedef struct {\r
+ EFI_COMMON_SECTION_HEADER2 CommonHeader;\r
+ UINT32 UncompressedLength;\r
+ UINT8 CompressionType;\r
+} EFI_COMPRESSION_SECTION2;\r
+\r
//\r
// Leaf section which could be used to determine the dispatch order of DXEs.\r
-// \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 witch contains a PI FV.\r
-// \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
-// \r
+//\r
typedef struct {\r
EFI_COMMON_SECTION_HEADER CommonHeader;\r
EFI_GUID SubTypeGuid;\r
} EFI_FREEFORM_SUBTYPE_GUID_SECTION;\r
\r
+typedef struct {\r
+ EFI_COMMON_SECTION_HEADER2 CommonHeader;\r
+ EFI_GUID SubTypeGuid;\r
+} EFI_FREEFORM_SUBTYPE_GUID_SECTION2;\r
+\r
//\r
// Attributes of EFI_GUID_DEFINED_SECTION\r
-// \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
-// \r
+//\r
typedef struct {\r
EFI_COMMON_SECTION_HEADER CommonHeader;\r
EFI_GUID SectionDefinitionGuid;\r
UINT16 Attributes;\r
} EFI_GUID_DEFINED_SECTION;\r
\r
+typedef struct {\r
+ EFI_COMMON_SECTION_HEADER2 CommonHeader;\r
+ EFI_GUID SectionDefinitionGuid;\r
+ UINT16 DataOffset;\r
+ UINT16 Attributes;\r
+} EFI_GUID_DEFINED_SECTION2;\r
+\r
//\r
// Leaf section which contains PE32+ image.\r
-// \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 contains PIC image.\r
-// \r
+//\r
typedef EFI_COMMON_SECTION_HEADER EFI_PIC_SECTION;\r
+typedef EFI_COMMON_SECTION_HEADER2 EFI_PIC_SECTION2;\r
\r
//\r
// Leaf section which used to determine the dispatch order of PEIMs.\r
-// \r
+//\r
typedef EFI_COMMON_SECTION_HEADER EFI_PEI_DEPEX_SECTION;\r
+typedef EFI_COMMON_SECTION_HEADER2 EFI_PEI_DEPEX_SECTION2;\r
\r
//\r
// Leaf section which constains the position-independent-code image.\r
-// \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
-// \r
+//\r
typedef EFI_COMMON_SECTION_HEADER EFI_RAW_SECTION;\r
+typedef EFI_COMMON_SECTION_HEADER2 EFI_RAW_SECTION2;\r
\r
//\r
-// Leaf section which contains a unicode string that \r
+// Leaf section which contains a unicode string that\r
// is human readable file name.\r
-// \r
+//\r
typedef struct {\r
EFI_COMMON_SECTION_HEADER CommonHeader;\r
\r
//\r
// Array of unicode string.\r
- // \r
+ //\r
CHAR16 FileNameString[1];\r
} EFI_USER_INTERFACE_SECTION;\r
\r
+typedef struct {\r
+ EFI_COMMON_SECTION_HEADER2 CommonHeader;\r
+\r
+ //\r
+ // Array of unicode string.\r
+ //\r
+ CHAR16 FileNameString[1];\r
+} EFI_USER_INTERFACE_SECTION2;\r
\r
//\r
// Leaf section which contains a numeric build number and\r
-// an optional unicode string that represent the file revision. \r
-// \r
+// an optional unicode string that represent the file revision.\r
+//\r
typedef struct {\r
EFI_COMMON_SECTION_HEADER CommonHeader;\r
UINT16 BuildNumber;\r
CHAR16 VersionString[1];\r
} EFI_VERSION_SECTION;\r
\r
+typedef struct {\r
+ EFI_COMMON_SECTION_HEADER2 CommonHeader;\r
+ UINT16 BuildNumber;\r
+ CHAR16 VersionString[1];\r
+} EFI_VERSION_SECTION2;\r
\r
#define SECTION_SIZE(SectionHeaderPtr) \\r
((UINT32) (*((UINT32 *) ((EFI_COMMON_SECTION_HEADER *) SectionHeaderPtr)->Size) & 0x00ffffff))\r
EFI_FIRMWARE_VOLUME_IMAGE_SECTION *FVImageSection;\r
EFI_FREEFORM_SUBTYPE_GUID_SECTION *FreeformSubtypeSection;\r
EFI_RAW_SECTION *RawSection;\r
+ //\r
+ // For section whose size is equal or greater than 0x1000000\r
+ //\r
+ EFI_COMMON_SECTION_HEADER2 *CommonHeader2;\r
+ EFI_COMPRESSION_SECTION2 *CompressionSection2;\r
+ EFI_GUID_DEFINED_SECTION2 *GuidDefinedSection2;\r
+ EFI_PE32_SECTION2 *Pe32Section2;\r
+ EFI_PIC_SECTION2 *PicSection2;\r
+ EFI_TE_SECTION2 *TeSection2;\r
+ EFI_PEI_DEPEX_SECTION2 *PeimHeaderSection2;\r
+ EFI_DXE_DEPEX_SECTION2 *DependencySection2;\r
+ EFI_VERSION_SECTION2 *VersionSection2;\r
+ EFI_USER_INTERFACE_SECTION2 *UISection2;\r
+ EFI_COMPATIBILITY16_SECTION2 *Code16Section2;\r
+ EFI_FIRMWARE_VOLUME_IMAGE_SECTION2 *FVImageSection2;\r
+ EFI_FREEFORM_SUBTYPE_GUID_SECTION2 *FreeformSubtypeSection2;\r
+ EFI_RAW_SECTION2 *RawSection2;\r
} EFI_FILE_SECTION_POINTER;\r
\r
#endif\r