X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=MdeModulePkg%2FCore%2FPei%2FDispatcher%2FDispatcher.c;h=bdbb00b205f86dcec674c108743fe5a830811168;hp=346398714947a8772f5884e2f16c079cece7451d;hb=f3198cba84f56f85281b87c4e9bf96e77a934f16;hpb=1bd90a4c479759542f86dbac953855552cbb31fa diff --git a/MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c b/MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c index 3463987149..bdbb00b205 100644 --- a/MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c +++ b/MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c @@ -1,7 +1,7 @@ /** @file EFI PEI Core dispatch services -Copyright (c) 2006, Intel Corporation +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 @@ -12,10 +12,10 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. **/ -#include +#include "PeiMain.h" /// -/// CAR is filled with this initial value during SEC phase +/// temporary memory is filled with this initial value during SEC phase /// #define INIT_CAR_VALUE 0x5AA55AA5 @@ -30,14 +30,14 @@ typedef struct { Apriori file in one FV. - @param Private - Pointer to the private data passed in from caller - @param VolumeHandle - Fv handle. + @param Private Pointer to the private data passed in from caller + @param CoreFileHandle The instance of PEI_CORE_FV_HANDLE. **/ VOID DiscoverPeimsAndOrderWithApriori ( IN PEI_CORE_INSTANCE *Private, - IN EFI_PEI_FV_HANDLE VolumeHandle + IN PEI_CORE_FV_HANDLE *CoreFileHandle ) { EFI_STATUS Status; @@ -51,7 +51,11 @@ DiscoverPeimsAndOrderWithApriori ( EFI_GUID *Guid; EFI_PEI_FV_HANDLE TempFileHandles[FixedPcdGet32 (PcdPeiCoreMaxPeimPerFv)]; EFI_GUID FileGuid[FixedPcdGet32 (PcdPeiCoreMaxPeimPerFv)]; - + EFI_PEI_FIRMWARE_VOLUME_PPI *FvPpi; + EFI_FV_FILE_INFO FileInfo; + + FvPpi = CoreFileHandle->FvPpi; + // // Walk the FV and find all the PEIMs and the Apriori file. // @@ -71,33 +75,39 @@ DiscoverPeimsAndOrderWithApriori ( // // Go ahead to scan this Fv, and cache FileHandles within it. // - for (PeimCount = 0; PeimCount < FixedPcdGet32 (PcdPeiCoreMaxPeimPerFv); PeimCount++) { - Status = PeiFindFileEx ( - VolumeHandle, - NULL, - PEI_CORE_INTERNAL_FFS_FILE_DISPATCH_TYPE, - &FileHandle, - &AprioriFileHandle - ); + for (PeimCount = 0; PeimCount < PcdGet32 (PcdPeiCoreMaxPeimPerFv); PeimCount++) { + Status = FvPpi->FindFileByType (FvPpi, PEI_CORE_INTERNAL_FFS_FILE_DISPATCH_TYPE, CoreFileHandle->FvHandle, &FileHandle); if (Status != EFI_SUCCESS) { break; } Private->CurrentFvFileHandles[PeimCount] = FileHandle; } + + // + // Check whether the count of Peims exceeds the max support PEIMs in a FV image + // If more Peims are required in a FV image, PcdPeiCoreMaxPeimPerFv can be set to a larger value in DSC file. + // + ASSERT (PeimCount < PcdGet32 (PcdPeiCoreMaxPeimPerFv)); + // + // Get Apriori File handle + // Private->AprioriCount = 0; - if (AprioriFileHandle != NULL) { + Status = FvPpi->FindFileByName (FvPpi, &gPeiAprioriFileNameGuid, &CoreFileHandle->FvHandle, &AprioriFileHandle); + if (!EFI_ERROR(Status) && AprioriFileHandle != NULL) { // // Read the Apriori file // - Status = PeiServicesFfsFindSectionData (EFI_SECTION_RAW, AprioriFileHandle, (VOID **) &Apriori); + Status = FvPpi->FindSectionByType (FvPpi, EFI_SECTION_RAW, AprioriFileHandle, (VOID **) &Apriori); if (!EFI_ERROR (Status)) { // // Calculate the number of PEIMs in the A Priori list // - Private->AprioriCount = *(UINT32 *)(((EFI_FFS_FILE_HEADER *)AprioriFileHandle)->Size) & 0x00FFFFFF; - Private->AprioriCount -= sizeof (EFI_FFS_FILE_HEADER) - sizeof (EFI_COMMON_SECTION_HEADER); + Status = FvPpi->GetFileInfo (FvPpi, AprioriFileHandle, &FileInfo); + ASSERT_EFI_ERROR (Status); + Private->AprioriCount = FileInfo.BufferSize & 0x00FFFFFF; + Private->AprioriCount -= sizeof (EFI_COMMON_SECTION_HEADER); Private->AprioriCount /= sizeof (EFI_GUID); ZeroMem (FileGuid, sizeof (FileGuid)); @@ -106,7 +116,8 @@ DiscoverPeimsAndOrderWithApriori ( // Make an array of file name guids that matches the FileHandle array so we can convert // quickly from file name to file handle // - CopyMem (&FileGuid[Index], &((EFI_FFS_FILE_HEADER *)Private->CurrentFvFileHandles[Index])->Name,sizeof(EFI_GUID)); + Status = FvPpi->GetFileInfo (FvPpi, Private->CurrentFvFileHandles[Index], &FileInfo); + CopyMem (&FileGuid[Index], &FileInfo.FileName, sizeof(EFI_GUID)); } // @@ -182,8 +193,8 @@ DiscoverPeimsAndOrderWithApriori ( **/ VOID* ShadowPeiCore( - EFI_PEI_SERVICES **PeiServices, - PEI_CORE_INSTANCE *PrivateInMem + IN CONST EFI_PEI_SERVICES **PeiServices, + IN PEI_CORE_INSTANCE *PrivateInMem ) { EFI_PEI_FILE_HANDLE PeiCoreFileHandle; @@ -196,13 +207,12 @@ ShadowPeiCore( // // Find the PEI Core in the BFV // - Status = PeiFindFileEx ( - (EFI_PEI_FV_HANDLE)PrivateInMem->Fv[0].FvHeader, - NULL, - EFI_FV_FILETYPE_PEI_CORE, - &PeiCoreFileHandle, - NULL - ); + Status = PrivateInMem->Fv[0].FvPpi->FindFileByType ( + PrivateInMem->Fv[0].FvPpi, + EFI_FV_FILETYPE_PEI_CORE, + PrivateInMem->Fv[0].FvHandle, + &PeiCoreFileHandle + ); ASSERT_EFI_ERROR (Status); // @@ -211,6 +221,7 @@ ShadowPeiCore( Status = PeiLoadImage ( PeiServices, *((EFI_PEI_FILE_HANDLE*)&PeiCoreFileHandle), + PEIM_STATE_REGISITER_FOR_SHADOW, &EntryPoint, &AuthenticationState ); @@ -231,9 +242,6 @@ ShadowPeiCore( the BFV location. @param Private Pointer to the private data passed in from caller - @retval EFI_SUCCESS - Successfully dispatched PEIM. - @retval EFI_NOT_FOUND - The dispatch failed. - **/ VOID PeiDispatcher ( @@ -244,8 +252,7 @@ PeiDispatcher ( EFI_STATUS Status; UINT32 Index1; UINT32 Index2; - EFI_PEI_SERVICES **PeiServices; - EFI_PEI_FV_HANDLE VolumeHandle; + CONST EFI_PEI_SERVICES **PeiServices; EFI_PEI_FILE_HANDLE PeimFileHandle; UINTN FvCount; UINTN PeimCount; @@ -269,9 +276,9 @@ PeiDispatcher ( EFI_FV_FILE_INFO FvFileInfo; UINTN OldCheckingTop; UINTN OldCheckingBottom; + PEI_CORE_FV_HANDLE *CoreFvHandle; - - PeiServices = &Private->PS; + PeiServices = (CONST EFI_PEI_SERVICES **) &Private->PS; PeimEntryPoint = NULL; PeimFileHandle = NULL; EntryPoint = 0; @@ -286,12 +293,13 @@ PeiDispatcher ( SaveCurrentFileHandle = Private->CurrentFileHandle; for (Index1 = 0; Index1 <= SaveCurrentFvCount; Index1++) { - for (Index2 = 0; (Index2 < FixedPcdGet32 (PcdPeiCoreMaxPeimPerFv)) && (Private->Fv[Index1].FvFileHandles[Index2] != NULL); Index2++) { + for (Index2 = 0; (Index2 < PcdGet32 (PcdPeiCoreMaxPeimPerFv)) && (Private->Fv[Index1].FvFileHandles[Index2] != NULL); Index2++) { if (Private->Fv[Index1].PeimState[Index2] == PEIM_STATE_REGISITER_FOR_SHADOW) { PeimFileHandle = Private->Fv[Index1].FvFileHandles[Index2]; Status = PeiLoadImage ( - &Private->PS, + (CONST EFI_PEI_SERVICES **) &Private->PS, PeimFileHandle, + PEIM_STATE_REGISITER_FOR_SHADOW, &EntryPoint, &AuthenticationState ); @@ -308,9 +316,9 @@ PeiDispatcher ( // PeimEntryPoint = (EFI_PEIM_ENTRY_POINT2)(UINTN)EntryPoint; - PERF_START (0, "PEIM", NULL, 0); + PERF_START (PeimFileHandle, "PEIM", NULL, 0); PeimEntryPoint(PeimFileHandle, (const EFI_PEI_SERVICES **) &Private->PS); - PERF_END (0, "PEIM", NULL, 0); + PERF_END (PeimFileHandle, "PEIM", NULL, 0); } // @@ -346,8 +354,17 @@ PeiDispatcher ( } for (FvCount = Private->CurrentPeimFvCount; FvCount < Private->FvCount; FvCount++) { + CoreFvHandle = FindNextCoreFvHandle (Private, FvCount); + ASSERT (CoreFvHandle != NULL); + + // + // If the FV has corresponding EFI_PEI_FIRMWARE_VOLUME_PPI instance, then dispatch it. + // + if (CoreFvHandle->FvPpi == NULL) { + continue; + } + Private->CurrentPeimFvCount = FvCount; - VolumeHandle = Private->Fv[FvCount].FvHeader; if (Private->CurrentPeimCount == 0) { // @@ -355,14 +372,14 @@ PeiDispatcher ( // reorder all PEIMs to ensure the PEIMs in Apriori file to get // dispatch at first. // - DiscoverPeimsAndOrderWithApriori (Private, VolumeHandle); + DiscoverPeimsAndOrderWithApriori (Private, CoreFvHandle); } // // Start to dispatch all modules within the current Fv. // for (PeimCount = Private->CurrentPeimCount; - (PeimCount < FixedPcdGet32 (PcdPeiCoreMaxPeimPerFv)) && (Private->CurrentFvFileHandles[PeimCount] != NULL); + (PeimCount < PcdGet32 (PcdPeiCoreMaxPeimPerFv)) && (Private->CurrentFvFileHandles[PeimCount] != NULL); PeimCount++) { Private->CurrentPeimCount = PeimCount; PeimFileHandle = Private->CurrentFileHandle = Private->CurrentFvFileHandles[PeimCount]; @@ -371,13 +388,14 @@ PeiDispatcher ( if (!DepexSatisfied (Private, PeimFileHandle, PeimCount)) { Private->PeimNeedingDispatch = TRUE; } else { - Status = PeiFfsGetFileInfo (PeimFileHandle, &FvFileInfo); + Status = CoreFvHandle->FvPpi->GetFileInfo (CoreFvHandle->FvPpi, PeimFileHandle, &FvFileInfo); ASSERT_EFI_ERROR (Status); if (FvFileInfo.FileType == EFI_FV_FILETYPE_FIRMWARE_VOLUME_IMAGE) { // // For Fv type file, Produce new FV PPI and FV hob // - Status = ProcessFvFile (PeiServices, PeimFileHandle, &AuthenticationState); + Status = ProcessFvFile (&Private->Fv[FvCount], PeimFileHandle); + AuthenticationState = 0; } else { // // For PEIM driver, Load its entry point @@ -385,6 +403,7 @@ PeiDispatcher ( Status = PeiLoadImage ( PeiServices, PeimFileHandle, + PEIM_STATE_NOT_DISPATCHED, &EntryPoint, &AuthenticationState ); @@ -395,18 +414,18 @@ PeiDispatcher ( // The PEIM has its dependencies satisfied, and its entry point // has been found, so invoke it. // - PERF_START (0, "PEIM", NULL, 0); + PERF_START (PeimFileHandle, "PEIM", NULL, 0); ExtendedData.Handle = (EFI_HANDLE)PeimFileHandle; REPORT_STATUS_CODE_WITH_EXTENDED_DATA ( EFI_PROGRESS_CODE, - FixedPcdGet32(PcdStatusCodeValuePeimDispatch), + (EFI_SOFTWARE_PEI_CORE | EFI_SW_PC_INIT_BEGIN), (VOID *)(&ExtendedData), sizeof (ExtendedData) ); - Status = VerifyPeim (Private, VolumeHandle, PeimFileHandle); + Status = VerifyPeim (Private, CoreFvHandle->FvHandle, PeimFileHandle); if (Status != EFI_SECURITY_VIOLATION && (AuthenticationState == 0)) { // // PEIM_STATE_NOT_DISPATCHED move to PEIM_STATE_DISPATCHED @@ -426,17 +445,17 @@ PeiDispatcher ( REPORT_STATUS_CODE_WITH_EXTENDED_DATA ( EFI_PROGRESS_CODE, - FixedPcdGet32(PcdStatusCodeValuePeimDispatch), + (EFI_SOFTWARE_PEI_CORE | EFI_SW_PC_INIT_BEGIN), (VOID *)(&ExtendedData), sizeof (ExtendedData) ); - PERF_END (0, "PEIM", NULL, 0); + PERF_END (PeimFileHandle, "PEIM", NULL, 0); } if (Private->SwitchStackSignal) { // - // Before switch stack from CAR to permenent memory, caculate the heap and stack + // Before switch stack from temporary memory to permenent memory, caculate the heap and stack // usage in temporary memory for debuging. // DEBUG_CODE_BEGIN (); @@ -447,11 +466,11 @@ PeiDispatcher ( && (*StackPointer == INIT_CAR_VALUE); StackPointer ++); - DEBUG ((EFI_D_INFO, "Total Cache as RAM: %d bytes.\n", SecCoreData->TemporaryRamSize)); - DEBUG ((EFI_D_INFO, " CAR stack ever used: %d bytes.\n", + DEBUG ((EFI_D_INFO, "Total temporary memory: %d bytes.\n", (UINT32)SecCoreData->TemporaryRamSize)); + DEBUG ((EFI_D_INFO, " temporary memory stack ever used: %d bytes.\n", (SecCoreData->StackSize - ((UINTN) StackPointer - (UINTN)SecCoreData->StackBase)) )); - DEBUG ((EFI_D_INFO, " CAR heap used: %d bytes.\n", + DEBUG ((EFI_D_INFO, " temporary memory heap used: %d bytes.\n", ((UINTN) Private->HobList.HandoffInformationTable->EfiFreeMemoryBottom - (UINTN) Private->HobList.Raw) )); @@ -460,12 +479,12 @@ PeiDispatcher ( // // Reserve the size of new stack at bottom of physical memory // - OldPeiStackSize = Private->StackSize; + OldPeiStackSize = (UINT64) SecCoreData->StackSize; NewPeiStackSize = (RShiftU64 (Private->PhysicalMemoryLength, 1) + EFI_PAGE_MASK) & ~EFI_PAGE_MASK; - if (FixedPcdGet32(PcdPeiCoreMaxPeiStackSize) > (UINT32) NewPeiStackSize) { + if (PcdGet32(PcdPeiCoreMaxPeiStackSize) > (UINT32) NewPeiStackSize) { Private->StackSize = NewPeiStackSize; } else { - Private->StackSize = FixedPcdGet32(PcdPeiCoreMaxPeiStackSize); + Private->StackSize = PcdGet32(PcdPeiCoreMaxPeiStackSize); } // @@ -474,10 +493,9 @@ PeiDispatcher ( // But if new stack is smaller than the size of old stack, we also reserve // the size of old stack at bottom of permenent memory. // - StackGap = 0; - if (Private->StackSize > OldPeiStackSize) { - StackGap = Private->StackSize - OldPeiStackSize; - } + DEBUG ((EFI_D_INFO, "Old Stack size %d, New stack size %d\n", (INT32) OldPeiStackSize, (INT32) Private->StackSize)); + ASSERT (Private->StackSize >= OldPeiStackSize); + StackGap = Private->StackSize - OldPeiStackSize; // // Update HandOffHob for new installed permenent memory @@ -493,13 +511,13 @@ PeiDispatcher ( NewPermenentMemoryBase = Private->PhysicalMemoryBegin + StackGap; // - // Caculate stack offset and heap offset between CAR and new permement + // Caculate stack offset and heap offset between temporary memory and new permement // memory seperately. // StackOffset = (UINTN) NewPermenentMemoryBase - (UINTN) SecCoreData->StackBase; HeapOffset = (INTN) ((UINTN) Private->PhysicalMemoryBegin + Private->StackSize - \ (UINTN) SecCoreData->PeiTemporaryRamBase); - DEBUG ((EFI_D_INFO, "Heap Offset = 0x%X Stack Offset = 0x%X\n", HeapOffset, StackOffset)); + DEBUG ((EFI_D_INFO, "Heap Offset = 0x%lX Stack Offset = 0x%lX\n", (INT64)HeapOffset, (INT64)StackOffset)); // // Caculate new HandOffTable and PrivateData address in permenet memory's stack @@ -524,7 +542,7 @@ PeiDispatcher ( // Temporary Ram support Ppi is provided by platform, it will copy // temporary memory to permenent memory and do stack switching. // After invoken temporary Ram support, following code's stack is in - // memory but not in CAR. + // memory but not in temporary memory. // TemporaryRamSupportPpi->TemporaryRamMigration ( (CONST EFI_PEI_SERVICES **) PeiServices, @@ -551,7 +569,7 @@ PeiDispatcher ( PrivateInMem->HobList.Raw = (VOID*) ((UINTN) PrivateInMem->HobList.Raw + HeapOffset); PrivateInMem->StackBase = (EFI_PHYSICAL_ADDRESS)(((UINTN)PrivateInMem->PhysicalMemoryBegin + EFI_PAGE_MASK) & ~EFI_PAGE_MASK); - PeiServices = &PrivateInMem->PS; + PeiServices = (CONST EFI_PEI_SERVICES **) &PrivateInMem->PS; // // Fixup for PeiService's address @@ -579,8 +597,8 @@ PeiDispatcher ( HeapOffset ); - DEBUG ((EFI_D_INFO, "Stack Hob: BaseAddress=0x%X Length=0x%X\n", - (UINTN)PrivateInMem->StackBase, + DEBUG ((EFI_D_INFO, "Stack Hob: BaseAddress=0x%lX Length=0x%lX\n", + PrivateInMem->StackBase, PrivateInMem->StackSize)); BuildStackHob (PrivateInMem->StackBase, PrivateInMem->StackSize); @@ -593,7 +611,7 @@ PeiDispatcher ( // // Indicate that PeiCore reenter // - Private->PeimDispatcherReenter = TRUE; + PrivateInMem->PeimDispatcherReenter = TRUE; // // Shadow PEI Core. When permanent memory is avaiable, shadow @@ -633,6 +651,7 @@ PeiDispatcher ( // We call the entry point a 2nd time so the module knows it's shadowed. // //PERF_START (PeiServices, L"PEIM", PeimFileHandle, 0); + ASSERT (PeimEntryPoint != NULL); PeimEntryPoint (PeimFileHandle, (const EFI_PEI_SERVICES **) PeiServices); //PERF_END (PeiServices, L"PEIM", PeimFileHandle, 0); @@ -705,6 +724,8 @@ InitializeDispatcherData ( if (OldCoreData == NULL) { PrivateData->PeimDispatcherReenter = FALSE; PeiInitializeFv (PrivateData, SecCoreData); + } else { + PeiReinitializeFv (PrivateData); } return; @@ -801,135 +822,5 @@ PeiRegisterForShadow ( return EFI_SUCCESS; } -/** - Get Fv image from the FV type file, then install FV INFO ppi, Build FV hob. - - @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation. - @param FvFileHandle File handle of a Fv type file. - @param AuthenticationState Pointer to attestation authentication state of image. - - - @retval EFI_NOT_FOUND FV image can't be found. - @retval EFI_SUCCESS Successfully to process it. - @retval EFI_OUT_OF_RESOURCES Can not allocate page when aligning FV image - @retval Others Can not find EFI_SECTION_FIRMWARE_VOLUME_IMAGE section - -**/ -EFI_STATUS -ProcessFvFile ( - IN EFI_PEI_SERVICES **PeiServices, - IN EFI_PEI_FILE_HANDLE FvFileHandle, - OUT UINT32 *AuthenticationState - ) -{ - EFI_STATUS Status; - EFI_PEI_FV_HANDLE FvImageHandle; - EFI_FV_INFO FvImageInfo; - UINT32 FvAlignment; - VOID *FvBuffer; - EFI_PEI_HOB_POINTERS HobPtr; - - FvBuffer = NULL; - *AuthenticationState = 0; - - // - // Check if this EFI_FV_FILETYPE_FIRMWARE_VOLUME_IMAGE file has already - // been extracted. - // - HobPtr.Raw = GetHobList (); - while ((HobPtr.Raw = GetNextHob (EFI_HOB_TYPE_FV2, HobPtr.Raw)) != NULL) { - if (CompareGuid (&(((EFI_FFS_FILE_HEADER *)FvFileHandle)->Name), &HobPtr.FirmwareVolume2->FileName)) { - // - // this FILE has been dispatched, it will not be dispatched again. - // - return EFI_SUCCESS; - } - HobPtr.Raw = GET_NEXT_HOB (HobPtr); - } - - // - // Find FvImage in FvFile - // - Status = PeiFfsFindSectionData ( - (CONST EFI_PEI_SERVICES **) PeiServices, - EFI_SECTION_FIRMWARE_VOLUME_IMAGE, - FvFileHandle, - (VOID **)&FvImageHandle - ); - if (EFI_ERROR (Status)) { - return Status; - } - - // - // Collect FvImage Info. - // - Status = PeiFfsGetVolumeInfo (FvImageHandle, &FvImageInfo); - ASSERT_EFI_ERROR (Status); - - // - // FvAlignment must be more than 8 bytes required by FvHeader structure. - // - FvAlignment = 1 << ((FvImageInfo.FvAttributes & EFI_FVB2_ALIGNMENT) >> 16); - if (FvAlignment < 8) { - FvAlignment = 8; - } - - // - // Check FvImage - // - if ((UINTN) FvImageInfo.FvStart % FvAlignment != 0) { - FvBuffer = AllocateAlignedPages (EFI_SIZE_TO_PAGES ((UINT32) FvImageInfo.FvSize), FvAlignment); - if (FvBuffer == NULL) { - return EFI_OUT_OF_RESOURCES; - } - CopyMem (FvBuffer, FvImageInfo.FvStart, (UINTN) FvImageInfo.FvSize); - // - // Update FvImageInfo after reload FvImage to new aligned memory - // - PeiFfsGetVolumeInfo ((EFI_PEI_FV_HANDLE) FvBuffer, &FvImageInfo); - } - - // - // Install FvPpi and Build FvHob - // - PiLibInstallFvInfoPpi ( - NULL, - FvImageInfo.FvStart, - (UINT32) FvImageInfo.FvSize, - &(FvImageInfo.FvName), - &(((EFI_FFS_FILE_HEADER*)FvFileHandle)->Name) - ); - - // - // Inform the extracted FvImage to Fv HOB consumer phase, i.e. DXE phase - // based on its parent Fvimage is informed or not. - // If FvHob of its parent fvimage is built, the extracted FvImage will be built also. - // Or, the extracted FvImage will not be built. - // - HobPtr.Raw = GetHobList (); - while ((HobPtr.Raw = GetNextHob (EFI_HOB_TYPE_FV, HobPtr.Raw)) != NULL) { - if (((EFI_PHYSICAL_ADDRESS) (UINTN)FvFileHandle > HobPtr.FirmwareVolume->BaseAddress) && - ((EFI_PHYSICAL_ADDRESS) (UINTN)FvFileHandle < HobPtr.FirmwareVolume->BaseAddress + HobPtr.FirmwareVolume->Length)) { - BuildFvHob ( - (EFI_PHYSICAL_ADDRESS) (UINTN) FvImageInfo.FvStart, - FvImageInfo.FvSize - ); - break; - } - HobPtr.Raw = GET_NEXT_HOB (HobPtr); - } - - // - // Makes the encapsulated volume show up in DXE phase to skip processing of - // encapsulated file again. - // - BuildFv2Hob ( - (EFI_PHYSICAL_ADDRESS) (UINTN) FvImageInfo.FvStart, - FvImageInfo.FvSize, - &FvImageInfo.FvName, - &(((EFI_FFS_FILE_HEADER *)FvFileHandle)->Name) - ); - return EFI_SUCCESS; -}