]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleService.c
Code scrub for the following drivers and librarys.
[mirror_edk2.git] / MdeModulePkg / Universal / CapsuleRuntimeDxe / CapsuleService.c
index dbb9563188b237edc5b06ae0bfb5e73bad7dc2ee..2d5411a607c07a1799e37f09c4407a5d31d42142 100644 (file)
@@ -1,6 +1,8 @@
 /** @file\r
   Capsule Runtime Drivers produces two UEFI capsule runtime services.\r
   (UpdateCapsule, QueryCapsuleCapabilities)\r
+  It installs the Capsule Architectural Protocol (EDKII definition) to signify \r
+  the capsule runtime services are ready.\r
 \r
 Copyright (c) 2006 - 2008, Intel Corporation. <BR>\r
 All rights reserved. This program and the accompanying materials\r
@@ -13,7 +15,18 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 \r
 **/\r
 \r
-#include "CapsuleService.h"\r
+#include <Uefi.h>\r
+\r
+#include <Protocol/Capsule.h>\r
+#include <Guid/CapsuleVendor.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
 \r
 /**\r
   Passes capsules to the firmware with both virtual and physical mapping. Depending on the intended\r
@@ -90,7 +103,7 @@ UpdateCapsule (
     //\r
     // Check if the platform supports update capsule across a system reset\r
     //\r
-    if (!FeaturePcdGet(PcdSupportUpdateCapsuleRest)) {\r
+    if (!FeaturePcdGet(PcdSupportUpdateCapsuleReset)) {\r
       return EFI_UNSUPPORTED;\r
     }\r
     //\r
@@ -105,13 +118,13 @@ UpdateCapsule (
       // system reset. Set its value into NV storage to let pre-boot driver to pick it up \r
       // after coming through a system reset.\r
       //\r
-      Status = EfiSetVariable (\r
-                 EFI_CAPSULE_VARIABLE_NAME,\r
-                 &gEfiCapsuleVendorGuid,\r
-                 EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_RUNTIME_ACCESS | EFI_VARIABLE_BOOTSERVICE_ACCESS,\r
-                 sizeof (UINTN),\r
-                 (VOID *) &ScatterGatherList\r
-                 );\r
+      Status = gRT->SetVariable (\r
+                     EFI_CAPSULE_VARIABLE_NAME,\r
+                     &gEfiCapsuleVendorGuid,\r
+                     EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_RUNTIME_ACCESS | EFI_VARIABLE_BOOTSERVICE_ACCESS,\r
+                     sizeof (UINTN),\r
+                     (VOID *) &ScatterGatherList\r
+                     );\r
       if (Status != EFI_SUCCESS) {\r
         return Status;\r
       }\r
@@ -219,7 +232,7 @@ QueryCapsuleCapabilities (
     //\r
     //Check if the platform supports update capsule across a system reset\r
     //\r
-    if (!FeaturePcdGet(PcdSupportUpdateCapsuleRest)) {\r
+    if (!FeaturePcdGet(PcdSupportUpdateCapsuleReset)) {\r
       return EFI_UNSUPPORTED;\r
     }\r
     *ResetType = EfiResetWarm;\r
@@ -237,7 +250,7 @@ QueryCapsuleCapabilities (
 \r
 /**\r
 \r
-  This code is to install UEFI capsule runtime service.\r
+  This code installs UEFI capsule runtime service.\r
 \r
   @param  ImageHandle    The firmware allocated handle for the EFI image.  \r
   @param  SystemTable    A pointer to the EFI System Table.\r
@@ -258,8 +271,8 @@ CapsuleServiceInitialize (
   //\r
   // Install capsule runtime services into UEFI runtime service tables.\r
   //\r
-  SystemTable->RuntimeServices->UpdateCapsule                    = UpdateCapsule;\r
-  SystemTable->RuntimeServices->QueryCapsuleCapabilities         = QueryCapsuleCapabilities;\r
+  gRT->UpdateCapsule                    = UpdateCapsule;\r
+  gRT->QueryCapsuleCapabilities         = QueryCapsuleCapabilities;\r
 \r
   //\r
   // Install the Capsule Architectural Protocol on a new handle\r