//\r
LEGACY_BIOS_INSTANCE mPrivateData;\r
\r
-//\r
-// The end of OPROM shadow address\r
-//\r
-UINTN mEndOpromShadowAddress = 0;\r
-\r
/**\r
Do an AllocatePages () of type AllocateMaxAddress for EfiBootServicesCode\r
memory.\r
//\r
Table->EfiSystemTable = (UINT32) (UINTN) gST;\r
\r
- //\r
- // Get the end of OPROM shadow address\r
- //\r
- Status = Private->LegacyBiosPlatform->GetPlatformInfo (\r
- Private->LegacyBiosPlatform,\r
- EfiGetPlatformEndOpromShadowAddr,\r
- NULL,\r
- NULL,\r
- &mEndOpromShadowAddress,\r
- NULL,\r
- 0,\r
- 0\r
- );\r
- if (EFI_ERROR (Status)) {\r
- mEndOpromShadowAddress = 0xDFFFF;\r
- }\r
-\r
//\r
// IPF CSM integration -Bug\r
//\r
}\r
\r
//\r
- // Allocate a 64k area (16 4k pages) for 16-bit code for scratch pad and zero it out\r
+ // Allocate low PMM memory and zero it out\r
//\r
+ MemorySize = PcdGet32 (PcdLowPmmMemorySize);\r
+ ASSERT ((MemorySize & 0xFFF) == 0); \r
Status = AllocateLegacyMemory (\r
AllocateMaxAddress,\r
CONVENTIONAL_MEMORY_TOP,\r
- 16,\r
+ EFI_SIZE_TO_PAGES (MemorySize),\r
&MemoryAddressUnder1MB\r
);\r
ASSERT_EFI_ERROR (Status);\r
\r
- ZeroMem ((VOID *) ((UINTN) MemoryAddressUnder1MB), 0x10000);\r
+ ZeroMem ((VOID *) ((UINTN) MemoryAddressUnder1MB), MemorySize);\r
\r
//\r
// Allocate space for thunker and Init Thunker\r
//\r
EfiToLegacy16InitTable->BiosLessThan1MB = (UINT32) MemoryAddressUnder1MB;\r
EfiToLegacy16InitTable->LowPmmMemory = (UINT32) MemoryAddressUnder1MB;\r
- EfiToLegacy16InitTable->LowPmmMemorySizeInBytes = 0x10000;\r
+ EfiToLegacy16InitTable->LowPmmMemorySizeInBytes = MemorySize;\r
\r
//\r
- // Allocate 4 MB of PMM Memory under 16 MB\r
+ // Allocate high PMM Memory under 16 MB\r
//\r
+ MemorySize = PcdGet32 (PcdHighPmmMemorySize);\r
+ ASSERT ((MemorySize & 0xFFF) == 0); \r
Status = AllocateLegacyMemory (\r
AllocateMaxAddress,\r
0x1000000,\r
- 0x400,\r
+ EFI_SIZE_TO_PAGES (MemorySize),\r
&MemoryAddress\r
);\r
if (!EFI_ERROR (Status)) {\r
EfiToLegacy16InitTable->HiPmmMemory = (UINT32) (EFI_PHYSICAL_ADDRESS) (UINTN) MemoryAddress;\r
- EfiToLegacy16InitTable->HiPmmMemorySizeInBytes = PMM_MEMORY_SIZE;\r
+ EfiToLegacy16InitTable->HiPmmMemorySizeInBytes = MemorySize;\r
}\r
\r
//\r