mirror of https://github.com/acidanthera/audk.git
AcpiS3Save could try to check PcdIdentifyMappingPageTablePtr is NULL, if it is not, it means someone else has allocate memory for page table, AcpiS3Save could re-use this memory.
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Elvin Li <elvin.li@intel.com> Signed-off-by: Jiewen Yao <jiewen.yao@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15910 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
b5040e4c55
commit
ac790db940
|
@ -328,6 +328,10 @@ S3CreateIdentityMappingPageTables (
|
||||||
VOID *Hob;
|
VOID *Hob;
|
||||||
BOOLEAN Page1GSupport;
|
BOOLEAN Page1GSupport;
|
||||||
|
|
||||||
|
S3NvsPageTableAddress = (EFI_PHYSICAL_ADDRESS) PcdGet64 (PcdIdentifyMappingPageTablePtr);
|
||||||
|
if (S3NvsPageTableAddress != 0x0) {
|
||||||
|
return S3NvsPageTableAddress;
|
||||||
|
} else {
|
||||||
Page1GSupport = FALSE;
|
Page1GSupport = FALSE;
|
||||||
if (PcdGetBool(PcdUse1GPageTable)) {
|
if (PcdGetBool(PcdUse1GPageTable)) {
|
||||||
AsmCpuid (0x80000000, &RegEax, NULL, NULL, NULL);
|
AsmCpuid (0x80000000, &RegEax, NULL, NULL, NULL);
|
||||||
|
@ -389,7 +393,9 @@ S3CreateIdentityMappingPageTables (
|
||||||
//
|
//
|
||||||
S3NvsPageTableAddress = (EFI_PHYSICAL_ADDRESS)(UINTN)AllocateMemoryBelow4G (EfiReservedMemoryType, EFI_PAGES_TO_SIZE(TotalPageTableSize));
|
S3NvsPageTableAddress = (EFI_PHYSICAL_ADDRESS)(UINTN)AllocateMemoryBelow4G (EfiReservedMemoryType, EFI_PAGES_TO_SIZE(TotalPageTableSize));
|
||||||
ASSERT (S3NvsPageTableAddress != 0);
|
ASSERT (S3NvsPageTableAddress != 0);
|
||||||
|
PcdSet64 (PcdIdentifyMappingPageTablePtr, S3NvsPageTableAddress);
|
||||||
return S3NvsPageTableAddress;
|
return S3NvsPageTableAddress;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
//
|
//
|
||||||
// If DXE is running 32-bit mode, no need to establish page table.
|
// If DXE is running 32-bit mode, no need to establish page table.
|
||||||
|
|
|
@ -75,6 +75,9 @@
|
||||||
gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdS3AcpiReservedMemorySize ## CONSUMES
|
gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdS3AcpiReservedMemorySize ## CONSUMES
|
||||||
gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdS3BootScriptStackSize ## CONSUMES
|
gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdS3BootScriptStackSize ## CONSUMES
|
||||||
gEfiMdeModulePkgTokenSpaceGuid.PcdUse1GPageTable
|
gEfiMdeModulePkgTokenSpaceGuid.PcdUse1GPageTable
|
||||||
|
## SOMETIMES_CONSUMES
|
||||||
|
## SOMETIMES_PRODUCES
|
||||||
|
gEfiMdeModulePkgTokenSpaceGuid.PcdIdentifyMappingPageTablePtr
|
||||||
|
|
||||||
[Depex]
|
[Depex]
|
||||||
#
|
#
|
||||||
|
|
Loading…
Reference in New Issue