]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdeModulePkg/CapsuleRuntimeDxe: Introduce PCD to control this feature.
authorWei6 Xu <wei6.xu@intel.com>
Wed, 19 Jun 2019 16:27:09 +0000 (00:27 +0800)
committerZhang, Chao B <chao.b.zhang@intel.com>
Thu, 20 Jun 2019 08:50:41 +0000 (16:50 +0800)
https://github.com/tianocore/tianocore.github.io/wiki/UEFI-Capsule-
on-Disk-Introducation

Introduce PcdCapsuleInRamSupport to turn on/off Capsule In Ram feature.
Platform could choose to drop CapsulePei/CapsuleX64 and not to support
Capsule In Ram.

Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Hao A Wu <hao.a.wu@intel.com>
Cc: Chao B Zhang <chao.b.zhang@intel.com>
Signed-off-by: Wei6 Xu <wei6.xu@intel.com>
Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
Reviewed-by: Chao B Zhang <chao.b.zhang@intel.com>
MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf
MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleService.c

index 338577e293410f90cf5c3eb931f0e754e2ab6d96..9da450722b51be96bdf6563e60cb610f2c3a603e 100644 (file)
@@ -90,6 +90,7 @@
 [Pcd]\r
   gEfiMdeModulePkgTokenSpaceGuid.PcdMaxSizeNonPopulateCapsule   ## SOMETIMES_CONSUMES\r
   gEfiMdeModulePkgTokenSpaceGuid.PcdMaxSizePopulateCapsule      ## SOMETIMES_CONSUMES # Populate Image requires reset support.\r
+  gEfiMdeModulePkgTokenSpaceGuid.PcdCapsuleInRamSupport         ## CONSUMES\r
 \r
 [Pcd.X64]\r
   gEfiMdeModulePkgTokenSpaceGuid.PcdCapsulePeiLongModeStackSize   ## SOMETIMES_CONSUMES\r
index aaf819c4c615e7f2903b77139120c829055bb8e3..77b8f00062a65c833b1724ccc59ac86bd2517773 100644 (file)
@@ -4,7 +4,7 @@
   It installs the Capsule Architectural Protocol defined in PI1.0a to signify\r
   the capsule runtime services are ready.\r
 \r
-Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.<BR>\r
 SPDX-License-Identifier: BSD-2-Clause-Patent\r
 \r
 **/\r
@@ -71,6 +71,14 @@ UpdateCapsule (
   CHAR16                    CapsuleVarName[30];\r
   CHAR16                    *TempVarName;\r
 \r
+  //\r
+  // Check if platform support Capsule In RAM or not.\r
+  // Platform could choose to drop CapsulePei/CapsuleX64 and do not support Capsule In RAM.\r
+  //\r
+  if (!PcdGetBool(PcdCapsuleInRamSupport)) {\r
+    return EFI_UNSUPPORTED;\r
+  }\r
+\r
   //\r
   // Capsule Count can't be less than one.\r
   //\r
@@ -218,6 +226,8 @@ UpdateCapsule (
 \r
 /**\r
   Returns if the capsule can be supported via UpdateCapsule().\r
+  Notice: When PcdCapsuleInRamSupport is unsupported, even this routine returns a valid answer,\r
+  the capsule still is unsupported via UpdateCapsule().\r
 \r
   @param  CapsuleHeaderArray    Virtual pointer to an array of virtual pointers to the capsules\r
                                 being passed into update capsule.\r