summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorklu2 <klu2@6f19259b-4bc3-4df7-8a09-765794883524>2009-03-12 07:43:02 +0000
committerklu2 <klu2@6f19259b-4bc3-4df7-8a09-765794883524>2009-03-12 07:43:02 +0000
commit3152f167db23cfb4d777dd4ad5131b4a026ac6f0 (patch)
tree1eae2c6c4eb3549e2dec5766cd7f7e0798a9429c
parent2c0bbf43924f4afa08a8f109db4e0e25de11b187 (diff)
downloadedk2-3152f167db23cfb4d777dd4ad5131b4a026ac6f0.zip
edk2-3152f167db23cfb4d777dd4ad5131b4a026ac6f0.tar.gz
edk2-3152f167db23cfb4d777dd4ad5131b4a026ac6f0.tar.bz2
PeiInstallPeiMemory should only be called one time.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@7867 6f19259b-4bc3-4df7-8a09-765794883524
-rw-r--r--MdeModulePkg/Core/Pei/Memory/MemoryServices.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/MdeModulePkg/Core/Pei/Memory/MemoryServices.c b/MdeModulePkg/Core/Pei/Memory/MemoryServices.c
index 22e04cd..02e83a1 100644
--- a/MdeModulePkg/Core/Pei/Memory/MemoryServices.c
+++ b/MdeModulePkg/Core/Pei/Memory/MemoryServices.c
@@ -89,6 +89,17 @@ PeiInstallPeiMemory (
DEBUG ((EFI_D_INFO, "PeiInstallPeiMemory MemoryBegin 0x%LX, MemoryLength 0x%LX\n", MemoryBegin, MemoryLength));
PrivateData = PEI_CORE_INSTANCE_FROM_PS_THIS (PeiServices);
+ //
+ // PEI_SERVICE.InstallPeiMemory should only be called one time during whole PEI phase.
+ // If it is invoked more than one time, ASSERT information is given for developer debugging in debug tip and
+ // simply return EFI_SUCESS in release tip to ignore it.
+ //
+ if (PrivateData->PeiMemoryInstalled) {
+ DEBUG ((EFI_D_ERROR, "ERROR: PeiInstallPeiMemory is called more than once!\n"));
+ ASSERT (PrivateData->PeiMemoryInstalled);
+ return EFI_SUCCESS;
+ }
+
PrivateData->PhysicalMemoryBegin = MemoryBegin;
PrivateData->PhysicalMemoryLength = MemoryLength;
PrivateData->FreePhysicalMemoryTop = MemoryBegin + MemoryLength;