X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=MdePkg%2FInclude%2FLibrary%2FExtractGuidedSectionLib.h;h=539b98d41a2c9b4c2d3d38f17669ca4513c13571;hb=f405c0674aef0fb8bff34acb0011c47f7cd38ea6;hp=be963cb5a7dca4ce10369887f29b88e42fb371a2;hpb=f1db45f81a6593de93727ac2a0bb3c1a36e61298;p=mirror_edk2.git diff --git a/MdePkg/Include/Library/ExtractGuidedSectionLib.h b/MdePkg/Include/Library/ExtractGuidedSectionLib.h index be963cb5a7..539b98d41a 100644 --- a/MdePkg/Include/Library/ExtractGuidedSectionLib.h +++ b/MdePkg/Include/Library/ExtractGuidedSectionLib.h @@ -1,8 +1,17 @@ /** @file This library provides common functions to process the different guided section data. + + This library provides functions to process GUIDed sections of FFS files. Handlers may + be registered to decode GUIDed sections of FFS files. Services are provided to determine + the set of supported section GUIDs, collection information about a specific GUIDed section, + and decode a specific GUIDed section. + + A library instance that produces this library class may be used to produce a + EFI_PEI_GUIDED_SECTION_EXTRACTION_PPI or a EFI_GUIDED_SECTION_EXTRACTION_PROTOCOL + providing a simple method to extend the number of GUIDed sections types a platform supports. -Copyright (c) 2006 - 2008, Intel Corporation -All rights reserved. This program and the accompanying materials +Copyright (c) 2006 - 2010, Intel Corporation. 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 @@ -27,6 +36,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. then the size required to hold the decoded buffer is returned in OututBufferSize, the size of an optional scratch buffer is returned in ScratchSize, and the Attributes field from EFI_GUID_DEFINED_SECTION header of InputSection is returned in SectionAttribute. + If InputSection is NULL, then ASSERT(). If OutputBufferSize is NULL, then ASSERT(). If ScratchBufferSize is NULL, then ASSERT(). @@ -66,6 +76,7 @@ RETURN_STATUS decode operation is returned in AuthenticationStatus. If the decoded buffer is identical to the data in InputSection, then OutputBuffer is set to point at the data in InputSection. Otherwise, the decoded data will be placed in caller allocated buffer specified by OutputBuffer. + If InputSection is NULL, then ASSERT(). If OutputBuffer is NULL, then ASSERT(). If ScratchBuffer is NULL and this decode operation requires a scratch buffer, then ASSERT(). @@ -83,7 +94,7 @@ RETURN_STATUS never be set by this handler. @retval RETURN_SUCCESS The buffer specified by InputSection was decoded. - @retval RETURN_UNSPPORTED The section specified by InputSection does not match the GUID this handler supports. + @retval RETURN_UNSUPPORTED The section specified by InputSection does not match the GUID this handler supports. @retval RETURN_INVALID_PARAMETER The section specified by InputSection can not be decoded. **/ @@ -100,9 +111,10 @@ RETURN_STATUS Registers handlers of type EXTRACT_GUIDED_SECTION_GET_INFO_HANDLER and EXTRACT_GUIDED_SECTION_DECODE_HANDLER for a specific GUID section type. - Registers the handlers specified by GetInfoHandler and DecodeHandler witg the GUID specified by SectionGuid. + Registers the handlers specified by GetInfoHandler and DecodeHandler with the GUID specified by SectionGuid. If the GUID value specified by SectionGuid has already been registered, then return RETURN_ALREADY_STARTED. If there are not enough resources available to register the handlers then RETURN_OUT_OF_RESOURCES is returned. + If SectionGuid is NULL, then ASSERT(). If GetInfoHandler is NULL, then ASSERT(). If DecodeHandler is NULL, then ASSERT(). @@ -116,7 +128,6 @@ RETURN_STATUS allocated output buffer. @retval RETURN_SUCCESS The handlers were registered. - @retval RETURN_ALREADY_STARTED Handlers have already been registered for the GUID specified by SectionGuid. @retval RETURN_OUT_OF_RESOURCES There are not enough resources available to register the handlers. **/ @@ -136,7 +147,7 @@ ExtractGuidedSectionRegisterHandlers ( and caller must treat this array of GUIDs as read-only data. If ExtractHandlerGuidTable is NULL, then ASSERT(). - @param[out] ExtractHandlerGuidTable A pointer to the array of GUIDs tht have been registerd through + @param[out] ExtractHandlerGuidTable A pointer to the array of GUIDs that have been registered through ExtractGuidedSectionRegisterHandlers(). @return the number of the supported extract guided Handler. @@ -149,7 +160,7 @@ ExtractGuidedSectionGetGuidList ( ); /** - Retrives a GUID from a GUIDed section and uses that GUID to select an associated handler of type + Retrieves a GUID from a GUIDed section and uses that GUID to select an associated handler of type EXTRACT_GUIDED_SECTION_GET_INFO_HANDLER that was registered with ExtractGuidedSectionRegisterHandlers(). The selected handler is used to retrieve and return the size of the decoded buffer and the size of an optional scratch buffer required to actually decode the data in a GUIDed section. @@ -161,6 +172,7 @@ ExtractGuidedSectionGetGuidList ( of type EXTRACT_GUIDED_SECTION_GET_INFO_HANDLER that was registered with ExtractGuidedSectionRegisterHandlers() is used to retrieve the OututBufferSize, ScratchSize, and Attributes values. The return status from the handler of type EXTRACT_GUIDED_SECTION_GET_INFO_HANDLER is returned. + If InputSection is NULL, then ASSERT(). If OutputBufferSize is NULL, then ASSERT(). If ScratchBufferSize is NULL, then ASSERT(). @@ -191,7 +203,7 @@ ExtractGuidedSectionGetInfo ( ); /** - Retrives the GUID from a GUIDed section and uses that GUID to select an associated handler of type + Retrieves the GUID from a GUIDed section and uses that GUID to select an associated handler of type EXTRACT_GUIDED_SECTION_DECODE_HANDLER that was registered with ExtractGuidedSectionRegisterHandlers(). The selected handler is used to decode the data in a GUIDed section and return the result in a caller allocated output buffer. @@ -205,7 +217,8 @@ ExtractGuidedSectionGetInfo ( decode operation is returned in AuthenticationStatus. If the decoded buffer is identical to the data in InputSection, then OutputBuffer is set to point at the data in InputSection. Otherwise, the decoded data will be placed in caller allocated buffer specified by OutputBuffer. This function is responsible for computing the EFI_AUTH_STATUS_PLATFORM_OVERRIDE - bit of in AuthenticationStatus. The return status from the handler of type EXTRACT_GUIDED_SECTION_DECODE_HANDLER is returned. + bit of in AuthenticationStatus. The return status from the handler of type EXTRACT_GUIDED_SECTION_DECODE_HANDLER is returned. + If InputSection is NULL, then ASSERT(). If OutputBuffer is NULL, then ASSERT(). If ScratchBuffer is NULL and this decode operation requires a scratch buffer, then ASSERT(). @@ -233,4 +246,39 @@ ExtractGuidedSectionDecode ( OUT UINT32 *AuthenticationStatus ); +/** + Retrieves handlers of type EXTRACT_GUIDED_SECTION_GET_INFO_HANDLER and + EXTRACT_GUIDED_SECTION_DECODE_HANDLER for a specific GUID section type. + + Retrieves the handlers associated with SectionGuid and returns them in + GetInfoHandler and DecodeHandler. + + If the GUID value specified by SectionGuid has not been registered, then + return RETURN_NOT_FOUND. + + If SectionGuid is NULL, then ASSERT(). + + @param[in] SectionGuid A pointer to the GUID associated with the handlersof the GUIDed + section type being retrieved. + @param[out] GetInfoHandler Pointer to a function that examines a GUIDed section and returns + the size of the decoded buffer and the size of an optional scratch + buffer required to actually decode the data in a GUIDed section. + This is an optional parameter that may be NULL. If it is NULL, then + the previously registered handler is not returned. + @param[out] DecodeHandler Pointer to a function that decodes a GUIDed section into a caller + allocated output buffer. This is an optional parameter that may be NULL. + If it is NULL, then the previously registered handler is not returned. + + @retval RETURN_SUCCESS The handlers were retrieved. + @retval RETURN_NOT_FOUND No handlers have been registered with the specified GUID. + +**/ +RETURN_STATUS +EFIAPI +ExtractGuidedSectionGetHandlers ( + IN CONST GUID *SectionGuid, + OUT EXTRACT_GUIDED_SECTION_GET_INFO_HANDLER *GetInfoHandler, OPTIONAL + OUT EXTRACT_GUIDED_SECTION_DECODE_HANDLER *DecodeHandler OPTIONAL + ); + #endif