summaryrefslogtreecommitdiff
path: root/MdeModulePkg/Core/Pei/PeiMain/PeiMain.c
diff options
context:
space:
mode:
authorLiming Gao <liming.gao@intel.com>2015-08-03 03:18:37 +0000
committerlgao4 <lgao4@Edk2>2015-08-03 03:18:37 +0000
commit3d44658ca89b36a492ba2ab648617d53be2693fd (patch)
tree3d96cccf6b03170185d6f9957708fcd507c557d5 /MdeModulePkg/Core/Pei/PeiMain/PeiMain.c
parent496b0dd00c377461bd059c0027ec2437630e2496 (diff)
downloadedk2-platforms-3d44658ca89b36a492ba2ab648617d53be2693fd.tar.xz
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
Diffstat (limited to 'MdeModulePkg/Core/Pei/PeiMain/PeiMain.c')
-rw-r--r--MdeModulePkg/Core/Pei/PeiMain/PeiMain.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/MdeModulePkg/Core/Pei/PeiMain/PeiMain.c b/MdeModulePkg/Core/Pei/PeiMain/PeiMain.c
index 05e0d0fda4..d36f89c3dd 100644
--- a/MdeModulePkg/Core/Pei/PeiMain/PeiMain.c
+++ b/MdeModulePkg/Core/Pei/PeiMain/PeiMain.c
@@ -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.