X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=MdeModulePkg%2FCore%2FPei%2FPpi%2FPpi.c;h=139cfeda05755e0f623eeb825285b01c83531730;hb=d1102dba7210b95e41d06c2338a22ba6af248645;hp=fa60d82a5be0857160a9bd4e537c26f74d8486de;hpb=b1f6a7c636fca9eda65a3045302de577c00e438d;p=mirror_edk2.git diff --git a/MdeModulePkg/Core/Pei/Ppi/Ppi.c b/MdeModulePkg/Core/Pei/Ppi/Ppi.c index fa60d82a5b..139cfeda05 100644 --- a/MdeModulePkg/Core/Pei/Ppi/Ppi.c +++ b/MdeModulePkg/Core/Pei/Ppi/Ppi.c @@ -1,8 +1,8 @@ /** @file EFI PEI Core PPI services - -Copyright (c) 2006, Intel Corporation -All rights reserved. This program and the accompanying materials + +Copyright (c) 2006 - 2018, 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 @@ -12,15 +12,14 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. **/ -#include +#include "PeiMain.h" /** Initialize PPI services. - @param PrivateData Pointer to the PEI Core data. - @param OldCoreData Pointer to old PEI Core data. + @param OldCoreData Pointer to old PEI Core data. NULL if being run in non-permament memory mode. **/ @@ -31,79 +30,148 @@ InitializePpiServices ( ) { if (OldCoreData == NULL) { - PrivateData->PpiData.NotifyListEnd = FixedPcdGet32 (PcdPeiCoreMaxPpiSupported)-1; - PrivateData->PpiData.DispatchListEnd = FixedPcdGet32 (PcdPeiCoreMaxPpiSupported)-1; - PrivateData->PpiData.LastDispatchedNotify = FixedPcdGet32 (PcdPeiCoreMaxPpiSupported)-1; + PrivateData->PpiData.NotifyListEnd = PcdGet32 (PcdPeiCoreMaxPpiSupported)-1; + PrivateData->PpiData.DispatchListEnd = PcdGet32 (PcdPeiCoreMaxPpiSupported)-1; + PrivateData->PpiData.LastDispatchedNotify = PcdGet32 (PcdPeiCoreMaxPpiSupported)-1; } } /** - Migrate the Hob list from the CAR stack to PEI installed memory. + Migrate Single PPI Pointer from the temporary memory to PEI installed memory. - @param PeiServices The PEI core services table. - @param OldCheckingBottom The old checking bottom. - @param OldCheckingTop The old checking top. - @param NewHandOffHob The new handoff HOB list. + @param PpiPointer Pointer to Ppi + @param TempBottom Base of old temporary memory + @param TempTop Top of old temporary memory + @param Offset Offset of new memory to old temporary memory. + @param OffsetPositive Positive flag of Offset value. **/ VOID -ConvertPpiPointers ( - IN CONST EFI_PEI_SERVICES **PeiServices, - IN UINTN OldCheckingBottom, - IN UINTN OldCheckingTop, - IN EFI_HOB_HANDOFF_INFO_TABLE *NewHandOffHob +ConvertSinglePpiPointer ( + IN PEI_PPI_LIST_POINTERS *PpiPointer, + IN UINTN TempBottom, + IN UINTN TempTop, + IN UINTN Offset, + IN BOOLEAN OffsetPositive ) { - PEI_CORE_INSTANCE *PrivateData; - UINT8 Index; - PEI_PPI_LIST_POINTERS *PpiPointer; - UINTN Fixup; + if (((UINTN)PpiPointer->Raw < TempTop) && + ((UINTN)PpiPointer->Raw >= TempBottom)) { + // + // Convert the pointer to the PPI descriptor from the old TempRam + // to the relocated physical memory. + // + if (OffsetPositive) { + PpiPointer->Raw = (VOID *) ((UINTN)PpiPointer->Raw + Offset); + } else { + PpiPointer->Raw = (VOID *) ((UINTN)PpiPointer->Raw - Offset); + } - PrivateData = PEI_CORE_INSTANCE_FROM_PS_THIS(PeiServices); + // + // Only when the PEIM descriptor is in the old TempRam should it be necessary + // to try to convert the pointers in the PEIM descriptor + // + + if (((UINTN)PpiPointer->Ppi->Guid < TempTop) && + ((UINTN)PpiPointer->Ppi->Guid >= TempBottom)) { + // + // Convert the pointer to the GUID in the PPI or NOTIFY descriptor + // from the old TempRam to the relocated physical memory. + // + if (OffsetPositive) { + PpiPointer->Ppi->Guid = (VOID *) ((UINTN)PpiPointer->Ppi->Guid + Offset); + } else { + PpiPointer->Ppi->Guid = (VOID *) ((UINTN)PpiPointer->Ppi->Guid - Offset); + } + } - Fixup = (UINTN)NewHandOffHob - OldCheckingBottom; + // + // Convert the pointer to the PPI interface structure in the PPI descriptor + // from the old TempRam to the relocated physical memory. + // + if ((UINTN)PpiPointer->Ppi->Ppi < TempTop && + (UINTN)PpiPointer->Ppi->Ppi >= TempBottom) { + if (OffsetPositive) { + PpiPointer->Ppi->Ppi = (VOID *) ((UINTN)PpiPointer->Ppi->Ppi + Offset); + } else { + PpiPointer->Ppi->Ppi = (VOID *) ((UINTN)PpiPointer->Ppi->Ppi - Offset); + } + } + } +} - for (Index = 0; Index < FixedPcdGet32 (PcdPeiCoreMaxPpiSupported); Index++) { - if (Index < PrivateData->PpiData.PpiListEnd || - Index > PrivateData->PpiData.NotifyListEnd) { - PpiPointer = &PrivateData->PpiData.PpiListPtrs[Index]; +/** - if (((UINTN)PpiPointer->Raw < OldCheckingTop) && - ((UINTN)PpiPointer->Raw >= OldCheckingBottom)) { - // - // Convert the pointer to the PEIM descriptor from the old HOB heap - // to the relocated HOB heap. - // - PpiPointer->Raw = (VOID *) ((UINTN)PpiPointer->Raw + Fixup); + Migrate PPI Pointers from the temporary memory to PEI installed memory. - // - // Only when the PEIM descriptor is in the old HOB should it be necessary - // to try to convert the pointers in the PEIM descriptor - // + @param SecCoreData Points to a data structure containing SEC to PEI handoff data, such as the size + and location of temporary RAM, the stack location and the BFV location. + @param PrivateData Pointer to PeiCore's private data structure. - if (((UINTN)PpiPointer->Ppi->Guid < OldCheckingTop) && - ((UINTN)PpiPointer->Ppi->Guid >= OldCheckingBottom)) { - // - // Convert the pointer to the GUID in the PPI or NOTIFY descriptor - // from the old HOB heap to the relocated HOB heap. - // - PpiPointer->Ppi->Guid = (VOID *) ((UINTN)PpiPointer->Ppi->Guid + Fixup); - } +**/ +VOID +ConvertPpiPointers ( + IN CONST EFI_SEC_PEI_HAND_OFF *SecCoreData, + IN PEI_CORE_INSTANCE *PrivateData + ) +{ + UINT8 Index; + UINT8 IndexHole; + for (Index = 0; Index < PcdGet32 (PcdPeiCoreMaxPpiSupported); Index++) { + if (Index < PrivateData->PpiData.PpiListEnd || Index > PrivateData->PpiData.NotifyListEnd) { + if (PrivateData->MemoryPages.Size != 0) { // - // Assume that no code is located in the temporary memory, so the pointer to - // the notification function in the NOTIFY descriptor needs not be converted. + // Convert PPI pointer in old memory pages + // It needs to be done before Convert PPI pointer in old Heap // - if (Index < PrivateData->PpiData.PpiListEnd && - (UINTN)PpiPointer->Ppi->Ppi < OldCheckingTop && - (UINTN)PpiPointer->Ppi->Ppi >= OldCheckingBottom) { - // - // Convert the pointer to the PPI interface structure in the PPI descriptor - // from the old HOB heap to the relocated HOB heap. - // - PpiPointer->Ppi->Ppi = (VOID *) ((UINTN)PpiPointer->Ppi->Ppi+ Fixup); + ConvertSinglePpiPointer ( + &PrivateData->PpiData.PpiListPtrs[Index], + (UINTN)PrivateData->MemoryPages.Base, + (UINTN)PrivateData->MemoryPages.Base + PrivateData->MemoryPages.Size, + PrivateData->MemoryPages.Offset, + PrivateData->MemoryPages.OffsetPositive + ); + } + + // + // Convert PPI pointer in old Heap + // + ConvertSinglePpiPointer ( + &PrivateData->PpiData.PpiListPtrs[Index], + (UINTN)SecCoreData->PeiTemporaryRamBase, + (UINTN)SecCoreData->PeiTemporaryRamBase + SecCoreData->PeiTemporaryRamSize, + PrivateData->HeapOffset, + PrivateData->HeapOffsetPositive + ); + + // + // Convert PPI pointer in old Stack + // + ConvertSinglePpiPointer ( + &PrivateData->PpiData.PpiListPtrs[Index], + (UINTN)SecCoreData->StackBase, + (UINTN)SecCoreData->StackBase + SecCoreData->StackSize, + PrivateData->StackOffset, + PrivateData->StackOffsetPositive + ); + + // + // Convert PPI pointer in old TempRam Hole + // + for (IndexHole = 0; IndexHole < HOLE_MAX_NUMBER; IndexHole ++) { + if (PrivateData->HoleData[IndexHole].Size == 0) { + continue; } + + ConvertSinglePpiPointer ( + &PrivateData->PpiData.PpiListPtrs[Index], + (UINTN)PrivateData->HoleData[IndexHole].Base, + (UINTN)PrivateData->HoleData[IndexHole].Base + PrivateData->HoleData[IndexHole].Size, + PrivateData->HoleData[IndexHole].Offset, + PrivateData->HoleData[IndexHole].OffsetPositive + ); } } } @@ -111,22 +179,27 @@ ConvertPpiPointers ( /** - Install PPI services. + This function installs an interface in the PEI PPI database by GUID. + The purpose of the service is to publish an interface that other parties + can use to call additional PEIMs. - @param PeiServices - Pointer to the PEI Service Table - @param PpiList - Pointer to a list of PEI PPI Descriptors. + @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation. + @param PpiList Pointer to a list of PEI PPI Descriptors. + @param Single TRUE if only single entry in the PpiList. + FALSE if the PpiList is ended with an entry which has the + EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST flag set in its Flags field. - @retval EFI_SUCCESS - if all PPIs in PpiList are successfully installed. - @retval EFI_INVALID_PARAMETER - if PpiList is NULL pointer - @retval EFI_INVALID_PARAMETER - if any PPI in PpiList is not valid - @retval EFI_OUT_OF_RESOURCES - if there is no more memory resource to install PPI + @retval EFI_SUCCESS if all PPIs in PpiList are successfully installed. + @retval EFI_INVALID_PARAMETER if PpiList is NULL pointer + if any PPI in PpiList is not valid + @retval EFI_OUT_OF_RESOURCES if there is no more memory resource to install PPI **/ EFI_STATUS -EFIAPI -PeiInstallPpi ( +InternalPeiInstallPpi ( IN CONST EFI_PEI_SERVICES **PeiServices, - IN CONST EFI_PEI_PPI_DESCRIPTOR *PpiList + IN CONST EFI_PEI_PPI_DESCRIPTOR *PpiList, + IN BOOLEAN Single ) { PEI_CORE_INSTANCE *PrivateData; @@ -151,8 +224,9 @@ PeiInstallPpi ( for (;;) { // - // Since PpiData is used for NotifyList and InstallList, max resource + // Since PpiData is used for NotifyList and PpiList, max resource // is reached if the Install reaches the NotifyList + // PcdPeiCoreMaxPpiSupported can be set to a larger value in DSC to satisfy more PPI requirement. // if (Index == PrivateData->PpiData.NotifyListEnd + 1) { return EFI_OUT_OF_RESOURCES; @@ -164,7 +238,7 @@ PeiInstallPpi ( // if ((PpiList->Flags & EFI_PEI_PPI_DESCRIPTOR_PPI) == 0) { PrivateData->PpiData.PpiListEnd = LastCallbackInstall; - DEBUG((EFI_D_ERROR, "ERROR -> InstallPpi: %g %x\n", PpiList->Guid, PpiList->Ppi)); + DEBUG((EFI_D_ERROR, "ERROR -> InstallPpi: %g %p\n", PpiList->Guid, PpiList->Ppi)); return EFI_INVALID_PARAMETER; } @@ -172,11 +246,16 @@ PeiInstallPpi ( PrivateData->PpiData.PpiListPtrs[Index].Ppi = (EFI_PEI_PPI_DESCRIPTOR*) PpiList; PrivateData->PpiData.PpiListEnd++; - // - // Continue until the end of the PPI List. - // - if ((PpiList->Flags & EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST) == - EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST) { + if (Single) { + // + // Only single entry in the PpiList. + // + break; + } else if ((PpiList->Flags & EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST) == + EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST) { + // + // Continue until the end of the PPI List. + // break; } PpiList++; @@ -201,16 +280,44 @@ PeiInstallPpi ( /** - Re-Install PPI services. + This function installs an interface in the PEI PPI database by GUID. + The purpose of the service is to publish an interface that other parties + can use to call additional PEIMs. + + @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation. + @param PpiList Pointer to a list of PEI PPI Descriptors. + + @retval EFI_SUCCESS if all PPIs in PpiList are successfully installed. + @retval EFI_INVALID_PARAMETER if PpiList is NULL pointer + if any PPI in PpiList is not valid + @retval EFI_OUT_OF_RESOURCES if there is no more memory resource to install PPI + +**/ +EFI_STATUS +EFIAPI +PeiInstallPpi ( + IN CONST EFI_PEI_SERVICES **PeiServices, + IN CONST EFI_PEI_PPI_DESCRIPTOR *PpiList + ) +{ + return InternalPeiInstallPpi (PeiServices, PpiList, FALSE); +} + +/** + + This function reinstalls an interface in the PEI PPI database by GUID. + The purpose of the service is to publish an interface that other parties can + use to replace an interface of the same name in the protocol database with a + different interface. - @param PeiServices - Pointer to the PEI Service Table - @param OldPpi - Pointer to the old PEI PPI Descriptors. - @param NewPpi - Pointer to the new PEI PPI Descriptors. + @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation. + @param OldPpi Pointer to the old PEI PPI Descriptors. + @param NewPpi Pointer to the new PEI PPI Descriptors. - @retval EFI_SUCCESS - if the operation was successful - @retval EFI_INVALID_PARAMETER - if OldPpi or NewPpi is NULL - @retval EFI_INVALID_PARAMETER - if NewPpi is not valid - @retval EFI_NOT_FOUND - if the PPI was not in the database + @retval EFI_SUCCESS if the operation was successful + @retval EFI_INVALID_PARAMETER if OldPpi or NewPpi is NULL + @retval EFI_INVALID_PARAMETER if NewPpi is not valid + @retval EFI_NOT_FOUND if the PPI was not in the database **/ EFI_STATUS @@ -252,6 +359,7 @@ PeiReInstallPpi ( // Remove the old PPI from the database, add the new one. // DEBUG((EFI_D_INFO, "Reinstall PPI: %g\n", NewPpi->Guid)); + ASSERT (Index < (INTN)(PcdGet32 (PcdPeiCoreMaxPpiSupported))); PrivateData->PpiData.PpiListPtrs[Index].Ppi = (EFI_PEI_PPI_DESCRIPTOR *) NewPpi; // @@ -275,12 +383,12 @@ PeiReInstallPpi ( Locate a given named PPI. - @param PeiServices - Pointer to the PEI Service Table - @param Guid - Pointer to GUID of the PPI. - @param Instance - Instance Number to discover. - @param PpiDescriptor - Pointer to reference the found descriptor. If not NULL, - returns a pointer to the descriptor (includes flags, etc) - @param Ppi - Pointer to reference the found PPI + @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation. + @param Guid Pointer to GUID of the PPI. + @param Instance Instance Number to discover. + @param PpiDescriptor Pointer to reference the found descriptor. If not NULL, + returns a pointer to the descriptor (includes flags, etc) + @param Ppi Pointer to reference the found PPI @retval EFI_SUCCESS if the PPI is in the database @retval EFI_NOT_FOUND if the PPI is not in the database @@ -291,9 +399,9 @@ EFIAPI PeiLocatePpi ( IN CONST EFI_PEI_SERVICES **PeiServices, IN CONST EFI_GUID *Guid, - IN UINTN Instance, - IN OUT EFI_PEI_PPI_DESCRIPTOR **PpiDescriptor, - IN OUT VOID **Ppi + IN UINTN Instance, + IN OUT EFI_PEI_PPI_DESCRIPTOR **PpiDescriptor, + IN OUT VOID **Ppi ) { PEI_CORE_INSTANCE *PrivateData; @@ -342,22 +450,26 @@ PeiLocatePpi ( /** - Install a notification for a given PPI. + This function installs a notification service to be called back when a given + interface is installed or reinstalled. The purpose of the service is to publish + an interface that other parties can use to call additional PPIs that may materialize later. - - @param PeiServices - Pointer to the PEI Service Table - @param NotifyList - Pointer to list of Descriptors to notify upon. + @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation. + @param NotifyList Pointer to list of Descriptors to notify upon. + @param Single TRUE if only single entry in the NotifyList. + FALSE if the NotifyList is ended with an entry which has the + EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST flag set in its Flags field. @retval EFI_SUCCESS if successful @retval EFI_OUT_OF_RESOURCES if no space in the database - @retval EFI_INVALID_PARAMETER if not a good decriptor + @retval EFI_INVALID_PARAMETER if not a good descriptor **/ EFI_STATUS -EFIAPI -PeiNotifyPpi ( +InternalPeiNotifyPpi ( IN CONST EFI_PEI_SERVICES **PeiServices, - IN CONST EFI_PEI_NOTIFY_DESCRIPTOR *NotifyList + IN CONST EFI_PEI_NOTIFY_DESCRIPTOR *NotifyList, + IN BOOLEAN Single ) { PEI_CORE_INSTANCE *PrivateData; @@ -389,6 +501,7 @@ PeiNotifyPpi ( // // Since PpiData is used for NotifyList and InstallList, max resource // is reached if the Install reaches the PpiList + // PcdPeiCoreMaxPpiSupported can be set to a larger value in DSC to satisfy more Notify PPIs requirement. // if (Index == PrivateData->PpiData.PpiListEnd - 1) { return EFI_OUT_OF_RESOURCES; @@ -399,7 +512,7 @@ PeiNotifyPpi ( // if ((NotifyList->Flags & EFI_PEI_PPI_DESCRIPTOR_NOTIFY_TYPES) == 0) { PrivateData->PpiData.NotifyListEnd = LastCallbackNotify; - DEBUG((EFI_D_ERROR, "ERROR -> InstallNotify: %g %x\n", NotifyList->Guid, NotifyList->Notify)); + DEBUG((EFI_D_ERROR, "ERROR -> InstallNotify: %g %p\n", NotifyList->Guid, NotifyList->Notify)); return EFI_INVALID_PARAMETER; } @@ -411,8 +524,16 @@ PeiNotifyPpi ( PrivateData->PpiData.NotifyListEnd--; DEBUG((EFI_D_INFO, "Register PPI Notify: %g\n", NotifyList->Guid)); - if ((NotifyList->Flags & EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST) == - EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST) { + if (Single) { + // + // Only single entry in the NotifyList. + // + break; + } else if ((NotifyList->Flags & EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST) == + EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST) { + // + // Continue until the end of the Notify List. + // break; } // @@ -453,10 +574,33 @@ PeiNotifyPpi ( PrivateData->PpiData.NotifyListEnd ); - return EFI_SUCCESS; } +/** + + This function installs a notification service to be called back when a given + interface is installed or reinstalled. The purpose of the service is to publish + an interface that other parties can use to call additional PPIs that may materialize later. + + @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation. + @param NotifyList Pointer to list of Descriptors to notify upon. + + @retval EFI_SUCCESS if successful + @retval EFI_OUT_OF_RESOURCES if no space in the database + @retval EFI_INVALID_PARAMETER if not a good descriptor + +**/ +EFI_STATUS +EFIAPI +PeiNotifyPpi ( + IN CONST EFI_PEI_SERVICES **PeiServices, + IN CONST EFI_PEI_NOTIFY_DESCRIPTOR *NotifyList + ) +{ + return InternalPeiNotifyPpi (PeiServices, NotifyList, FALSE); +} + /** @@ -508,7 +652,7 @@ ProcessNotifyList ( EFI_PEI_PPI_DESCRIPTOR_NOTIFY_DISPATCH, PrivateData->PpiData.LastDispatchedInstall, PrivateData->PpiData.PpiListEnd, - FixedPcdGet32 (PcdPeiCoreMaxPpiSupported)-1, + PcdGet32 (PcdPeiCoreMaxPpiSupported)-1, PrivateData->PpiData.DispatchListEnd ); PrivateData->PpiData.LastDispatchedInstall = TempValue; @@ -568,19 +712,76 @@ DispatchNotify ( (((INT32 *)SearchGuid)[1] == ((INT32 *)CheckGuid)[1]) && (((INT32 *)SearchGuid)[2] == ((INT32 *)CheckGuid)[2]) && (((INT32 *)SearchGuid)[3] == ((INT32 *)CheckGuid)[3])) { - DEBUG ((EFI_D_INFO, "Notify: PPI Guid: %g, Peim notify entry point: %x\n", + DEBUG ((EFI_D_INFO, "Notify: PPI Guid: %g, Peim notify entry point: %p\n", SearchGuid, NotifyDescriptor->Notify )); NotifyDescriptor->Notify ( - GetPeiServicesTablePointer (), + (EFI_PEI_SERVICES **) GetPeiServicesTablePointer (), NotifyDescriptor, (PrivateData->PpiData.PpiListPtrs[Index2].Ppi)->Ppi ); } } } +} - return; +/** + Process PpiList from SEC phase. + + @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation. + @param PpiList Points to a list of one or more PPI descriptors to be installed initially by the PEI core. + These PPI's will be installed and/or immediately signaled if they are notification type. + +**/ +VOID +ProcessPpiListFromSec ( + IN CONST EFI_PEI_SERVICES **PeiServices, + IN CONST EFI_PEI_PPI_DESCRIPTOR *PpiList + ) +{ + EFI_STATUS Status; + EFI_SEC_HOB_DATA_PPI *SecHobDataPpi; + EFI_HOB_GENERIC_HEADER *SecHobList; + + for (;;) { + if ((PpiList->Flags & EFI_PEI_PPI_DESCRIPTOR_NOTIFY_TYPES) != 0) { + // + // It is a notification PPI. + // + Status = InternalPeiNotifyPpi (PeiServices, (CONST EFI_PEI_NOTIFY_DESCRIPTOR *) PpiList, TRUE); + ASSERT_EFI_ERROR (Status); + } else { + // + // It is a normal PPI. + // + Status = InternalPeiInstallPpi (PeiServices, PpiList, TRUE); + ASSERT_EFI_ERROR (Status); + } + + if ((PpiList->Flags & EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST) == EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST) { + // + // Continue until the end of the PPI List. + // + break; + } + + PpiList++; + } + + // + // If the EFI_SEC_HOB_DATA_PPI is in the list of PPIs passed to the PEI entry point, + // the PEI Foundation will call the GetHobs() member function and install all HOBs + // returned into the HOB list. It does this after installing all PPIs passed from SEC + // into the PPI database and before dispatching any PEIMs. + // + Status = PeiLocatePpi (PeiServices, &gEfiSecHobDataPpiGuid, 0, NULL, (VOID **) &SecHobDataPpi); + if (!EFI_ERROR (Status)) { + Status = SecHobDataPpi->GetHobs (SecHobDataPpi, &SecHobList); + if (!EFI_ERROR (Status)) { + Status = PeiInstallSecHobData (PeiServices, SecHobList); + ASSERT_EFI_ERROR (Status); + } + } }