/** @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 - 2012, 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
// Get GuidTable and Table Number\r
//\r
+ ASSERT (HandlerInfo != NULL);\r
*ExtractHandlerGuidTable = HandlerInfo->ExtractHandlerGuidTable;\r
return HandlerInfo->NumberOfExtractHandler;\r
}\r
PEI_EXTRACT_GUIDED_SECTION_HANDLER_INFO *HandlerInfo;\r
\r
//\r
- // Check input paramter\r
+ // Check input parameter\r
//\r
ASSERT (SectionGuid != NULL);\r
ASSERT (GetInfoHandler != NULL);\r
//\r
// Search the match registered GetInfo handler for the input guided section.\r
//\r
+ ASSERT (HandlerInfo != NULL);\r
for (Index = 0; Index < HandlerInfo->NumberOfExtractHandler; Index ++) {\r
if (CompareGuid (HandlerInfo->ExtractHandlerGuidTable + Index, SectionGuid)) {\r
//\r
HandlerInfo->ExtractDecodeHandlerTable [HandlerInfo->NumberOfExtractHandler] = DecodeHandler;\r
HandlerInfo->ExtractGetInfoHandlerTable [HandlerInfo->NumberOfExtractHandler++] = GetInfoHandler;\r
\r
+ //\r
+ // Build the Guided Section GUID HOB to record the GUID itself.\r
+ // Then the content of the GUIDed HOB will be the same as the GUID value itself.\r
+ //\r
+ BuildGuidDataHob (\r
+ (EFI_GUID *) SectionGuid,\r
+ (VOID *) SectionGuid,\r
+ sizeof (GUID)\r
+ );\r
+\r
return RETURN_SUCCESS;\r
}\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 paramter\r
+ // Check input parameter\r
//\r
ASSERT (InputSection != NULL);\r
ASSERT (OutputBufferSize != NULL);\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
+ ASSERT (HandlerInfo != NULL);\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
+ ASSERT (HandlerInfo != NULL);\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