]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdeModulePkg CapsuleRuntimeDxe: Get PcdMaxSizeNonPopulateCapsule and PcdMaxSizePopula...
authorStar Zeng <star.zeng@intel.com>
Mon, 16 Dec 2013 01:34:01 +0000 (01:34 +0000)
committerlzeng14 <lzeng14@6f19259b-4bc3-4df7-8a09-765794883524>
Mon, 16 Dec 2013 01:34:01 +0000 (01:34 +0000)
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

MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleService.c

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