MdeModulePkg PeiCore: Add PCD to specify PEIM Shadow

v2 changelog:
Check CurrentPeimHandle to check the matched PeimHandle.
Add check point to ShadowPeiCore based on PCD.

v1 changelog:
PeiCore LoadImage always shadow itself and PEIM on normal boot after
the physical memory is installed. On the emulator platform, the shadow
may be not necessary. To support such usage, new PCD PcdShadowPeimOnBoot
is introduced to specify whether loads PEIM in memory by default.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Liming Gao <liming.gao@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18125 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
Liming Gao
2015-08-03 03:18:37 +00:00
committed by lgao4
parent 496b0dd00c
commit 3d44658ca8
6 changed files with 59 additions and 9 deletions

View File

@@ -259,7 +259,11 @@ PeiCore (
// Shadow PEI Core. When permanent memory is avaiable, shadow
// PEI Core and PEIMs to get high performance.
//
OldCoreData->ShadowedPeiCore = ShadowPeiCore (OldCoreData);
OldCoreData->ShadowedPeiCore = (PEICORE_FUNCTION_POINTER) (UINTN) PeiCore;
if ((HandoffInformationTable->BootMode == BOOT_ON_S3_RESUME && PcdGetBool (PcdShadowPeimOnS3Boot))
|| (HandoffInformationTable->BootMode != BOOT_ON_S3_RESUME && PcdGetBool (PcdShadowPeimOnBoot))) {
OldCoreData->ShadowedPeiCore = ShadowPeiCore (OldCoreData);
}
//
// PEI Core has now been shadowed to memory. Restart PEI Core in memory.