]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleService.h
MdeModulePkg: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / MdeModulePkg / Universal / CapsuleRuntimeDxe / CapsuleService.h
index 17aa473cbd3f1a81551f725e5d82aa578619bba7..069df3c750808d83e42a7a5b534b93e1a9c10b4f 100644 (file)
@@ -1,92 +1,70 @@
 /** @file\r
-  Include the required header files for Capsule Runtime Service drivers.\r
+  Capsule Runtime Driver produces two UEFI capsule runtime services.\r
+  (UpdateCapsule, QueryCapsuleCapabilities)\r
+  It installs the Capsule Architectural Protocol defined in PI1.0a 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
-are licensed and made available under the terms and conditions of the BSD License\r
-which accompanies this distribution.  The full text of the license may be found at\r
-http://opensource.org/licenses/bsd-license.php\r
+  Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2018, Linaro, Ltd. All rights reserved.<BR>\r
 \r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+  SPDX-License-Identifier: BSD-2-Clause-Patent\r
 \r
 **/\r
 \r
-#ifndef  _CAPSULE_RUNTIME_H_\r
-#define  _CAPSULE_RUNTIME_H_\r
-\r
+#ifndef _CAPSULE_SERVICE_H_\r
+#define _CAPSULE_SERVICE_H_\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/UefiDriverEntryPoint.h>\r
-#include <Library/UefiRuntimeLib.h>\r
 #include <Library/DebugLib.h>\r
 #include <Library/PcdLib.h>\r
-#include <Library/UefiBootServicesTableLib.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
 \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
-  across a system reset, the reset value returned from EFI_QueryCapsuleCapabilities must\r
-  be passed into ResetSystem() and will cause the capsule to be processed by the firmware as\r
-  part of the reset process.\r
-\r
-  @param  CapsuleHeaderArray    Virtual pointer to an array of virtual pointers to the capsules\r
-                                being passed into update capsule.\r
-  @param  CapsuleCount          Number of pointers to EFI_CAPSULE_HEADER in\r
-                                CaspuleHeaderArray.\r
-  @param  ScatterGatherList     Physical pointer to a set of\r
-                                EFI_CAPSULE_BLOCK_DESCRIPTOR that describes the\r
-                                location in physical memory of a set of capsules.\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
-  @retval EFI_SUCCESS           Valid capsule was passed. If\r
-                                CAPSULE_FLAGS_PERSIT_ACROSS_RESET is not set, the\r
-                                capsule has been successfully processed by the firmware.\r
-  @retval EFI_DEVICE_ERROR      The capsule update was started, but failed due to a device error.\r
-  @retval EFI_INVALID_PARAMETER CapsuleCount is Zero, or CapsuleImage is not valid.\r
-                                For across reset capsule image, ScatterGatherList is NULL.\r
-  @retval EFI_UNSUPPORTED       CapsuleImage is not recognized by the firmware.\r
+/**\r
+  Whether the platform supports capsules that persist across reset. Note that\r
+  some platforms only support such capsules at boot time.\r
 \r
+  @return TRUE  if a PersistAcrossReset capsule may be passed to UpdateCapsule()\r
+                at this time\r
+          FALSE otherwise\r
 **/\r
-EFI_STATUS\r
-EFIAPI\r
-UpdateCapsule(\r
-  IN EFI_CAPSULE_HEADER      **CapsuleHeaderArray,\r
-  IN UINTN                   CapsuleCount,\r
-  IN EFI_PHYSICAL_ADDRESS    ScatterGatherList OPTIONAL\r
+BOOLEAN\r
+IsPersistAcrossResetCapsuleSupported (\r
+  VOID\r
   );\r
 \r
 /**\r
-  Returns if the capsule can be supported via UpdateCapsule().\r
+  Writes Back a range of data cache lines covering a set of capsules in memory.\r
 \r
-  @param  CapsuleHeaderArray    Virtual pointer to an array of virtual pointers to the capsules\r
-                                being passed into update capsule.\r
-  @param  CapsuleCount          Number of pointers to EFI_CAPSULE_HEADER in\r
-                                CaspuleHeaderArray.\r
-  @param  MaxiumCapsuleSize     On output the maximum size that UpdateCapsule() can\r
-                                support as an argument to UpdateCapsule() via\r
-                                CapsuleHeaderArray and ScatterGatherList.\r
-  @param  ResetType             Returns the type of reset required for the capsule update.\r
+  Writes Back the data cache lines specified by ScatterGatherList.\r
 \r
-  @retval EFI_SUCCESS           Valid answer returned.\r
-  @retval EFI_UNSUPPORTED       The capsule image is not supported on this platform, and\r
-                                MaximumCapsuleSize and ResetType are undefined.\r
-  @retval EFI_INVALID_PARAMETER MaximumCapsuleSize is NULL, or ResetTyep is NULL,\r
-                                Or CapsuleCount is Zero, or CapsuleImage is not valid.\r
+  @param  ScatterGatherList Physical address of the data structure that\r
+                            describes a set of capsules in memory\r
 \r
 **/\r
-EFI_STATUS\r
-EFIAPI\r
-QueryCapsuleCapabilities(\r
-  IN  EFI_CAPSULE_HEADER   **CapsuleHeaderArray,\r
-  IN  UINTN                CapsuleCount,\r
-  OUT UINT64               *MaxiumCapsuleSize,\r
-  OUT EFI_RESET_TYPE       *ResetType\r
+VOID\r
+CapsuleCacheWriteBack (\r
+  IN  EFI_PHYSICAL_ADDRESS    ScatterGatherList\r
   );\r
 \r
 #endif\r
-\r