From f67eb9d8ba27a9303a9081daa2db374a7b77fbf5 Mon Sep 17 00:00:00 2001 From: Star Zeng Date: Mon, 16 Dec 2013 01:34:01 +0000 Subject: [PATCH] MdeModulePkg CapsuleRuntimeDxe: Get PcdMaxSizeNonPopulateCapsule and PcdMaxSizePopulateCapsule by PcdGet32 in EntryPoint. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 Reviewed by: Liming Gao git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@14988 6f19259b-4bc3-4df7-8a09-765794883524 --- .../Universal/CapsuleRuntimeDxe/CapsuleService.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleService.c b/MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleService.c index 0861a64778..61ee91951b 100644 --- a/MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleService.c +++ b/MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleService.c @@ -41,6 +41,9 @@ EFI_HANDLE mNewHandle = NULL; // UINTN mTimes = 0; +UINT32 mMaxSizePopulateCapsule = 0; +UINT32 mMaxSizeNonPopulateCapsule = 0; + /** Create the variable to save the base address of page table and stack for transferring into long mode in IA32 PEI. @@ -339,13 +342,13 @@ QueryCapsuleCapabilities ( return EFI_UNSUPPORTED; } *ResetType = EfiResetWarm; - *MaxiumCapsuleSize = FixedPcdGet32(PcdMaxSizePopulateCapsule); + *MaxiumCapsuleSize = (UINT64) mMaxSizePopulateCapsule; } else { // // For non-reset capsule image. // *ResetType = EfiResetCold; - *MaxiumCapsuleSize = FixedPcdGet32(PcdMaxSizeNonPopulateCapsule); + *MaxiumCapsuleSize = (UINT64) mMaxSizeNonPopulateCapsule; } return EFI_SUCCESS; @@ -370,7 +373,10 @@ CapsuleServiceInitialize ( ) { 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 // put above 4GB, so capsule PEI will transfer to long mode to get capsule data. -- 2.39.2