X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=EmbeddedPkg%2FLibrary%2FPrePiExtractGuidedSectionLib%2FPrePiExtractGuidedSectionLib.c;h=7b08de8ab9fe58fa8afff9dada4559af5638b885;hp=b635fa0d9e22fbae9bb787341a4640cf2f84da24;hb=4f0624e87a89afce8408a87997482b383e7ba131;hpb=2ef2b01e07c02db339f34004445734a2dbdd80e1 diff --git a/EmbeddedPkg/Library/PrePiExtractGuidedSectionLib/PrePiExtractGuidedSectionLib.c b/EmbeddedPkg/Library/PrePiExtractGuidedSectionLib/PrePiExtractGuidedSectionLib.c index b635fa0d9e..7b08de8ab9 100644 --- a/EmbeddedPkg/Library/PrePiExtractGuidedSectionLib/PrePiExtractGuidedSectionLib.c +++ b/EmbeddedPkg/Library/PrePiExtractGuidedSectionLib/PrePiExtractGuidedSectionLib.c @@ -1,8 +1,8 @@ /** @file - Copyright (c) 2008-2009, Apple Inc. All rights reserved. - - All rights reserved. This program and the accompanying materials + Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.
+ + This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at http://opensource.org/licenses/bsd-license.php @@ -38,7 +38,7 @@ GetSavedData ( GuidHob = GetFirstGuidHob(&SavedDataGuid); GuidHob++; - + return (PRE_PI_EXTRACT_GUIDED_SECTION_DATA *)GuidHob; } @@ -53,7 +53,7 @@ ExtractGuidedSectionRegisterHandlers ( PRE_PI_EXTRACT_GUIDED_SECTION_DATA *SavedData; UINT32 Index; // - // Check input paramter. + // Check input parameter. // if (SectionGuid == NULL) { return RETURN_INVALID_PARAMETER; @@ -78,21 +78,21 @@ ExtractGuidedSectionRegisterHandlers ( SavedData->ExtractGetInfoHandlerTable [Index] = GetInfoHandler; return RETURN_SUCCESS; } - + // // Check the global table is enough to contain new Handler. // if (SavedData->NumberOfExtractHandler >= PcdGet32 (PcdMaximumGuidedExtractHandler)) { return RETURN_OUT_OF_RESOURCES; } - + // // Register new Handler and guid value. // CopyGuid (&SavedData->ExtractHandlerGuidTable [SavedData->NumberOfExtractHandler], SectionGuid); SavedData->ExtractDecodeHandlerTable [SavedData->NumberOfExtractHandler] = DecodeHandler; SavedData->ExtractGetInfoHandlerTable [SavedData->NumberOfExtractHandler++] = GetInfoHandler; - + return RETURN_SUCCESS; } @@ -105,9 +105,9 @@ ExtractGuidedSectionGetGuidList ( PRE_PI_EXTRACT_GUIDED_SECTION_DATA *SavedData; ASSERT(ExtractHandlerGuidTable != NULL); - + SavedData = GetSavedData(); - + *ExtractHandlerGuidTable = SavedData->ExtractHandlerGuidTable; return SavedData->NumberOfExtractHandler; } @@ -118,20 +118,20 @@ ExtractGuidedSectionGetInfo ( IN CONST VOID *InputSection, OUT UINT32 *OutputBufferSize, OUT UINT32 *ScratchBufferSize, - OUT UINT16 *SectionAttribute + OUT UINT16 *SectionAttribute ) { PRE_PI_EXTRACT_GUIDED_SECTION_DATA *SavedData; UINT32 Index; - + if (InputSection == NULL) { return RETURN_INVALID_PARAMETER; } - + ASSERT (OutputBufferSize != NULL); ASSERT (ScratchBufferSize != NULL); ASSERT (SectionAttribute != NULL); - + SavedData = GetSavedData(); // @@ -144,7 +144,7 @@ ExtractGuidedSectionGetInfo ( } // - // Not found, the input guided section is not supported. + // Not found, the input guided section is not supported. // if (Index == SavedData->NumberOfExtractHandler) { return RETURN_INVALID_PARAMETER; @@ -167,16 +167,16 @@ ExtractGuidedSectionDecode ( IN CONST VOID *InputSection, OUT VOID **OutputBuffer, OUT VOID *ScratchBuffer, OPTIONAL - OUT UINT32 *AuthenticationStatus + OUT UINT32 *AuthenticationStatus ) { PRE_PI_EXTRACT_GUIDED_SECTION_DATA *SavedData; UINT32 Index; - + if (InputSection == NULL) { return RETURN_INVALID_PARAMETER; } - + ASSERT (OutputBuffer != NULL); ASSERT (AuthenticationStatus != NULL); @@ -192,7 +192,7 @@ ExtractGuidedSectionDecode ( } // - // Not found, the input guided section is not supported. + // Not found, the input guided section is not supported. // if (Index == SavedData->NumberOfExtractHandler) { return RETURN_INVALID_PARAMETER; @@ -225,7 +225,7 @@ ExtractGuidedSectionLibConstructor ( if (SavedData.ExtractHandlerGuidTable == NULL) { return RETURN_OUT_OF_RESOURCES; } - + SavedData.ExtractDecodeHandlerTable = (EXTRACT_GUIDED_SECTION_DECODE_HANDLER *)AllocatePool(PcdGet32(PcdMaximumGuidedExtractHandler) * sizeof(EXTRACT_GUIDED_SECTION_DECODE_HANDLER)); if (SavedData.ExtractDecodeHandlerTable == NULL) { return RETURN_OUT_OF_RESOURCES; @@ -235,13 +235,13 @@ ExtractGuidedSectionLibConstructor ( if (SavedData.ExtractGetInfoHandlerTable == NULL) { return RETURN_OUT_OF_RESOURCES; } - + // // the initialized number is Zero. // SavedData.NumberOfExtractHandler = 0; - + BuildGuidDataHob(&HobGuid, &SavedData, sizeof(SavedData)); - + return RETURN_SUCCESS; }