[edk2] [Patch 2/3] MdeModulePkg: Update PeiCore consumes PCD to get the init value in temp stack

Liming Gao posted 3 patches 7 years, 1 month ago
[edk2] [Patch 2/3] MdeModulePkg: Update PeiCore consumes PCD to get the init value in temp stack
Posted by Liming Gao 7 years, 1 month ago
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Liming Gao <liming.gao@intel.com>
---
 MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c | 7 +------
 MdeModulePkg/Core/Pei/PeiMain.inf             | 1 +
 2 files changed, 2 insertions(+), 6 deletions(-)

diff --git a/MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c b/MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c
index 38299c5d98..467066a0bf 100644
--- a/MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c
+++ b/MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c
@@ -15,11 +15,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 
 #include "PeiMain.h"
 
-///
-/// temporary memory is filled with this initial value during SEC phase
-///
-#define INIT_CAR_VALUE 0x5AA55AA5
-
 /**
 
   Discover all Peims and optional Apriori file in one FV. There is at most one
@@ -680,7 +675,7 @@ PeiCheckAndSwitchStack (
 
       for (StackPointer = (UINT32*)SecCoreData->StackBase;
            (StackPointer < (UINT32*)((UINTN)SecCoreData->StackBase + SecCoreData->StackSize)) \
-           && (*StackPointer == INIT_CAR_VALUE);
+           && (*StackPointer == PcdGet32 (PcdInitValueInTempStack));
            StackPointer ++);
 
       DEBUG ((DEBUG_INFO, "Temp Stack : BaseAddress=0x%p Length=0x%X\n", SecCoreData->StackBase, (UINT32)SecCoreData->StackSize));
diff --git a/MdeModulePkg/Core/Pei/PeiMain.inf b/MdeModulePkg/Core/Pei/PeiMain.inf
index 21ce2be778..7d9cdaa2f0 100644
--- a/MdeModulePkg/Core/Pei/PeiMain.inf
+++ b/MdeModulePkg/Core/Pei/PeiMain.inf
@@ -116,6 +116,7 @@
   gEfiMdeModulePkgTokenSpaceGuid.PcdLoadModuleAtFixAddressEnable            ## CONSUMES
   gEfiMdeModulePkgTokenSpaceGuid.PcdShadowPeimOnS3Boot                      ## CONSUMES 
   gEfiMdeModulePkgTokenSpaceGuid.PcdShadowPeimOnBoot                        ## CONSUMES 
+  gEfiMdeModulePkgTokenSpaceGuid.PcdInitValueInTempStack                    ## CONSUMES
 
 # [BootMode]
 # S3_RESUME             ## SOMETIMES_CONSUMES
-- 
2.11.0.windows.1

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel