diff options
author | Laszlo Ersek <lersek@redhat.com> | 2013-12-26 20:44:20 +0000 |
---|---|---|
committer | jljusten <jljusten@6f19259b-4bc3-4df7-8a09-765794883524> | 2013-12-26 20:44:20 +0000 |
commit | 9ab36385be96377cd97299a975ca9456bbfd887b (patch) | |
tree | b77b549e20beaf10b381d3d20224436f4e209390 /OvmfPkg/PlatformPei | |
parent | 80873def607ba8056e5aab40eaa3be07e9a5ec19 (diff) | |
download | edk2-platforms-9ab36385be96377cd97299a975ca9456bbfd887b.tar.xz |
OvmfPkg: PlatformPei: simplify memory range expressions in MemDetect()
Exploit that (MemoryBase + MemorySize) always equals LowerMemorySize.
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@15022 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'OvmfPkg/PlatformPei')
-rw-r--r-- | OvmfPkg/PlatformPei/MemDetect.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/OvmfPkg/PlatformPei/MemDetect.c b/OvmfPkg/PlatformPei/MemDetect.c index 9145ebb89d..7192b2bf73 100644 --- a/OvmfPkg/PlatformPei/MemDetect.c +++ b/OvmfPkg/PlatformPei/MemDetect.c @@ -161,11 +161,10 @@ MemDetect ( //
// Create memory HOBs
//
- AddMemoryBaseSizeHob (MemoryBase, MemorySize);
- AddMemoryRangeHob (BASE_1MB, MemoryBase);
+ AddMemoryRangeHob (BASE_1MB, LowerMemorySize);
AddMemoryRangeHob (0, BASE_512KB + BASE_128KB);
- MtrrSetMemoryAttribute (BASE_1MB, MemoryBase + MemorySize - BASE_1MB, CacheWriteBack);
+ MtrrSetMemoryAttribute (BASE_1MB, LowerMemorySize - BASE_1MB, CacheWriteBack);
MtrrSetMemoryAttribute (0, BASE_512KB + BASE_128KB, CacheWriteBack);
@@ -175,6 +174,6 @@ MemDetect ( MtrrSetMemoryAttribute (BASE_4GB, UpperMemorySize, CacheWriteBack);
}
- return MemoryBase + MemorySize;
+ return LowerMemorySize;
}
|