diff options
author | Laszlo Ersek <lersek@redhat.com> | 2013-12-26 20:44:29 +0000 |
---|---|---|
committer | jljusten <jljusten@6f19259b-4bc3-4df7-8a09-765794883524> | 2013-12-26 20:44:29 +0000 |
commit | 4a9fab7d72dc7f0bf4cae454e403bd939ca6f32d (patch) | |
tree | f8fe5778f5224127784ff9bdd2b25274d1bdf9bc /OvmfPkg/PlatformPei | |
parent | 9ab36385be96377cd97299a975ca9456bbfd887b (diff) | |
download | edk2-platforms-4a9fab7d72dc7f0bf4cae454e403bd939ca6f32d.tar.xz |
OvmfPkg: PlatformPei: reuse PublishPeiMemory() in MemDetect()
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 <lersek@redhat.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15023 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'OvmfPkg/PlatformPei')
-rw-r--r-- | OvmfPkg/PlatformPei/MemDetect.c | 22 |
1 files changed, 4 insertions, 18 deletions
diff --git a/OvmfPkg/PlatformPei/MemDetect.c b/OvmfPkg/PlatformPei/MemDetect.c index 7192b2bf73..a1de762681 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
|