X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=MdeModulePkg%2FCore%2FPei%2FPeiMain%2FPeiMain.c;h=3b1d42e50922b1145240456d4f286a785641d098;hb=b67be02118593db45ff6b31ac1b37376fea15b67;hp=d7b5807bf74a9b940ed80b995e7d44d0574275a9;hpb=02422d17f76d5d08b2d9fa0bf5908a9c6144b997;p=mirror_edk2.git diff --git a/MdeModulePkg/Core/Pei/PeiMain/PeiMain.c b/MdeModulePkg/Core/Pei/PeiMain/PeiMain.c index d7b5807bf7..3b1d42e509 100644 --- a/MdeModulePkg/Core/Pei/PeiMain/PeiMain.c +++ b/MdeModulePkg/Core/Pei/PeiMain/PeiMain.c @@ -23,11 +23,6 @@ Revision History #include -// -//CAR is filled with this initial value during SEC phase -// -#define INIT_CAR_VALUE 0x5AA55AA5 - static EFI_PEI_PPI_DESCRIPTOR mMemoryDiscoveredPpi = { (EFI_PEI_PPI_DESCRIPTOR_PPI | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST), &gEfiPeiMemoryDiscoveredPpiGuid, @@ -122,9 +117,7 @@ Returns: PEI_CORE_INSTANCE *OldCoreData; EFI_PEI_CPU_IO_PPI *CpuIo; EFI_PEI_PCI_CFG2_PPI *PciCfg; - UINT64 SecPlatformInfoRecordSize; - EFI_SEC_PLATFORM_INFORMATION_PPI *SecPlatformInfoPpi; - EFI_SEC_PLATFORM_INFORMATION_RECORD *SecPlatformInfoRecord; + PEI_CORE_ENTRY_POINT ShadowedPeiCore; mTick = 0; OldCoreData = (PEI_CORE_INSTANCE *) Data; @@ -135,13 +128,17 @@ Returns: } } - // - // For IPF in CAR mode the real memory access is uncached,in InstallPeiMemory() - // the 63-bit of address is set to 1. - // - SWITCH_TO_CACHE_MODE (OldCoreData); - if (OldCoreData != NULL) { + ShadowedPeiCore = (PEI_CORE_ENTRY_POINT) (UINTN) OldCoreData->ShadowedPeiCore; + if (ShadowedPeiCore != NULL) { + OldCoreData->ShadowedPeiCore = NULL; + ShadowedPeiCore ( + SecCoreData, + PpiList, + OldCoreData + ); + } + CopyMem (&PrivateData, OldCoreData, sizeof (PEI_CORE_INSTANCE)); CpuIo = (VOID*)PrivateData.ServiceTableShadow.CpuIo; @@ -179,34 +176,6 @@ Returns: PERF_END (NULL,"PreMem", NULL, 0); PERF_START (NULL,"PostMem", NULL, 0); - // - // The following code dumps out interesting cache as RAM usage information - // so we can keep tabs on how the cache as RAM is being utilized. The - // DEBUG_CODE_BEGIN macro is used to prevent this code from being compiled - // on a debug build. - // - DEBUG_CODE_BEGIN (); - UINTN *StackPointer; - UINTN StackValue; - - StackValue = INIT_CAR_VALUE; - for (StackPointer = (UINTN *) OldCoreData->MaxTopOfCarHeap; - ((UINTN) StackPointer < ((UINTN) OldCoreData->BottomOfCarHeap + OldCoreData->SizeOfCacheAsRam)) - && StackValue == INIT_CAR_VALUE; - StackPointer++) { - StackValue = *StackPointer; - } - - DEBUG ((EFI_D_INFO, "Total Cache as RAM: %d bytes.\n", OldCoreData->SizeOfCacheAsRam)); - DEBUG ((EFI_D_INFO, " CAR stack ever used: %d bytes.\n", - ((UINTN) OldCoreData->TopOfCarHeap - (UINTN) StackPointer) - )); - DEBUG ((EFI_D_INFO, " CAR heap used: %d bytes.\n", - ((UINTN) OldCoreData->HobList.HandoffInformationTable->EfiFreeMemoryBottom - - (UINTN) OldCoreData->HobList.Raw) - )); - DEBUG_CODE_END (); - // // Alert any listeners that there is permanent memory available // @@ -222,7 +191,7 @@ Returns: // REPORT_STATUS_CODE ( EFI_PROGRESS_CODE, - EFI_SOFTWARE_PEI_CORE | EFI_SW_PC_INIT + FixedPcdGet32 (PcdStatusCodeValuePeiCoreEntry) ); PERF_START (NULL,"PEI", NULL, mTick); @@ -237,37 +206,6 @@ Returns: if (PpiList != NULL) { Status = PeiServicesInstallPpi (PpiList); ASSERT_EFI_ERROR (Status); - - // - // PI spec Vol 1, 7.3.1 specifies that this same information reported by EFI_SEC_PLATFORM_INFORMATION_PPI - // will be placed in a GUIDed HOB with the PPI GUID as the HOB GUID for HOB consumer phase. - // - Status = PeiServicesLocatePpi ( - &gEfiSecPlatformInformationPpiGuid, - 0, - NULL, - (VOID **) &SecPlatformInfoPpi - ); - if (!EFI_ERROR (Status)) { - SecPlatformInfoRecord = AllocateZeroPool (sizeof(*SecPlatformInfoRecord)); - ASSERT (SecPlatformInfoRecord != NULL); - - SecPlatformInfoRecordSize = sizeof(*SecPlatformInfoRecord); - - Status = SecPlatformInfoPpi->PlatformInformation ( - (CONST EFI_PEI_SERVICES **) GetPeiServicesTablePointer (), - &SecPlatformInfoRecordSize, - SecPlatformInfoRecord - ); - - if (!EFI_ERROR (Status)) { - BuildGuidDataHob ( - &gEfiSecPlatformInformationPpiGuid, - SecPlatformInfoRecord, - sizeof (*SecPlatformInfoRecord) - ); - } - } } } @@ -312,3 +250,4 @@ Returns: return EFI_NOT_FOUND; } +