/** @file\r
UEFI and Tiano Custom Decompress Library \r
- Tt will do Tiano or UEFI decompress with different verison parameter.\r
+ It will do Tiano or UEFI decompress with different verison parameter.\r
\r
-Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>\r
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
return RETURN_INVALID_PARAMETER;\r
}\r
\r
- if (!CompareGuid (\r
- &gTianoCustomDecompressGuid, \r
+ if (IS_SECTION2 (InputSection)) {\r
+ if (!CompareGuid (\r
+ &gTianoCustomDecompressGuid,\r
+ &(((EFI_GUID_DEFINED_SECTION2 *) InputSection)->SectionDefinitionGuid))) {\r
+ return RETURN_INVALID_PARAMETER;\r
+ }\r
+ //\r
+ // Get guid attribute of guid section. \r
+ //\r
+ *SectionAttribute = ((EFI_GUID_DEFINED_SECTION2 *) InputSection)->Attributes;\r
+\r
+ //\r
+ // Call Tiano GetInfo to get the required size info.\r
+ //\r
+ return UefiDecompressGetInfo (\r
+ (UINT8 *) InputSection + ((EFI_GUID_DEFINED_SECTION2 *) InputSection)->DataOffset,\r
+ SECTION2_SIZE (InputSection) - ((EFI_GUID_DEFINED_SECTION2 *) InputSection)->DataOffset,\r
+ OutputBufferSize,\r
+ ScratchBufferSize\r
+ );\r
+ } else {\r
+ if (!CompareGuid (\r
+ &gTianoCustomDecompressGuid,\r
&(((EFI_GUID_DEFINED_SECTION *) InputSection)->SectionDefinitionGuid))) {\r
- return RETURN_INVALID_PARAMETER;\r
- }\r
- //\r
- // Get guid attribute of guid section. \r
- //\r
- *SectionAttribute = ((EFI_GUID_DEFINED_SECTION *) InputSection)->Attributes;\r
+ return RETURN_INVALID_PARAMETER;\r
+ }\r
+ //\r
+ // Get guid attribute of guid section. \r
+ //\r
+ *SectionAttribute = ((EFI_GUID_DEFINED_SECTION *) InputSection)->Attributes;\r
\r
- //\r
- // Call Tiano GetInfo to get the required size info.\r
- //\r
- return UefiDecompressGetInfo (\r
- (UINT8 *) InputSection + ((EFI_GUID_DEFINED_SECTION *) InputSection)->DataOffset,\r
- (*(UINT32 *) (((EFI_COMMON_SECTION_HEADER *) InputSection)->Size) & 0x00ffffff) - ((EFI_GUID_DEFINED_SECTION *) InputSection)->DataOffset,\r
- OutputBufferSize,\r
- ScratchBufferSize\r
- );\r
+ //\r
+ // Call Tiano GetInfo to get the required size info.\r
+ //\r
+ return UefiDecompressGetInfo (\r
+ (UINT8 *) InputSection + ((EFI_GUID_DEFINED_SECTION *) InputSection)->DataOffset,\r
+ SECTION_SIZE (InputSection) - ((EFI_GUID_DEFINED_SECTION *) InputSection)->DataOffset,\r
+ OutputBufferSize,\r
+ ScratchBufferSize\r
+ );\r
+ }\r
}\r
\r
/**\r
ASSERT (OutputBuffer != NULL);\r
ASSERT (InputSection != NULL);\r
\r
- if (!CompareGuid (\r
- &gTianoCustomDecompressGuid, \r
+ if (IS_SECTION2 (InputSection)) {\r
+ if (!CompareGuid (\r
+ &gTianoCustomDecompressGuid,\r
+ &(((EFI_GUID_DEFINED_SECTION2 *) InputSection)->SectionDefinitionGuid))) {\r
+ return RETURN_INVALID_PARAMETER;\r
+ }\r
+\r
+ //\r
+ // Set Authentication to Zero.\r
+ //\r
+ *AuthenticationStatus = 0;\r
+\r
+ //\r
+ // Call Tiano Decompress to get the raw data\r
+ //\r
+ return UefiTianoDecompress (\r
+ (UINT8 *) InputSection + ((EFI_GUID_DEFINED_SECTION2 *) InputSection)->DataOffset,\r
+ *OutputBuffer,\r
+ ScratchBuffer,\r
+ 2\r
+ );\r
+ } else {\r
+ if (!CompareGuid (\r
+ &gTianoCustomDecompressGuid,\r
&(((EFI_GUID_DEFINED_SECTION *) InputSection)->SectionDefinitionGuid))) {\r
- return RETURN_INVALID_PARAMETER;\r
- }\r
+ return RETURN_INVALID_PARAMETER;\r
+ }\r
\r
- //\r
- // Set Authentication to Zero.\r
- //\r
- *AuthenticationStatus = 0;\r
- \r
- //\r
- // Call Tiano Decompress to get the raw data\r
- //\r
- return UefiTianoDecompress (\r
- (UINT8 *) InputSection + ((EFI_GUID_DEFINED_SECTION *) InputSection)->DataOffset,\r
- *OutputBuffer,\r
- ScratchBuffer,\r
- 2\r
- );\r
+ //\r
+ // Set Authentication to Zero.\r
+ //\r
+ *AuthenticationStatus = 0;\r
+\r
+ //\r
+ // Call Tiano Decompress to get the raw data\r
+ //\r
+ return UefiTianoDecompress (\r
+ (UINT8 *) InputSection + ((EFI_GUID_DEFINED_SECTION *) InputSection)->DataOffset,\r
+ *OutputBuffer,\r
+ ScratchBuffer,\r
+ 2\r
+ );\r
+ }\r
}\r
\r
/**\r
&gTianoCustomDecompressGuid,\r
TianoDecompressGetInfo,\r
TianoDecompress\r
- ); \r
+ );\r
}\r
It wraps Lzma decompress interfaces to GUIDed Section Extraction interfaces\r
and registers them into GUIDed handler table.\r
\r
- Copyright (c) 2009, Intel Corporation. All rights reserved.<BR>\r
+ Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>\r
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
ASSERT (ScratchBufferSize != NULL);\r
ASSERT (SectionAttribute != NULL);\r
\r
- if (!CompareGuid (\r
- &gLzmaCustomDecompressGuid, \r
+ if (IS_SECTION2 (InputSection)) {\r
+ if (!CompareGuid (\r
+ &gLzmaCustomDecompressGuid,\r
+ &(((EFI_GUID_DEFINED_SECTION2 *) InputSection)->SectionDefinitionGuid))) {\r
+ return RETURN_INVALID_PARAMETER;\r
+ }\r
+\r
+ *SectionAttribute = ((EFI_GUID_DEFINED_SECTION2 *) InputSection)->Attributes;\r
+\r
+ return LzmaUefiDecompressGetInfo (\r
+ (UINT8 *) InputSection + ((EFI_GUID_DEFINED_SECTION2 *) InputSection)->DataOffset,\r
+ SECTION2_SIZE (InputSection) - ((EFI_GUID_DEFINED_SECTION2 *) InputSection)->DataOffset,\r
+ OutputBufferSize,\r
+ ScratchBufferSize\r
+ );\r
+ } else {\r
+ if (!CompareGuid (\r
+ &gLzmaCustomDecompressGuid,\r
&(((EFI_GUID_DEFINED_SECTION *) InputSection)->SectionDefinitionGuid))) {\r
- return RETURN_INVALID_PARAMETER;\r
- }\r
+ return RETURN_INVALID_PARAMETER;\r
+ }\r
\r
- *SectionAttribute = ((EFI_GUID_DEFINED_SECTION *) InputSection)->Attributes;\r
+ *SectionAttribute = ((EFI_GUID_DEFINED_SECTION *) InputSection)->Attributes;\r
\r
- return LzmaUefiDecompressGetInfo (\r
- (UINT8 *) InputSection + ((EFI_GUID_DEFINED_SECTION *) InputSection)->DataOffset,\r
- SECTION_SIZE (InputSection) - ((EFI_GUID_DEFINED_SECTION *) InputSection)->DataOffset,\r
- OutputBufferSize,\r
- ScratchBufferSize\r
- );\r
+ return LzmaUefiDecompressGetInfo (\r
+ (UINT8 *) InputSection + ((EFI_GUID_DEFINED_SECTION *) InputSection)->DataOffset,\r
+ SECTION_SIZE (InputSection) - ((EFI_GUID_DEFINED_SECTION *) InputSection)->DataOffset,\r
+ OutputBufferSize,\r
+ ScratchBufferSize\r
+ );\r
+ }\r
}\r
\r
/**\r
ASSERT (OutputBuffer != NULL);\r
ASSERT (InputSection != NULL);\r
\r
- if (!CompareGuid (\r
- &gLzmaCustomDecompressGuid, \r
+ if (IS_SECTION2 (InputSection)) {\r
+ if (!CompareGuid (\r
+ &gLzmaCustomDecompressGuid,\r
+ &(((EFI_GUID_DEFINED_SECTION2 *) InputSection)->SectionDefinitionGuid))) {\r
+ return RETURN_INVALID_PARAMETER;\r
+ }\r
+\r
+ //\r
+ // Authentication is set to Zero, which may be ignored.\r
+ //\r
+ *AuthenticationStatus = 0;\r
+\r
+ return LzmaUefiDecompress (\r
+ (UINT8 *) InputSection + ((EFI_GUID_DEFINED_SECTION2 *) InputSection)->DataOffset,\r
+ SECTION2_SIZE (InputSection) - ((EFI_GUID_DEFINED_SECTION2 *) InputSection)->DataOffset,\r
+ *OutputBuffer,\r
+ ScratchBuffer\r
+ );\r
+ } else {\r
+ if (!CompareGuid (\r
+ &gLzmaCustomDecompressGuid,\r
&(((EFI_GUID_DEFINED_SECTION *) InputSection)->SectionDefinitionGuid))) {\r
- return RETURN_INVALID_PARAMETER;\r
- }\r
-\r
- //\r
- // Authentication is set to Zero, which may be ignored.\r
- //\r
- *AuthenticationStatus = 0;\r
-\r
- return LzmaUefiDecompress (\r
- (UINT8 *) InputSection + ((EFI_GUID_DEFINED_SECTION *) InputSection)->DataOffset,\r
- SECTION_SIZE (InputSection) - ((EFI_GUID_DEFINED_SECTION *) InputSection)->DataOffset,\r
- *OutputBuffer,\r
- ScratchBuffer\r
+ return RETURN_INVALID_PARAMETER;\r
+ }\r
+\r
+ //\r
+ // Authentication is set to Zero, which may be ignored.\r
+ //\r
+ *AuthenticationStatus = 0;\r
+\r
+ return LzmaUefiDecompress (\r
+ (UINT8 *) InputSection + ((EFI_GUID_DEFINED_SECTION *) InputSection)->DataOffset,\r
+ SECTION_SIZE (InputSection) - ((EFI_GUID_DEFINED_SECTION *) InputSection)->DataOffset,\r
+ *OutputBuffer,\r
+ ScratchBuffer\r
);\r
+ }\r
}\r
\r
\r
to parse CRC32 encapsulation section and extract raw data.\r
It uses UEFI boot service CalculateCrc32 to authenticate 32 bit CRC value.\r
\r
-Copyright (c) 2007 - 2008, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2007 - 2011, Intel Corporation. All rights reserved.<BR>\r
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
#include <Library/BaseMemoryLib.h>\r
#include <Library/UefiBootServicesTableLib.h>\r
\r
-#define EFI_SECITON_SIZE_MASK 0x00ffffff\r
-\r
///\r
/// CRC32 Guided Section header\r
///\r
UINT32 CRC32Checksum; ///< 32bit CRC check sum\r
} CRC32_SECTION_HEADER;\r
\r
+typedef struct {\r
+ EFI_GUID_DEFINED_SECTION2 GuidedSectionHeader; ///< EFI guided section header\r
+ UINT32 CRC32Checksum; ///< 32bit CRC check sum\r
+} CRC32_SECTION2_HEADER;\r
+\r
/**\r
\r
GetInfo gets raw data size and attribute of the input guided section.\r
OUT UINT16 *SectionAttribute\r
)\r
{\r
- //\r
- // Check whether the input guid section is recognized.\r
- //\r
- if (!CompareGuid (\r
- &gEfiCrc32GuidedSectionExtractionGuid, \r
+ if (IS_SECTION2 (InputSection)) {\r
+ //\r
+ // Check whether the input guid section is recognized.\r
+ //\r
+ if (!CompareGuid (\r
+ &gEfiCrc32GuidedSectionExtractionGuid,\r
+ &(((EFI_GUID_DEFINED_SECTION2 *) InputSection)->SectionDefinitionGuid))) {\r
+ return EFI_INVALID_PARAMETER;\r
+ }\r
+ //\r
+ // Retrieve the size and attribute of the input section data.\r
+ //\r
+ *SectionAttribute = ((EFI_GUID_DEFINED_SECTION2 *) InputSection)->Attributes;\r
+ *ScratchBufferSize = 0;\r
+ *OutputBufferSize = SECTION2_SIZE (InputSection) - ((EFI_GUID_DEFINED_SECTION2 *) InputSection)->DataOffset;\r
+ } else {\r
+ //\r
+ // Check whether the input guid section is recognized.\r
+ //\r
+ if (!CompareGuid (\r
+ &gEfiCrc32GuidedSectionExtractionGuid,\r
&(((EFI_GUID_DEFINED_SECTION *) InputSection)->SectionDefinitionGuid))) {\r
- return EFI_INVALID_PARAMETER;\r
+ return EFI_INVALID_PARAMETER;\r
+ }\r
+ //\r
+ // Retrieve the size and attribute of the input section data.\r
+ //\r
+ *SectionAttribute = ((EFI_GUID_DEFINED_SECTION *) InputSection)->Attributes;\r
+ *ScratchBufferSize = 0;\r
+ *OutputBufferSize = SECTION_SIZE (InputSection) - ((EFI_GUID_DEFINED_SECTION *) InputSection)->DataOffset;\r
}\r
- //\r
- // Retrieve the size and attribute of the input section data.\r
- //\r
- *SectionAttribute = ((EFI_GUID_DEFINED_SECTION *) InputSection)->Attributes;\r
- *ScratchBufferSize = 0;\r
- *OutputBufferSize = *(UINT32 *) (((EFI_COMMON_SECTION_HEADER *) InputSection)->Size) & EFI_SECITON_SIZE_MASK;\r
- *OutputBufferSize -= ((EFI_GUID_DEFINED_SECTION *) InputSection)->DataOffset;\r
\r
return EFI_SUCCESS;\r
}\r
)\r
{\r
EFI_STATUS Status;\r
- CRC32_SECTION_HEADER *Crc32SectionHeader;\r
+ UINT32 SectionCrc32Checksum;\r
UINT32 Crc32Checksum;\r
UINT32 OutputBufferSize;\r
VOID *DummyInterface;\r
\r
- //\r
- // Check whether the input guid section is recognized.\r
- //\r
- if (!CompareGuid (\r
- &gEfiCrc32GuidedSectionExtractionGuid, \r
+ if (IS_SECTION2 (InputSection)) {\r
+ //\r
+ // Check whether the input guid section is recognized.\r
+ //\r
+ if (!CompareGuid (\r
+ &gEfiCrc32GuidedSectionExtractionGuid,\r
+ &(((EFI_GUID_DEFINED_SECTION2 *) InputSection)->SectionDefinitionGuid))) {\r
+ return EFI_INVALID_PARAMETER;\r
+ }\r
+ \r
+ //\r
+ // Get section Crc32 checksum.\r
+ //\r
+ SectionCrc32Checksum = ((CRC32_SECTION2_HEADER *) InputSection)->CRC32Checksum;\r
+ *OutputBuffer = (UINT8 *) InputSection + ((EFI_GUID_DEFINED_SECTION2 *) InputSection)->DataOffset;\r
+ OutputBufferSize = SECTION2_SIZE (InputSection) - ((EFI_GUID_DEFINED_SECTION2 *) InputSection)->DataOffset;\r
+\r
+ //\r
+ // Implicitly CRC32 GUIDed section should have STATUS_VALID bit set\r
+ //\r
+ ASSERT (((EFI_GUID_DEFINED_SECTION2 *) InputSection)->Attributes & EFI_GUIDED_SECTION_AUTH_STATUS_VALID);\r
+ *AuthenticationStatus = EFI_AUTH_STATUS_IMAGE_SIGNED;\r
+ } else {\r
+ //\r
+ // Check whether the input guid section is recognized.\r
+ //\r
+ if (!CompareGuid (\r
+ &gEfiCrc32GuidedSectionExtractionGuid,\r
&(((EFI_GUID_DEFINED_SECTION *) InputSection)->SectionDefinitionGuid))) {\r
- return EFI_INVALID_PARAMETER;\r
- }\r
+ return EFI_INVALID_PARAMETER;\r
+ }\r
\r
+ //\r
+ // Get section Crc32 checksum.\r
+ //\r
+ SectionCrc32Checksum = ((CRC32_SECTION_HEADER *) InputSection)->CRC32Checksum;\r
+ *OutputBuffer = (UINT8 *) InputSection + ((EFI_GUID_DEFINED_SECTION *) InputSection)->DataOffset;\r
+ OutputBufferSize = SECTION_SIZE (InputSection) - ((EFI_GUID_DEFINED_SECTION *) InputSection)->DataOffset;\r
+\r
+ //\r
+ // Implicitly CRC32 GUIDed section should have STATUS_VALID bit set\r
+ //\r
+ ASSERT (((EFI_GUID_DEFINED_SECTION *) InputSection)->Attributes & EFI_GUIDED_SECTION_AUTH_STATUS_VALID);\r
+ *AuthenticationStatus = EFI_AUTH_STATUS_IMAGE_SIGNED;\r
+ }\r
+\r
//\r
// Init Checksum value to Zero.\r
//\r
Crc32Checksum = 0;\r
- //\r
- // Points to the Crc32 section header\r
- //\r
- Crc32SectionHeader = (CRC32_SECTION_HEADER *) InputSection;\r
- *OutputBuffer = (UINT8 *) InputSection + Crc32SectionHeader->GuidedSectionHeader.DataOffset;\r
- OutputBufferSize = *(UINT32 *) (((EFI_COMMON_SECTION_HEADER *) InputSection)->Size) & EFI_SECITON_SIZE_MASK; \r
- OutputBufferSize -= Crc32SectionHeader->GuidedSectionHeader.DataOffset;\r
-\r
- //\r
- // Implictly CRC32 GUIDed section should have STATUS_VALID bit set\r
- //\r
- ASSERT (Crc32SectionHeader->GuidedSectionHeader.Attributes & EFI_GUIDED_SECTION_AUTH_STATUS_VALID);\r
- *AuthenticationStatus = EFI_AUTH_STATUS_IMAGE_SIGNED;\r
\r
//\r
// Check whether there exists EFI_SECURITY_POLICY_PROTOCOL_GUID.\r
//\r
Status = gBS->CalculateCrc32 (*OutputBuffer, OutputBufferSize, &Crc32Checksum);\r
if (Status == EFI_SUCCESS) {\r
- if (Crc32Checksum != Crc32SectionHeader->CRC32Checksum) {\r
+ if (Crc32Checksum != SectionCrc32Checksum) {\r
//\r
// If Crc32 checksum is not matched, AUTH tested failed bit is set.\r
//\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
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
#define EFI_FV_EXT_TYPE_GUID_TYPE 0x0002\r
\r
///\r
-/// This extension header provides a mapping between a GUID and an OEM file type.\r
+/// This extension header EFI_FIRMWARE_VOLUME_EXT_ENTRY_GUID_TYPE provides a vendor specific\r
+/// GUID FormatType type which includes a length and a successive series of data bytes.\r
///\r
typedef struct {\r
///\r
/** @file\r
Provide generic extract guided section functions.\r
\r
- Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>\r
+ Copyright (c) 2007 - 2011, Intel Corporation. All rights reserved.<BR>\r
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
UINT32 Index;\r
RETURN_STATUS Status;\r
EXTRACT_GUIDED_SECTION_HANDLER_INFO *HandlerInfo;\r
+ EFI_GUID *SectionDefinitionGuid;\r
\r
//\r
// Check input paramter\r
return Status;\r
}\r
\r
+ if (IS_SECTION2 (InputSection)) {\r
+ SectionDefinitionGuid = &(((EFI_GUID_DEFINED_SECTION2 *) InputSection)->SectionDefinitionGuid);\r
+ } else {\r
+ SectionDefinitionGuid = &(((EFI_GUID_DEFINED_SECTION *) InputSection)->SectionDefinitionGuid);\r
+ }\r
+\r
//\r
// Search the match registered GetInfo handler for the input guided section.\r
//\r
for (Index = 0; Index < HandlerInfo->NumberOfExtractHandler; Index ++) {\r
- if (CompareGuid (HandlerInfo->ExtractHandlerGuidTable + Index, &(((EFI_GUID_DEFINED_SECTION *) InputSection)->SectionDefinitionGuid))) {\r
+ if (CompareGuid (HandlerInfo->ExtractHandlerGuidTable + Index, SectionDefinitionGuid)) {\r
//\r
// Call the match handler to get information for the input section data.\r
//\r
UINT32 Index;\r
RETURN_STATUS Status;\r
EXTRACT_GUIDED_SECTION_HANDLER_INFO *HandlerInfo;\r
+ EFI_GUID *SectionDefinitionGuid;\r
\r
//\r
// Check input parameter\r
return Status;\r
}\r
\r
+ if (IS_SECTION2 (InputSection)) {\r
+ SectionDefinitionGuid = &(((EFI_GUID_DEFINED_SECTION2 *) InputSection)->SectionDefinitionGuid);\r
+ } else {\r
+ SectionDefinitionGuid = &(((EFI_GUID_DEFINED_SECTION *) InputSection)->SectionDefinitionGuid);\r
+ }\r
+\r
//\r
// Search the match registered Extract handler for the input guided section.\r
//\r
for (Index = 0; Index < HandlerInfo->NumberOfExtractHandler; Index ++) {\r
- if (CompareGuid (HandlerInfo->ExtractHandlerGuidTable + Index, &(((EFI_GUID_DEFINED_SECTION *) InputSection)->SectionDefinitionGuid))) {\r
+ if (CompareGuid (HandlerInfo->ExtractHandlerGuidTable + Index, SectionDefinitionGuid)) {\r
//\r
// Call the match handler to extract raw data for the input guided section.\r
//\r
/** @file\r
Provide generic extract guided section functions for Dxe phase.\r
\r
- Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>\r
+ Copyright (c) 2007 - 2011, Intel Corporation. All rights reserved.<BR>\r
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
)\r
{\r
UINT32 Index;\r
+ EFI_GUID *SectionDefinitionGuid;\r
\r
ASSERT (InputSection != NULL); \r
ASSERT (OutputBufferSize != NULL);\r
ASSERT (ScratchBufferSize != NULL);\r
ASSERT (SectionAttribute != NULL);\r
+\r
+ if (IS_SECTION2 (InputSection)) {\r
+ SectionDefinitionGuid = &(((EFI_GUID_DEFINED_SECTION2 *) InputSection)->SectionDefinitionGuid);\r
+ } else {\r
+ SectionDefinitionGuid = &(((EFI_GUID_DEFINED_SECTION *) InputSection)->SectionDefinitionGuid);\r
+ }\r
\r
//\r
// Search the match registered GetInfo handler for the input guided section.\r
//\r
for (Index = 0; Index < mNumberOfExtractHandler; Index ++) {\r
- if (CompareGuid (&mExtractHandlerGuidTable[Index], &(((EFI_GUID_DEFINED_SECTION *) InputSection)->SectionDefinitionGuid))) {\r
+ if (CompareGuid (&mExtractHandlerGuidTable[Index], SectionDefinitionGuid)) {\r
//\r
// Call the match handler to getinfo for the input section data.\r
//\r
)\r
{\r
UINT32 Index;\r
+ EFI_GUID *SectionDefinitionGuid;\r
\r
//\r
// Check the input parameters\r
ASSERT (OutputBuffer != NULL);\r
ASSERT (AuthenticationStatus != NULL);\r
\r
+ if (IS_SECTION2 (InputSection)) {\r
+ SectionDefinitionGuid = &(((EFI_GUID_DEFINED_SECTION2 *) InputSection)->SectionDefinitionGuid);\r
+ } else {\r
+ SectionDefinitionGuid = &(((EFI_GUID_DEFINED_SECTION *) InputSection)->SectionDefinitionGuid);\r
+ }\r
+\r
//\r
// Search the match registered extract handler for the input guided section.\r
//\r
for (Index = 0; Index < mNumberOfExtractHandler; Index ++) {\r
- if (CompareGuid (&mExtractHandlerGuidTable[Index], &(((EFI_GUID_DEFINED_SECTION *) InputSection)->SectionDefinitionGuid))) {\r
+ if (CompareGuid (&mExtractHandlerGuidTable[Index], SectionDefinitionGuid)) {\r
//\r
// Call the match handler to extract raw data for the input section data.\r
//\r
/** @file\r
Provide generic extract guided section functions for PEI phase.\r
\r
- Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>\r
+ Copyright (c) 2007 - 2011, Intel Corporation. All rights reserved.<BR>\r
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
UINT32 Index;\r
EFI_STATUS Status;\r
PEI_EXTRACT_GUIDED_SECTION_HANDLER_INFO *HandlerInfo;\r
+ EFI_GUID *SectionDefinitionGuid;\r
\r
//\r
// Check input paramter\r
if (EFI_ERROR (Status)) {\r
return Status;\r
}\r
- \r
+\r
+ if (IS_SECTION2 (InputSection)) {\r
+ SectionDefinitionGuid = &(((EFI_GUID_DEFINED_SECTION2 *) InputSection)->SectionDefinitionGuid);\r
+ } else {\r
+ SectionDefinitionGuid = &(((EFI_GUID_DEFINED_SECTION *) InputSection)->SectionDefinitionGuid);\r
+ }\r
+\r
//\r
// Search the match registered GetInfo handler for the input guided section.\r
//\r
for (Index = 0; Index < HandlerInfo->NumberOfExtractHandler; Index ++) {\r
- if (CompareGuid (HandlerInfo->ExtractHandlerGuidTable + Index, &(((EFI_GUID_DEFINED_SECTION *) InputSection)->SectionDefinitionGuid))) {\r
+ if (CompareGuid (HandlerInfo->ExtractHandlerGuidTable + Index, SectionDefinitionGuid)) {\r
//\r
// Call the match handler to get information for the input section data.\r
//\r
UINT32 Index;\r
EFI_STATUS Status;\r
PEI_EXTRACT_GUIDED_SECTION_HANDLER_INFO *HandlerInfo;\r
+ EFI_GUID *SectionDefinitionGuid;\r
\r
//\r
// Check input parameter\r
return Status;\r
}\r
\r
+ if (IS_SECTION2 (InputSection)) {\r
+ SectionDefinitionGuid = &(((EFI_GUID_DEFINED_SECTION2 *) InputSection)->SectionDefinitionGuid);\r
+ } else {\r
+ SectionDefinitionGuid = &(((EFI_GUID_DEFINED_SECTION *) InputSection)->SectionDefinitionGuid);\r
+ }\r
+\r
//\r
// Search the match registered Extract handler for the input guided section.\r
//\r
for (Index = 0; Index < HandlerInfo->NumberOfExtractHandler; Index ++) {\r
- if (CompareGuid (HandlerInfo->ExtractHandlerGuidTable + Index, &(((EFI_GUID_DEFINED_SECTION *) InputSection)->SectionDefinitionGuid))) {\r
+ if (CompareGuid (HandlerInfo->ExtractHandlerGuidTable + Index, SectionDefinitionGuid)) {\r
//\r
// Call the match handler to extract raw data for the input guided section.\r
//\r