From 30f001ca5f08974c8d5a5483f8b8e1a4f46a1025 Mon Sep 17 00:00:00 2001 From: lzeng14 Date: Thu, 27 Oct 2011 08:45:50 +0000 Subject: Add core FFS3 support, ExtractGuidedSectionLib/GuidedSectionExtractionLib/PiFirmwareFile.h. Signed-off-by: lzeng14 Reviewed-by: lgao4 git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12582 6f19259b-4bc3-4df7-8a09-765794883524 --- MdePkg/Include/Pi/PiFirmwareFile.h | 17 ++++++++++++++++- MdePkg/Include/Pi/PiFirmwareVolume.h | 3 ++- 2 files changed, 18 insertions(+), 2 deletions(-) (limited to 'MdePkg/Include/Pi') diff --git a/MdePkg/Include/Pi/PiFirmwareFile.h b/MdePkg/Include/Pi/PiFirmwareFile.h index 1408df0930..3e020b4208 100644 --- a/MdePkg/Include/Pi/PiFirmwareFile.h +++ b/MdePkg/Include/Pi/PiFirmwareFile.h @@ -176,6 +176,15 @@ typedef struct { UINT32 ExtendedSize; } EFI_FFS_FILE_HEADER2; +#define IS_FFS_FILE2(FfsFileHeaderPtr) \ + (((((EFI_FFS_FILE_HEADER *) (UINTN) FfsFileHeaderPtr)->Attributes) & FFS_ATTRIB_LARGE_FILE) == FFS_ATTRIB_LARGE_FILE) + +#define FFS_FILE_SIZE(FfsFileHeaderPtr) \ + ((UINT32) (*((UINT32 *) ((EFI_FFS_FILE_HEADER *) (UINTN) FfsFileHeaderPtr)->Size) & 0x00ffffff)) + +#define FFS_FILE2_SIZE(FfsFileHeaderPtr) \ + (((EFI_FFS_FILE_HEADER2 *) (UINTN) FfsFileHeaderPtr)->ExtendedSize) + typedef UINT8 EFI_SECTION_TYPE; /// @@ -470,8 +479,14 @@ typedef struct { CHAR16 VersionString[1]; } EFI_VERSION_SECTION2; +#define IS_SECTION2(SectionHeaderPtr) \ + ((UINT32) (*((UINT32 *) ((EFI_COMMON_SECTION_HEADER *) (UINTN) SectionHeaderPtr)->Size) & 0x00ffffff) == 0x00ffffff) + #define SECTION_SIZE(SectionHeaderPtr) \ - ((UINT32) (*((UINT32 *) ((EFI_COMMON_SECTION_HEADER *) SectionHeaderPtr)->Size) & 0x00ffffff)) + ((UINT32) (*((UINT32 *) ((EFI_COMMON_SECTION_HEADER *) (UINTN) SectionHeaderPtr)->Size) & 0x00ffffff)) + +#define SECTION2_SIZE(SectionHeaderPtr) \ + (((EFI_COMMON_SECTION_HEADER2 *) (UINTN) SectionHeaderPtr)->ExtendedSize) #pragma pack() diff --git a/MdePkg/Include/Pi/PiFirmwareVolume.h b/MdePkg/Include/Pi/PiFirmwareVolume.h index 1f622bb9ba..22905894a4 100644 --- a/MdePkg/Include/Pi/PiFirmwareVolume.h +++ b/MdePkg/Include/Pi/PiFirmwareVolume.h @@ -211,7 +211,8 @@ typedef struct { #define EFI_FV_EXT_TYPE_GUID_TYPE 0x0002 /// -/// This extension header provides a mapping between a GUID and an OEM file type. +/// This extension header EFI_FIRMWARE_VOLUME_EXT_ENTRY_GUID_TYPE provides a vendor specific +/// GUID FormatType type which includes a length and a successive series of data bytes. /// typedef struct { /// -- cgit v1.2.3