MdeModule PeiCore: Support pre memory page allocation

Support pre memory page allocation.
Support FreePages.
Allocation made prior to permanent memory will be
migrated to permanent memory and the HOB updated.

Cc: Liming Gao <liming.gao@intel.com>
Cc: Ruiyu Ni <Ruiyu.Ni@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
This commit is contained in:
Star Zeng
2017-02-23 18:16:09 +08:00
parent 9f43484ce9
commit b2374cecb0
5 changed files with 646 additions and 53 deletions

View File

@ -103,7 +103,7 @@ ConvertSinglePpiPointer (
/**
Migrate PPI Pointers from the temporary memory stack to PEI installed memory.
Migrate PPI Pointers from the temporary memory to PEI installed memory.
@param SecCoreData Points to a data structure containing SEC to PEI handoff data, such as the size
and location of temporary RAM, the stack location and the BFV location.
@ -121,6 +121,20 @@ ConvertPpiPointers (
for (Index = 0; Index < PcdGet32 (PcdPeiCoreMaxPpiSupported); Index++) {
if (Index < PrivateData->PpiData.PpiListEnd || Index > PrivateData->PpiData.NotifyListEnd) {
if (PrivateData->MemoryPages.Size != 0) {
//
// Convert PPI pointer in old memory pages
// It needs to be done before Convert PPI pointer in old Heap
//
ConvertSinglePpiPointer (
&PrivateData->PpiData.PpiListPtrs[Index],
(UINTN)PrivateData->MemoryPages.Base,
(UINTN)PrivateData->MemoryPages.Base + PrivateData->MemoryPages.Size,
PrivateData->MemoryPages.Offset,
PrivateData->MemoryPages.OffsetPositive
);
}
//
// Convert PPI pointer in old Heap
//