]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Add related definitions support large file.
authorklu2 <klu2@6f19259b-4bc3-4df7-8a09-765794883524>
Thu, 20 Aug 2009 07:24:36 +0000 (07:24 +0000)
committerklu2 <klu2@6f19259b-4bc3-4df7-8a09-765794883524>
Thu, 20 Aug 2009 07:24:36 +0000 (07:24 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@9151 6f19259b-4bc3-4df7-8a09-765794883524

MdePkg/Include/Pi/PiFirmwareFile.h

index 95d293ddfc38830dd91f67d353fd1651387145f8..d5047d22d816b8a6db7473bfabeb2182ef9ba50b 100644 (file)
@@ -77,6 +77,7 @@ typedef UINT8 EFI_FFS_FILE_STATE;
 /// \r
 /// FFS File Attributes.\r
 /// \r
+#define FFS_ATTRIB_LARGE_FILE         0x01\r
 #define FFS_ATTRIB_FIXED              0x04\r
 #define FFS_ATTRIB_DATA_ALIGNMENT     0x38\r
 #define FFS_ATTRIB_CHECKSUM           0x40\r
@@ -123,6 +124,49 @@ typedef struct {
   EFI_FFS_FILE_STATE      State;\r
 } EFI_FFS_FILE_HEADER;\r
 \r
+typedef struct {\r
+  ///\r
+  /// This GUID is the file name. It is used to uniquely identify the file. There may be only\r
+  /// one instance of a file with the file name GUID of Name in any given firmware\r
+  /// volume, except if the file type is EFI_FV_FILETYPE_FFS_PAD.\r
+  ///\r
+  EFI_GUID                  Name;\r
+  \r
+  ///\r
+  /// Used to verify the integrity of the file.\r
+  ///  \r
+  EFI_FFS_INTEGRITY_CHECK   IntegrityCheck;\r
+  \r
+  ///\r
+  /// Identifies the type of file.\r
+  ///  \r
+  EFI_FV_FILETYPE           Type;\r
+  \r
+  ///\r
+  /// Declares various file attribute bits.\r
+  ///  \r
+  EFI_FFS_FILE_ATTRIBUTES   Attributes;\r
+  \r
+  ///\r
+  /// The length of the file in bytes, including the FFS header.\r
+  /// The length of the file data is either (Size - sizeof(EFI_FFS_FILE_HEADER)). This calculation means a\r
+  /// zero-length file has a Size of 24 bytes, which is sizeof(EFI_FFS_FILE_HEADER).\r
+  /// Size is not required to be a multiple of 8 bytes. Given a file F, the next file header is\r
+  /// located at the next 8-byte aligned firmware volume offset following the last byte of the file F.\r
+  ///\r
+  UINT8                     Size[3];\r
+  \r
+  ///\r
+  /// Used to track the state of the file throughout the life of the file from creation to deletion.\r
+  ///\r
+  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 not set then EFI_FFS_FILE_HEADER is used.\r
+  ///\r
+  EFI_FFS_FILE_STATE        ExtendedSize;\r
+} EFI_FFS_FILE_HEADER2;\r
 \r
 typedef UINT8 EFI_SECTION_TYPE;\r
 \r
@@ -140,6 +184,8 @@ typedef UINT8 EFI_SECTION_TYPE;
 \r
 #define EFI_SECTION_GUID_DEFINED          0x02\r
 \r
+#define EFI_SECTION_DISPOSABLE            0x03\r
+\r
 ///\r
 /// Leaf section Type values\r
 ///\r
@@ -154,6 +200,7 @@ typedef UINT8 EFI_SECTION_TYPE;
 #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
 ///\r
 /// Common section header\r
@@ -170,11 +217,28 @@ typedef struct {
   ///\r
 } EFI_COMMON_SECTION_HEADER;\r
 \r
+typedef struct {\r
+  ///\r
+  /// A 24-bit unsigned integer that contains the total size of the section in bytes, \r
+  /// including the EFI_COMMON_SECTION_HEADER.\r
+  ///\r
+  UINT8             Size[3];\r
+  \r
+  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
+  ///\r
+  UINT32            ExtendedSize;\r
+} EFI_COMMON_SECTION_HEADER2;\r
+\r
 ///\r
 /// Leaf section type that contains an \r
 /// IA-32 16-bit executable image.\r
 /// \r
-typedef EFI_COMMON_SECTION_HEADER EFI_COMPATIBILITY16_SECTION;\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
@@ -200,6 +264,21 @@ typedef struct {
   UINT8                       CompressionType;\r
 } EFI_COMPRESSION_SECTION;\r
 \r
+typedef struct {\r
+  ///\r
+  /// Usual common section header. CommonHeader.Type = EFI_SECTION_COMPRESSION.\r
+  ///\r
+  EFI_COMMON_SECTION_HEADER2    CommonHeader;\r
+  ///\r
+  /// UINT32 that indicates the size of the section data after decompression.\r
+  ///\r
+  UINT32                        UncompressedLength;\r
+  ///\r
+  /// Indicates which compression algorithm is used.\r
+  ///\r
+  UINT8                         CompressionType;\r
+} EFI_COMPRESSION_SECTION2;\r
+\r
 ///\r
 /// An encapsulation section type in which the section data is disposable.\r
 /// A disposable section is an encapsulation section in which the section data may be disposed of during\r
@@ -209,17 +288,20 @@ typedef struct {
 /// order to conserve space. The contents of this section are implementation specific, but might contain\r
 /// debug data or detailed integration instructions.\r
 ///\r
-typedef EFI_COMMON_SECTION_HEADER EFI_DISPOSABLE_SECTION;\r
+typedef EFI_COMMON_SECTION_HEADER   EFI_DISPOSABLE_SECTION;\r
+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
 /// \r
-typedef EFI_COMMON_SECTION_HEADER EFI_DXE_DEPEX_SECTION;\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
 /// \r
-typedef EFI_COMMON_SECTION_HEADER EFI_FIRMWARE_VOLUME_IMAGE_SECTION;\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
@@ -235,6 +317,17 @@ typedef struct {
   EFI_GUID                    SubTypeGuid;\r
 } EFI_FREEFORM_SUBTYPE_GUID_SECTION;\r
 \r
+typedef struct {\r
+  ///\r
+  /// Common section header. CommonHeader.Type = EFI_SECTION_FREEFORM_SUBTYPE_GUID.\r
+  ///\r
+  EFI_COMMON_SECTION_HEADER2    CommonHeader;\r
+  ///\r
+  /// This GUID is defined by the creator of the file. It is a vendor-defined file type.\r
+  ///  \r
+  EFI_GUID                      SubTypeGuid;\r
+} EFI_FREEFORM_SUBTYPE_GUID_SECTION2;\r
+\r
 ///\r
 /// Attributes of EFI_GUID_DEFINED_SECTION\r
 /// \r
@@ -262,26 +355,71 @@ typedef struct {
   UINT16                      Attributes;\r
 } EFI_GUID_DEFINED_SECTION;\r
 \r
+typedef struct {\r
+  ///\r
+  /// 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
+  ///  \r
+  EFI_GUID                      SectionDefinitionGuid;\r
+  ///\r
+  /// Contains the offset in bytes from the beginning of the common header to the first byte of the data.\r
+  ///  \r
+  UINT16                        DataOffset;\r
+  ///\r
+  /// 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
 /// \r
-typedef EFI_COMMON_SECTION_HEADER EFI_PE32_SECTION;\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
 /// \r
-typedef EFI_COMMON_SECTION_HEADER EFI_PEI_DEPEX_SECTION;\r
+typedef EFI_COMMON_SECTION_HEADER   EFI_PEI_DEPEX_SECTION;\r
+typedef EFI_COMMON_SECTION_HEADER2  EFI_PEI_DEPEX_SECTION2;\r
+\r
+///\r
+/// A leaf section type that contains a position-independent-code (PIC) image.\r
+/// A PIC image section is a leaf section that contains a position-independent-code (PIC) image.\r
+/// In addition to normal PE32+ images that contain relocation information, PEIM executables may be\r
+/// PIC and are referred to as PIC images. A PIC image is the same as a PE32+ image except that all\r
+/// relocation information has been stripped from the image and the image can be moved and will\r
+/// execute correctly without performing any relocation or other fix-ups. EFI_PIC_SECTION2 must\r
+/// be used if the section is 16MB or larger.\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 constains the position-independent-code image.\r
 /// \r
-typedef EFI_COMMON_SECTION_HEADER EFI_TE_SECTION;\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
-typedef EFI_COMMON_SECTION_HEADER EFI_RAW_SECTION;\r
+typedef EFI_COMMON_SECTION_HEADER   EFI_RAW_SECTION;\r
+typedef EFI_COMMON_SECTION_HEADER2  EFI_RAW_SECTION2;\r
+\r
+/// \r
+/// 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
+/// 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
+typedef EFI_COMMON_SECTION_HEADER EFI_SMM_DEPEX_SECTION;\r
+typedef EFI_COMMON_SECTION_HEADER2 EFI_SMM_DEPEX_SECTION2;\r
 \r
 ///\r
 /// Leaf section which contains a unicode string that \r
@@ -296,6 +434,10 @@ typedef struct {
   CHAR16                      FileNameString[1];\r
 } EFI_USER_INTERFACE_SECTION;\r
 \r
+typedef struct {\r
+  EFI_COMMON_SECTION_HEADER2    CommonHeader;\r
+  CHAR16                        FileNameString[1];\r
+} EFI_USER_INTERFACE_SECTION2;\r
 \r
 ///\r
 /// Leaf section which contains a numeric build number and\r
@@ -311,6 +453,15 @@ typedef struct {
   CHAR16                      VersionString[1];\r
 } EFI_VERSION_SECTION;\r
 \r
+typedef struct {\r
+  EFI_COMMON_SECTION_HEADER2    CommonHeader;\r
+  ///\r
+  /// A UINT16 that represents a particular build. Subsequent builds have monotonically\r
+  /// increasing build numbers relative to earlier builds.\r
+  ///\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