Although SVN r14944 ("OvmfPkg: introduce PublishPeiMemory") copied a big
chunk of code from MemDetect(), calling the new PublishPeiMemory()
function in MemDetect() could not have replaced the original code in the
latter. However, with the help of the previous patch, we can do it now.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <[email protected]>
---
 OvmfPkg/PlatformPei/MemDetect.c | 22 ++++------------------
 1 file changed, 4 insertions(+), 18 deletions(-)

diff --git a/OvmfPkg/PlatformPei/MemDetect.c b/OvmfPkg/PlatformPei/MemDetect.c
index 7192b2b..a1de762 100644
--- a/OvmfPkg/PlatformPei/MemDetect.c
+++ b/OvmfPkg/PlatformPei/MemDetect.c
@@ -101,6 +101,9 @@ PublishPeiMemory (
 
   LowerMemorySize = GetSystemMemorySizeBelow4gb ();
 
+  //
+  // Determine the range of memory to use during PEI
+  //
   MemoryBase = PcdGet32 (PcdOvmfMemFvBase) + PcdGet32 (PcdOvmfMemFvSize);
   MemorySize = LowerMemorySize - MemoryBase;
   if (MemorySize > SIZE_64MB) {
@@ -128,9 +131,6 @@ EFI_PHYSICAL_ADDRESS
 MemDetect (
   )
 {
-  EFI_STATUS                  Status;
-  EFI_PHYSICAL_ADDRESS        MemoryBase;
-  UINT64                      MemorySize;
   UINT64                      LowerMemorySize;
   UINT64                      UpperMemorySize;
 
@@ -142,21 +142,7 @@ MemDetect (
   LowerMemorySize = GetSystemMemorySizeBelow4gb ();
   UpperMemorySize = GetSystemMemorySizeAbove4gb ();
 
-  //
-  // Determine the range of memory to use during PEI
-  //
-  MemoryBase = PcdGet32 (PcdOvmfMemFvBase) + PcdGet32 (PcdOvmfMemFvSize);
-  MemorySize = LowerMemorySize - MemoryBase;
-  if (MemorySize > SIZE_64MB) {
-    MemoryBase = LowerMemorySize - SIZE_64MB;
-    MemorySize = SIZE_64MB;
-  }
-
-  //
-  // Publish this memory to the PEI Core
-  //
-  Status = PublishSystemMemory(MemoryBase, MemorySize);
-  ASSERT_EFI_ERROR (Status);
+  PublishPeiMemory ();
 
   //
   // Create memory HOBs
-- 
1.8.3.1



------------------------------------------------------------------------------
Rapidly troubleshoot problems before they affect your business. Most IT 
organizations don't have a clear picture of how application performance 
affects their revenue. With AppDynamics, you get 100% visibility into your 
Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk
_______________________________________________
edk2-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-devel

Reply via email to