/** @file\r
Provide generic extract guided section functions for PEI phase.\r
\r
- Copyright (c) 2007 - 2008, Intel Corporation<BR>\r
- All rights reserved. This program and the accompanying materials\r
+ Copyright (c) 2007 - 2010, 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
- http://opensource.org/licenses/bsd-license.php\r
+ http://opensource.org/licenses/bsd-license.php.\r
\r
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
#include <Library/HobLib.h>\r
#include <Library/ExtractGuidedSectionLib.h>\r
\r
-#define PEI_EXTRACT_HANDLER_INFO_SIGNATURE EFI_SIGNATURE_32 ('P', 'E', 'H', 'I')\r
+#define PEI_EXTRACT_HANDLER_INFO_SIGNATURE SIGNATURE_32 ('P', 'E', 'H', 'I')\r
\r
typedef struct {\r
UINT32 Signature;\r
Build guid hob for the global memory to store the registered guid and Handler list.\r
If GuidHob exists, HandlerInfo will be directly got from Guid hob data.\r
\r
- @param[in, out] InfoPointer Pointer to pei handler info structure.\r
+ @param[in, out] InfoPointer The pointer to pei handler information structure.\r
\r
@retval RETURN_SUCCESS Build Guid hob for the global memory space to store guid and function tables.\r
@retval RETURN_OUT_OF_RESOURCES No enough memory to allocated.\r
EFI_PEI_HOB_POINTERS Hob;\r
\r
//\r
- // First try to get handler info from guid hob specified by CallerId.\r
+ // First try to get handler information from guid hob specified by CallerId.\r
//\r
Hob.Raw = GetNextHob (EFI_HOB_TYPE_GUID_EXTENSION, GetHobList ());\r
while (Hob.Raw != NULL) {\r
HandlerInfo->ExtractGetInfoHandlerTable = (EXTRACT_GUIDED_SECTION_GET_INFO_HANDLER *) (\r
(UINT8 *)HandlerInfo->ExtractDecodeHandlerTable + \r
PcdGet32 (PcdMaximumGuidedExtractHandler) * \r
- sizeof (EXTRACT_GUIDED_SECTION_GET_INFO_HANDLER)\r
+ sizeof (EXTRACT_GUIDED_SECTION_DECODE_HANDLER)\r
);\r
}\r
//\r
//\r
// No enough resource to build guid hob.\r
//\r
+ *InfoPointer = NULL;\r
return EFI_OUT_OF_RESOURCES;\r
}\r
//\r
HandlerInfo->ExtractGetInfoHandlerTable = (EXTRACT_GUIDED_SECTION_GET_INFO_HANDLER *) (\r
(UINT8 *)HandlerInfo->ExtractDecodeHandlerTable + \r
PcdGet32 (PcdMaximumGuidedExtractHandler) * \r
- sizeof (EXTRACT_GUIDED_SECTION_GET_INFO_HANDLER)\r
+ sizeof (EXTRACT_GUIDED_SECTION_DECODE_HANDLER)\r
);\r
//\r
// return the created HandlerInfo.\r
//\r
Status = PeiGetExtractGuidedSectionHandlerInfo (&HandlerInfo);\r
if (EFI_ERROR (Status)) {\r
- return Status;\r
+ *ExtractHandlerGuidTable = NULL;\r
+ return 0;\r
}\r
\r
//\r
\r
@param[in] SectionGuid A pointer to the GUID associated with the the handlers\r
of the GUIDed section type being registered.\r
- @param[in] GetInfoHandler Pointer to a function that examines a GUIDed section and returns the\r
+ @param[in] GetInfoHandler The pointer to a function that examines a GUIDed section and returns the\r
size of the decoded buffer and the size of an optional scratch buffer\r
required to actually decode the data in a GUIDed section.\r
- @param[in] DecodeHandler Pointer to a function that decodes a GUIDed section into a caller\r
+ @param[in] DecodeHandler The pointer to a function that decodes a GUIDed section into a caller\r
allocated output buffer. \r
\r
@retval RETURN_SUCCESS The handlers were registered.\r
CopyGuid (HandlerInfo->ExtractHandlerGuidTable + HandlerInfo->NumberOfExtractHandler, SectionGuid);\r
HandlerInfo->ExtractDecodeHandlerTable [HandlerInfo->NumberOfExtractHandler] = DecodeHandler;\r
HandlerInfo->ExtractGetInfoHandlerTable [HandlerInfo->NumberOfExtractHandler++] = GetInfoHandler;\r
- \r
+\r
return RETURN_SUCCESS;\r
}\r
\r
for (Index = 0; Index < HandlerInfo->NumberOfExtractHandler; Index ++) {\r
if (CompareGuid (HandlerInfo->ExtractHandlerGuidTable + Index, &(((EFI_GUID_DEFINED_SECTION *) InputSection)->SectionDefinitionGuid))) {\r
//\r
- // Call the match handler to get info for the input section data.\r
+ // Call the match handler to get information for the input section data.\r
//\r
return HandlerInfo->ExtractGetInfoHandlerTable [Index] (\r
InputSection,\r