17#define PEI_EXTRACT_HANDLER_INFO_SIGNATURE SIGNATURE_32 ('P', 'E', 'H', 'I')
21 UINT32 NumberOfExtractHandler;
22 GUID *ExtractHandlerGuidTable;
48 while (Hob.Raw !=
NULL) {
51 if (HandlerInfo->Signature == PEI_EXTRACT_HANDLER_INFO_SIGNATURE) {
55 if (HandlerInfo->ExtractHandlerGuidTable != (
GUID *)(HandlerInfo + 1)) {
56 HandlerInfo->ExtractHandlerGuidTable = (
GUID *)(HandlerInfo + 1);
58 (UINT8 *)HandlerInfo->ExtractHandlerGuidTable +
59 PcdGet32 (PcdMaximumGuidedExtractHandler) *
sizeof (
GUID)
62 (UINT8 *)HandlerInfo->ExtractDecodeHandlerTable +
63 PcdGet32 (PcdMaximumGuidedExtractHandler) *
71 *InfoPointer = HandlerInfo;
76 Hob.Raw = GET_NEXT_HOB (Hob);
77 Hob.Raw =
GetNextHob (EFI_HOB_TYPE_GUID_EXTENSION, Hob.Raw);
86 PcdGet32 (PcdMaximumGuidedExtractHandler) *
89 if (HandlerInfo ==
NULL) {
94 return EFI_OUT_OF_RESOURCES;
100 HandlerInfo->Signature = PEI_EXTRACT_HANDLER_INFO_SIGNATURE;
101 HandlerInfo->NumberOfExtractHandler = 0;
102 HandlerInfo->ExtractHandlerGuidTable = (
GUID *)(HandlerInfo + 1);
104 (UINT8 *)HandlerInfo->ExtractHandlerGuidTable +
105 PcdGet32 (PcdMaximumGuidedExtractHandler) *
sizeof (
GUID)
108 (UINT8 *)HandlerInfo->ExtractDecodeHandlerTable +
109 PcdGet32 (PcdMaximumGuidedExtractHandler) *
115 *InfoPointer = HandlerInfo;
136 OUT GUID **ExtractHandlerGuidTable
142 ASSERT (ExtractHandlerGuidTable !=
NULL);
148 if (EFI_ERROR (Status)) {
149 *ExtractHandlerGuidTable =
NULL;
156 ASSERT (HandlerInfo !=
NULL);
157 *ExtractHandlerGuidTable = HandlerInfo->ExtractHandlerGuidTable;
158 return HandlerInfo->NumberOfExtractHandler;
200 ASSERT (SectionGuid !=
NULL);
201 ASSERT (GetInfoHandler !=
NULL);
202 ASSERT (DecodeHandler !=
NULL);
208 if (EFI_ERROR (Status)) {
215 ASSERT (HandlerInfo !=
NULL);
216 for (Index = 0; Index < HandlerInfo->NumberOfExtractHandler; Index++) {
217 if (
CompareGuid (HandlerInfo->ExtractHandlerGuidTable + Index, SectionGuid)) {
221 HandlerInfo->ExtractDecodeHandlerTable[Index] = DecodeHandler;
222 HandlerInfo->ExtractGetInfoHandlerTable[Index] = GetInfoHandler;
230 if (HandlerInfo->NumberOfExtractHandler >=
PcdGet32 (PcdMaximumGuidedExtractHandler)) {
237 CopyGuid (HandlerInfo->ExtractHandlerGuidTable + HandlerInfo->NumberOfExtractHandler, SectionGuid);
238 HandlerInfo->ExtractDecodeHandlerTable[HandlerInfo->NumberOfExtractHandler] = DecodeHandler;
239 HandlerInfo->ExtractGetInfoHandlerTable[HandlerInfo->NumberOfExtractHandler++] = GetInfoHandler;
292 OUT UINT32 *OutputBufferSize,
293 OUT UINT32 *ScratchBufferSize,
294 OUT UINT16 *SectionAttribute
305 ASSERT (InputSection !=
NULL);
306 ASSERT (OutputBufferSize !=
NULL);
307 ASSERT (ScratchBufferSize !=
NULL);
308 ASSERT (SectionAttribute !=
NULL);
314 if (EFI_ERROR (Status)) {
318 if (IS_SECTION2 (InputSection)) {
327 ASSERT (HandlerInfo !=
NULL);
328 for (Index = 0; Index < HandlerInfo->NumberOfExtractHandler; Index++) {
329 if (
CompareGuid (HandlerInfo->ExtractHandlerGuidTable + Index, SectionDefinitionGuid)) {
333 return HandlerInfo->ExtractGetInfoHandlerTable[Index](
387 OUT VOID **OutputBuffer,
388 IN VOID *ScratchBuffer OPTIONAL,
389 OUT UINT32 *AuthenticationStatus
400 ASSERT (InputSection !=
NULL);
401 ASSERT (OutputBuffer !=
NULL);
402 ASSERT (AuthenticationStatus !=
NULL);
408 if (EFI_ERROR (Status)) {
412 if (IS_SECTION2 (InputSection)) {
421 ASSERT (HandlerInfo !=
NULL);
422 for (Index = 0; Index < HandlerInfo->NumberOfExtractHandler; Index++) {
423 if (
CompareGuid (HandlerInfo->ExtractHandlerGuidTable + Index, SectionDefinitionGuid)) {
427 return HandlerInfo->ExtractDecodeHandlerTable[Index](
484 ASSERT (SectionGuid !=
NULL);
490 if (EFI_ERROR (Status)) {
497 ASSERT (HandlerInfo !=
NULL);
498 for (Index = 0; Index < HandlerInfo->NumberOfExtractHandler; Index++) {
499 if (
CompareGuid (HandlerInfo->ExtractHandlerGuidTable + Index, SectionGuid)) {
503 if (GetInfoHandler !=
NULL) {
504 *GetInfoHandler = HandlerInfo->ExtractGetInfoHandlerTable[Index];
507 if (DecodeHandler !=
NULL) {
508 *DecodeHandler = HandlerInfo->ExtractDecodeHandlerTable[Index];
VOID *EFIAPI BuildGuidDataHob(IN CONST EFI_GUID *Guid, IN VOID *Data, IN UINTN DataLength)
VOID *EFIAPI BuildGuidHob(IN CONST EFI_GUID *Guid, IN UINTN DataLength)
VOID *EFIAPI GetNextHob(IN UINT16 Type, IN CONST VOID *HobStart)
VOID *EFIAPI GetHobList(VOID)
BOOLEAN EFIAPI CompareGuid(IN CONST GUID *Guid1, IN CONST GUID *Guid2)
GUID *EFIAPI CopyGuid(OUT GUID *DestinationGuid, IN CONST GUID *SourceGuid)
#define RETURN_UNSUPPORTED
#define RETURN_OUT_OF_RESOURCES
#define PcdGet32(TokenName)