]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdePkg/Include/Pi/PiFirmwareFile.h
Fix a bug about the iSCSI DHCP dependency issue.
[mirror_edk2.git] / MdePkg / Include / Pi / PiFirmwareFile.h
index b2869dc8da5bc08b6f237695b0a3acccb3178e94..3e020b4208b49036b74ec97a55171e7ad7959d93 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   The firmware file related definitions in PI.\r
 \r
-Copyright (c) 2006 - 2010, Intel Corporation.  All rights reserved<BR>\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
@@ -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
@@ -174,9 +173,18 @@ typedef struct {
   /// 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
@@ -471,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