EmulatorPkg: Add persistent memory in EmuThunkPpi
The persistent memory is for PEIM to use, and won't lose during cold or warm reset. PcdPersistentMemorySize is only used by WinHost.c, other modules can check the persistent memory size using the field PersistentMemorySize. Cc: Andrew Fish <afish@apple.com> Reviewed-by: Ray Ni <ray.ni@intel.com> Signed-off-by: Zhiguang Liu <zhiguang.liu@intel.com>
This commit is contained in:
committed by
mergify[bot]
parent
1c75bf3c21
commit
22f73b6d2d
@@ -450,6 +450,7 @@ Returns:
|
||||
UINTN SystemAffinityMask;
|
||||
INT32 LowBit;
|
||||
UINTN ResetJumpCode;
|
||||
EMU_THUNK_PPI *SecEmuThunkPpi;
|
||||
|
||||
//
|
||||
// Enable the privilege so that RTC driver can successfully run SetTime()
|
||||
@@ -491,7 +492,15 @@ Returns:
|
||||
//
|
||||
// PPIs pased into PEI_CORE
|
||||
//
|
||||
AddThunkPpi (EFI_PEI_PPI_DESCRIPTOR_PPI, &gEmuThunkPpiGuid, &mSecEmuThunkPpi);
|
||||
SecEmuThunkPpi = AllocateZeroPool (sizeof (EMU_THUNK_PPI) + FixedPcdGet32 (PcdPersistentMemorySize));
|
||||
if (SecEmuThunkPpi == NULL) {
|
||||
SecPrint ("ERROR : Can not allocate memory for SecEmuThunkPpi. Exiting.\n");
|
||||
exit (1);
|
||||
}
|
||||
|
||||
CopyMem (SecEmuThunkPpi, &mSecEmuThunkPpi, sizeof (EMU_THUNK_PPI));
|
||||
SecEmuThunkPpi->PersistentMemorySize = FixedPcdGet32 (PcdPersistentMemorySize);
|
||||
AddThunkPpi (EFI_PEI_PPI_DESCRIPTOR_PPI, &gEmuThunkPpiGuid, SecEmuThunkPpi);
|
||||
AddThunkPpi (EFI_PEI_PPI_DESCRIPTOR_PPI, &gEfiPeiReset2PpiGuid, &mEmuReset2Ppi);
|
||||
|
||||
//
|
||||
|
Reference in New Issue
Block a user