]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleService.c
MdeModulePkg/CapsuleRuntimeDxe: clean the capsule payload to DRAM
[mirror_edk2.git] / MdeModulePkg / Universal / CapsuleRuntimeDxe / CapsuleService.c
index 216798d1617e07ecf0ca7d5cc2e150259da2ad95..23fd6d59c59e7d4341c57c78cf5170d990e4d2d3 100644 (file)
@@ -15,22 +15,8 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 \r
 **/\r
 \r
-#include <Uefi.h>\r
-\r
-#include <Protocol/Capsule.h>\r
-#include <Guid/CapsuleVendor.h>\r
-#include <Guid/FmpCapsule.h>\r
-\r
-#include <Library/DebugLib.h>\r
-#include <Library/PcdLib.h>\r
-#include <Library/CapsuleLib.h>\r
-#include <Library/UefiDriverEntryPoint.h>\r
-#include <Library/UefiBootServicesTableLib.h>\r
-#include <Library/UefiRuntimeServicesTableLib.h>\r
-#include <Library/UefiRuntimeLib.h>\r
-#include <Library/BaseLib.h>\r
-#include <Library/PrintLib.h>\r
-#include <Library/BaseMemoryLib.h>\r
+#include "CapsuleService.h"\r
+\r
 //\r
 // Handle for the installation of Capsule Architecture Protocol.\r
 //\r
@@ -44,15 +30,6 @@ UINTN       mTimes      = 0;
 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
-**/\r
-VOID\r
-SaveLongModeContext (\r
-  VOID\r
-  );\r
-\r
 /**\r
   Passes capsules to the firmware with both virtual and physical mapping. Depending on the intended\r
   consumption, the firmware may process the capsule immediately. If the payload should persist\r
@@ -194,10 +171,12 @@ UpdateCapsule (
   //\r
   // Check if the platform supports update capsule across a system reset\r
   //\r
-  if (!FeaturePcdGet(PcdSupportUpdateCapsuleReset)) {\r
+  if (!IsPersistAcrossResetCapsuleSupported ()) {\r
     return EFI_UNSUPPORTED;\r
   }\r
 \r
+  CapsuleCacheWriteBack (ScatterGatherList);\r
+\r
   //\r
   // Construct variable name CapsuleUpdateData, CapsuleUpdateData1, CapsuleUpdateData2...\r
   // if user calls UpdateCapsule multiple times.\r
@@ -344,7 +323,7 @@ QueryCapsuleCapabilities (
     //\r
     //Check if the platform supports update capsule across a system reset\r
     //\r
-    if (!FeaturePcdGet(PcdSupportUpdateCapsuleReset)) {\r
+    if (!IsPersistAcrossResetCapsuleSupported ()) {\r
       return EFI_UNSUPPORTED;\r
     }\r
     *ResetType = EfiResetWarm;\r