The patch attached is to fix the issue that LMFA feature is failed on OVMF. The root cause is that OVMF platform reserved 128k top memory range for EMU variable range before PEI memory range re-locate to specified memory range, which is quite different from real platform. The original implementation has an assumption that AllocatePage will NOT be invoked until PEI memory range is re-located to preassigned memory range, , which is TRUE in most real platform, but FALSE on OVMF platform. So This patch is to enhanced the memory resource HOB re-organization algorithm to eliminate the assumption.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10225 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
jchen20
2010-03-10 02:47:05 +00:00
parent 947a573ada
commit 9bfb494096
2 changed files with 119 additions and 17 deletions

View File

@@ -356,7 +356,7 @@ GetPeCoffImageFixLoadingAssignedAddress(
// relative to top address
//
if ((INT64)PcdGet64(PcdLoadModuleAtFixAddressEnable) < 0) {
ImageContext->ImageAddress = gLoadModuleAtFixAddressConfigurationTable.DxeCodeTopAddress + (INT64)ImageContext->ImageAddress;
ImageContext->ImageAddress = gLoadModuleAtFixAddressConfigurationTable.DxeCodeTopAddress + (INT64)(INTN)ImageContext->ImageAddress;
}
//
// Check if the memory range is avaliable.