MdeModulePkg CapsuleRuntimeDxe: Get PcdMaxSizeNonPopulateCapsule and PcdMaxSizePopulateCapsule by PcdGet32 in EntryPoint.

PcdMaxSizeNonPopulateCapsule and PcdMaxSizePopulateCapsule are declared to support Dynamic, but used by FixedPcdGet32 in CapsuleRuntimeDxe.
QueryCapsuleCapabilities is a runtime interface and PCD protocol can’t be used in runtime environment.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed by: Liming Gao <liming.gao@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@14988 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
Star Zeng
2013-12-16 01:34:01 +00:00
committed by lzeng14
parent 4374c2e535
commit f67eb9d8ba

View File

@ -41,6 +41,9 @@ EFI_HANDLE mNewHandle = NULL;
// //
UINTN mTimes = 0; UINTN mTimes = 0;
UINT32 mMaxSizePopulateCapsule = 0;
UINT32 mMaxSizeNonPopulateCapsule = 0;
/** /**
Create the variable to save the base address of page table and stack Create the variable to save the base address of page table and stack
for transferring into long mode in IA32 PEI. for transferring into long mode in IA32 PEI.
@ -339,13 +342,13 @@ QueryCapsuleCapabilities (
return EFI_UNSUPPORTED; return EFI_UNSUPPORTED;
} }
*ResetType = EfiResetWarm; *ResetType = EfiResetWarm;
*MaxiumCapsuleSize = FixedPcdGet32(PcdMaxSizePopulateCapsule); *MaxiumCapsuleSize = (UINT64) mMaxSizePopulateCapsule;
} else { } else {
// //
// For non-reset capsule image. // For non-reset capsule image.
// //
*ResetType = EfiResetCold; *ResetType = EfiResetCold;
*MaxiumCapsuleSize = FixedPcdGet32(PcdMaxSizeNonPopulateCapsule); *MaxiumCapsuleSize = (UINT64) mMaxSizeNonPopulateCapsule;
} }
return EFI_SUCCESS; return EFI_SUCCESS;
@ -370,7 +373,10 @@ CapsuleServiceInitialize (
) )
{ {
EFI_STATUS Status; EFI_STATUS Status;
mMaxSizePopulateCapsule = PcdGet32(PcdMaxSizePopulateCapsule);
mMaxSizeNonPopulateCapsule = PcdGet32(PcdMaxSizeNonPopulateCapsule);
// //
// When PEI phase is IA32, DXE phase is X64, it is possible that capsule data are // When PEI phase is IA32, DXE phase is X64, it is possible that capsule data are
// put above 4GB, so capsule PEI will transfer to long mode to get capsule data. // put above 4GB, so capsule PEI will transfer to long mode to get capsule data.