+ // Default PeiCore is in BFV\r
+ //\r
+ PeiCoreFvIndex = 0;\r
+ //\r
+ // Find the PEI Core either from EFI_PEI_CORE_FV_LOCATION_PPI indicated FV or BFV\r
+ //\r
+ Status = PeiServicesLocatePpi (\r
+ &gEfiPeiCoreFvLocationPpiGuid,\r
+ 0,\r
+ NULL,\r
+ (VOID **) &PeiCoreFvLocationPpi\r
+ );\r
+ if (!EFI_ERROR (Status) && (PeiCoreFvLocationPpi->PeiCoreFvLocation != NULL)) {\r
+ //\r
+ // If PeiCoreFvLocation present, the PEI Core should be found from indicated FV\r
+ //\r
+ for (Index = 0; Index < PrivateData->FvCount; Index ++) {\r
+ if (PrivateData->Fv[Index].FvHandle == PeiCoreFvLocationPpi->PeiCoreFvLocation) {\r
+ PeiCoreFvIndex = Index;\r
+ break;\r
+ }\r
+ }\r
+ ASSERT (Index < PrivateData->FvCount);\r
+ }\r
+ //\r
+ // Find PEI Core from the given FV index\r