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
This commit is contained in:
Laszlo Ersek 2013-12-26 20:44:20 +00:00 committed by jljusten
parent 80873def60
commit 9ab36385be
1 changed files with 3 additions and 4 deletions

View File

@ -161,11 +161,10 @@ MemDetect (
// //
// Create memory HOBs // Create memory HOBs
// //
AddMemoryBaseSizeHob (MemoryBase, MemorySize); AddMemoryRangeHob (BASE_1MB, LowerMemorySize);
AddMemoryRangeHob (BASE_1MB, MemoryBase);
AddMemoryRangeHob (0, BASE_512KB + BASE_128KB); 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); MtrrSetMemoryAttribute (0, BASE_512KB + BASE_128KB, CacheWriteBack);
@ -175,6 +174,6 @@ MemDetect (
MtrrSetMemoryAttribute (BASE_4GB, UpperMemorySize, CacheWriteBack); MtrrSetMemoryAttribute (BASE_4GB, UpperMemorySize, CacheWriteBack);
} }
return MemoryBase + MemorySize; return LowerMemorySize;
} }