//\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
// then test if there is enough space for its RT code\r
//\r
RuntimeAddress = Private->OptionRom;\r
- if (RuntimeAddress + *RuntimeImageLength > mEndOpromShadowAddress) {\r
+ if (RuntimeAddress + *RuntimeImageLength > PcdGet32 (PcdEndOpromShadowAddress)) {\r
DEBUG ((EFI_D_ERROR, "return LegacyBiosInstallRom(%d): EFI_OUT_OF_RESOURCES (no more space for OpROM)\n", __LINE__));\r
gBS->FreePages (PhysicalAddress, EFI_SIZE_TO_PAGES (ImageSize));\r
return EFI_OUT_OF_RESOURCES;\r
// test if there is enough space for its INIT code\r
//\r
InitAddress = PCI_START_ADDRESS (Private->OptionRom);\r
- if (InitAddress + ImageSize > mEndOpromShadowAddress) {\r
+ if (InitAddress + ImageSize > PcdGet32 (PcdEndOpromShadowAddress)) {\r
DEBUG ((EFI_D_ERROR, "return LegacyBiosInstallRom(%d): EFI_OUT_OF_RESOURCES (no more space for OpROM)\n", __LINE__));\r
return EFI_OUT_OF_RESOURCES;\r
}\r
# make sure the memory size is large enough to meet boot script executor requiremnt in S3 phase.\r
gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdS3BootScriptStackSize|0x8000|UINT32|0x30000007\r
\r
-\r
+ ## The PCD is used to specify the end of address below 1MB for the OPROM.\r
+ # The last shadowed OpROM should not exceed this address.\r
+ gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdEndOpromShadowAddress|0xdffff|UINT32|0x30000008\r
+ \r
+ ## The PCD is used to specify the low PMM (Post Memory Manager) size with bytes below 1MB.\r
+ # The value should be a multiple of 4KB.\r
+ gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdLowPmmMemorySize|0x10000|UINT32|0x30000009\r
+ \r
+ ## The PCD is used to specify the high PMM (Post Memory Manager) size with bytes above 1MB.\r
+ # The value should be a multiple of 4KB.\r
+ gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdHighPmmMemorySize|0x400000|UINT32|0x3000000a\r