Update the way to allocate high PMM, firstly try to allocate high PMM below 16MB, if it fails, allocate high PMM below 4GB.

Signed-off-by: li-elvin <elvin.li@intel.com>
Reviewed-by: jyao1 <jiewen.yao@intel.com>


git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13352 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
li-elvin 2012-05-23 07:26:17 +00:00
parent bce3e2ab3c
commit 74dee93181

View File

@ -1,6 +1,6 @@
/** @file /** @file
Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR> Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials This program and the accompanying materials
are licensed and made available under the terms and conditions are licensed and made available under the terms and conditions
@ -922,21 +922,32 @@ LegacyBiosInstall (
EfiToLegacy16InitTable->LowPmmMemory = (UINT32) MemoryAddressUnder1MB; EfiToLegacy16InitTable->LowPmmMemory = (UINT32) MemoryAddressUnder1MB;
EfiToLegacy16InitTable->LowPmmMemorySizeInBytes = MemorySize; EfiToLegacy16InitTable->LowPmmMemorySizeInBytes = MemorySize;
MemorySize = PcdGet32 (PcdHighPmmMemorySize);
ASSERT ((MemorySize & 0xFFF) == 0);
// //
// Allocate high PMM Memory under 16 MB // Allocate high PMM Memory under 16 MB
// //
MemorySize = PcdGet32 (PcdHighPmmMemorySize);
ASSERT ((MemorySize & 0xFFF) == 0);
Status = AllocateLegacyMemory ( Status = AllocateLegacyMemory (
AllocateMaxAddress, AllocateMaxAddress,
0x1000000, 0x1000000,
EFI_SIZE_TO_PAGES (MemorySize), EFI_SIZE_TO_PAGES (MemorySize),
&MemoryAddress &MemoryAddress
); );
if (EFI_ERROR (Status)) {
//
// If it fails, allocate high PMM Memory under 4GB
//
Status = AllocateLegacyMemory (
AllocateMaxAddress,
0xFFFFFFFF,
EFI_SIZE_TO_PAGES (MemorySize),
&MemoryAddress
);
}
if (!EFI_ERROR (Status)) { if (!EFI_ERROR (Status)) {
EfiToLegacy16InitTable->HiPmmMemory = (UINT32) (EFI_PHYSICAL_ADDRESS) (UINTN) MemoryAddress; EfiToLegacy16InitTable->HiPmmMemory = (UINT32) (EFI_PHYSICAL_ADDRESS) (UINTN) MemoryAddress;
EfiToLegacy16InitTable->HiPmmMemorySizeInBytes = MemorySize; EfiToLegacy16InitTable->HiPmmMemorySizeInBytes = MemorySize;
} }
// //
// ShutdownAPs(); // ShutdownAPs();