X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=MdeModulePkg%2FCore%2FPei%2FDispatcher%2FDispatcher.c;h=bdbb00b205f86dcec674c108743fe5a830811168;hb=087e13cbe2946501afcce31b62a1b342715bc20d;hp=4661d779d97199219bcfb2424ae4a4ff7e4eadf1;hpb=595d4b4c24181a2e8bdc71426b37c441f8a2d85d;p=mirror_edk2.git diff --git a/MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c b/MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c index 4661d779d9..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 - 2009, 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 @@ -75,7 +75,7 @@ DiscoverPeimsAndOrderWithApriori ( // // Go ahead to scan this Fv, and cache FileHandles within it. // - for (PeimCount = 0; PeimCount < FixedPcdGet32 (PcdPeiCoreMaxPeimPerFv); PeimCount++) { + 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; @@ -88,7 +88,7 @@ DiscoverPeimsAndOrderWithApriori ( // 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 < FixedPcdGet32 (PcdPeiCoreMaxPeimPerFv)); + ASSERT (PeimCount < PcdGet32 (PcdPeiCoreMaxPeimPerFv)); // // Get Apriori File handle @@ -221,6 +221,7 @@ ShadowPeiCore( Status = PeiLoadImage ( PeiServices, *((EFI_PEI_FILE_HANDLE*)&PeiCoreFileHandle), + PEIM_STATE_REGISITER_FOR_SHADOW, &EntryPoint, &AuthenticationState ); @@ -292,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 ( (CONST EFI_PEI_SERVICES **) &Private->PS, PeimFileHandle, + PEIM_STATE_REGISITER_FOR_SHADOW, &EntryPoint, &AuthenticationState ); @@ -314,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); } // @@ -377,7 +379,7 @@ PeiDispatcher ( // 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]; @@ -401,6 +403,7 @@ PeiDispatcher ( Status = PeiLoadImage ( PeiServices, PeimFileHandle, + PEIM_STATE_NOT_DISPATCHED, &EntryPoint, &AuthenticationState ); @@ -411,13 +414,13 @@ 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) ); @@ -442,11 +445,11 @@ 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); } @@ -478,10 +481,10 @@ PeiDispatcher ( // 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); } // @@ -721,6 +724,8 @@ InitializeDispatcherData ( if (OldCoreData == NULL) { PrivateData->PeimDispatcherReenter = FALSE; PeiInitializeFv (PrivateData, SecCoreData); + } else { + PeiReinitializeFv (PrivateData); } return; @@ -818,3 +823,4 @@ PeiRegisterForShadow ( } +