summaryrefslogtreecommitdiff
path: root/MdeModulePkg/Core/Pei/PeiMain/PeiMain.c
diff options
context:
space:
mode:
authorLiming Gao <liming.gao@intel.com>2013-11-15 02:05:11 +0000
committerlgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524>2013-11-15 02:05:11 +0000
commit0f9ebb321638e9142ab3bdcc19000c49bb83b9ba (patch)
tree9c6e449cb380cc7d6f5261b86e86228231579aaf /MdeModulePkg/Core/Pei/PeiMain/PeiMain.c
parentfcfd5fb01b2c5af6efd2df5e2f54d688d9bcd8a3 (diff)
downloadedk2-platforms-0f9ebb321638e9142ab3bdcc19000c49bb83b9ba.tar.xz
Add support for PI1.2.1 TempRam Done PPI.
Signed-off-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Jeff Fan <jeff.fan@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@14847 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg/Core/Pei/PeiMain/PeiMain.c')
-rw-r--r--MdeModulePkg/Core/Pei/PeiMain/PeiMain.c34
1 files changed, 28 insertions, 6 deletions
diff --git a/MdeModulePkg/Core/Pei/PeiMain/PeiMain.c b/MdeModulePkg/Core/Pei/PeiMain/PeiMain.c
index bf000229aa..6429ad3a21 100644
--- a/MdeModulePkg/Core/Pei/PeiMain/PeiMain.c
+++ b/MdeModulePkg/Core/Pei/PeiMain/PeiMain.c
@@ -120,7 +120,7 @@ ShadowPeiCore (
from SEC to PEI. After switching stack in the PEI core, it will restart
with the old core data.
- @param SecCoreData Points to a data structure containing information about the PEI core's operating
+ @param SecCoreDataPtr Points to a data structure containing information about the PEI core's operating
environment, such as the size and location of temporary RAM, the stack location and
the BFV location.
@param PpiList Points to a list of one or more PPI descriptors to be installed initially by the PEI core.
@@ -137,23 +137,27 @@ ShadowPeiCore (
VOID
EFIAPI
PeiCore (
- IN CONST EFI_SEC_PEI_HAND_OFF *SecCoreData,
+ IN CONST EFI_SEC_PEI_HAND_OFF *SecCoreDataPtr,
IN CONST EFI_PEI_PPI_DESCRIPTOR *PpiList,
IN VOID *Data
)
{
PEI_CORE_INSTANCE PrivateData;
+ EFI_SEC_PEI_HAND_OFF *SecCoreData;
+ EFI_SEC_PEI_HAND_OFF NewSecCoreData;
EFI_STATUS Status;
PEI_CORE_TEMP_POINTERS TempPtr;
PEI_CORE_INSTANCE *OldCoreData;
EFI_PEI_CPU_IO_PPI *CpuIo;
EFI_PEI_PCI_CFG2_PPI *PciCfg;
EFI_HOB_HANDOFF_INFO_TABLE *HandoffInformationTable;
-
+ EFI_PEI_TEMPORARY_RAM_DONE_PPI *TemporaryRamDonePpi;
+
//
// Retrieve context passed into PEI Core
//
- OldCoreData = (PEI_CORE_INSTANCE *)Data;
+ OldCoreData = (PEI_CORE_INSTANCE *) Data;
+ SecCoreData = (EFI_SEC_PEI_HAND_OFF *) SecCoreDataPtr;
//
// Perform PEI Core phase specific actions.
@@ -250,9 +254,11 @@ PeiCore (
//
// Memory is available to the PEI Core and the PEI Core has been shadowed to memory.
//
-
+ CopyMem (&NewSecCoreData, SecCoreDataPtr, sizeof (NewSecCoreData));
+ SecCoreData = &NewSecCoreData;
+
CopyMem (&PrivateData, OldCoreData, sizeof (PrivateData));
-
+
CpuIo = (VOID*)PrivateData.ServiceTableShadow.CpuIo;
PciCfg = (VOID*)PrivateData.ServiceTableShadow.PciCfg;
@@ -329,6 +335,22 @@ PeiCore (
}
} else {
//
+ // Try to locate Temporary RAM Done Ppi.
+ //
+ Status = PeiServicesLocatePpi (
+ &gEfiTemporaryRamDonePpiGuid,
+ 0,
+ NULL,
+ (VOID**)&TemporaryRamDonePpi
+ );
+ if (!EFI_ERROR (Status)) {
+ //
+ // Disable the use of Temporary RAM after the transition from Temporary RAM to Permanent RAM is complete.
+ //
+ TemporaryRamDonePpi->TemporaryRamDone ();
+ }
+
+ //
// Alert any listeners that there is permanent memory available
//
PERF_START (NULL,"DisMem", NULL, 0);