summaryrefslogtreecommitdiffstats
path: root/MdePkg/Library/PeiExtractGuidedSectionLib
diff options
context:
space:
mode:
authorlgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524>2008-08-18 12:11:37 +0000
committerlgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524>2008-08-18 12:11:37 +0000
commitb911d09f5525e5bb27d5c9dffcfd6120e095ac84 (patch)
tree657ff1575c56b81d968d90f29238313fae127816 /MdePkg/Library/PeiExtractGuidedSectionLib
parentd1a44d08c1b221669e88f27801b3e4ae26d7fd96 (diff)
downloadedk2-b911d09f5525e5bb27d5c9dffcfd6120e095ac84.tar.gz
edk2-b911d09f5525e5bb27d5c9dffcfd6120e095ac84.tar.bz2
edk2-b911d09f5525e5bb27d5c9dffcfd6120e095ac84.zip
Code Clean up for IfrSupportLib, HiiLib, PeiExtractGuidedSectionLib and DxeExtractGuidedSectionLib,
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@5687 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdePkg/Library/PeiExtractGuidedSectionLib')
-rw-r--r--MdePkg/Library/PeiExtractGuidedSectionLib/PeiExtractGuidedSectionLib.c64
-rw-r--r--MdePkg/Library/PeiExtractGuidedSectionLib/PeiExtractGuidedSectionLib.inf2
2 files changed, 27 insertions, 39 deletions
diff --git a/MdePkg/Library/PeiExtractGuidedSectionLib/PeiExtractGuidedSectionLib.c b/MdePkg/Library/PeiExtractGuidedSectionLib/PeiExtractGuidedSectionLib.c
index 2b09c46cc9..72add417b6 100644
--- a/MdePkg/Library/PeiExtractGuidedSectionLib/PeiExtractGuidedSectionLib.c
+++ b/MdePkg/Library/PeiExtractGuidedSectionLib/PeiExtractGuidedSectionLib.c
@@ -196,20 +196,16 @@ ExtractGuidedSectionRegisterHandlers (
//
for (Index = 0; Index < HandlerInfo->NumberOfExtractHandler; Index ++) {
if (CompareGuid (HandlerInfo->ExtractHandlerGuidTable + Index, SectionGuid)) {
- break;
+ //
+ // If the guided handler has been registered before, only update its handler.
+ //
+ HandlerInfo->ExtractDecodeHandlerTable [Index] = DecodeHandler;
+ HandlerInfo->ExtractGetInfoHandlerTable [Index] = GetInfoHandler;
+ return RETURN_SUCCESS;
}
}
//
- // If the guided handler has been registered before, only update its handler.
- //
- if (Index < HandlerInfo->NumberOfExtractHandler) {
- HandlerInfo->ExtractDecodeHandlerTable [Index] = DecodeHandler;
- HandlerInfo->ExtractGetInfoHandlerTable [Index] = GetInfoHandler;
- return RETURN_SUCCESS;
- }
-
- //
// Check the global table is enough to contain new Handler.
//
if (HandlerInfo->NumberOfExtractHandler >= PcdGet32 (PcdMaximumGuidedExtractHandler)) {
@@ -284,26 +280,22 @@ ExtractGuidedSectionGetInfo (
//
for (Index = 0; Index < HandlerInfo->NumberOfExtractHandler; Index ++) {
if (CompareGuid (HandlerInfo->ExtractHandlerGuidTable + Index, &(((EFI_GUID_DEFINED_SECTION *) InputSection)->SectionDefinitionGuid))) {
- break;
+ //
+ // Call the match handler to getinfo for the input section data.
+ //
+ return HandlerInfo->ExtractGetInfoHandlerTable [Index] (
+ InputSection,
+ OutputBufferSize,
+ ScratchBufferSize,
+ SectionAttribute
+ );
}
}
//
// Not found, the input guided section is not supported.
//
- if (Index == HandlerInfo->NumberOfExtractHandler) {
- return RETURN_UNSUPPORTED;
- }
-
- //
- // Call the match handler to getinfo for the input section data.
- //
- return HandlerInfo->ExtractGetInfoHandlerTable [Index] (
- InputSection,
- OutputBufferSize,
- ScratchBufferSize,
- SectionAttribute
- );
+ return RETURN_UNSUPPORTED;
}
/**
@@ -366,24 +358,20 @@ ExtractGuidedSectionDecode (
//
for (Index = 0; Index < HandlerInfo->NumberOfExtractHandler; Index ++) {
if (CompareGuid (HandlerInfo->ExtractHandlerGuidTable + Index, &(((EFI_GUID_DEFINED_SECTION *) InputSection)->SectionDefinitionGuid))) {
- break;
+ //
+ // Call the match handler to extract raw data for the input guided section.
+ //
+ return HandlerInfo->ExtractDecodeHandlerTable [Index] (
+ InputSection,
+ OutputBuffer,
+ ScratchBuffer,
+ AuthenticationStatus
+ );
}
}
//
// Not found, the input guided section is not supported.
//
- if (Index == HandlerInfo->NumberOfExtractHandler) {
- return RETURN_UNSUPPORTED;
- }
-
- //
- // Call the match handler to extract raw data for the input guided section.
- //
- return HandlerInfo->ExtractDecodeHandlerTable [Index] (
- InputSection,
- OutputBuffer,
- ScratchBuffer,
- AuthenticationStatus
- );
+ return RETURN_UNSUPPORTED;
}
diff --git a/MdePkg/Library/PeiExtractGuidedSectionLib/PeiExtractGuidedSectionLib.inf b/MdePkg/Library/PeiExtractGuidedSectionLib/PeiExtractGuidedSectionLib.inf
index d0853d261e..b84ee05581 100644
--- a/MdePkg/Library/PeiExtractGuidedSectionLib/PeiExtractGuidedSectionLib.inf
+++ b/MdePkg/Library/PeiExtractGuidedSectionLib/PeiExtractGuidedSectionLib.inf
@@ -42,7 +42,7 @@
DebugLib
HobLib
-[FixedPcd.common]
+[Pcd.common]
gEfiMdePkgTokenSpaceGuid.PcdMaximumGuidedExtractHandler