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