]> git.proxmox.com Git - mirror_edk2.git/blobdiff - FmpDevicePkg/CapsuleUpdatePolicyDxe/CapsuleUpdatePolicyDxe.h
FmpDevicePkg: Add Capsule Update Policy Protocol
[mirror_edk2.git] / FmpDevicePkg / CapsuleUpdatePolicyDxe / CapsuleUpdatePolicyDxe.h
diff --git a/FmpDevicePkg/CapsuleUpdatePolicyDxe/CapsuleUpdatePolicyDxe.h b/FmpDevicePkg/CapsuleUpdatePolicyDxe/CapsuleUpdatePolicyDxe.h
new file mode 100644 (file)
index 0000000..1be15a4
--- /dev/null
@@ -0,0 +1,140 @@
+/** @file\r
+  Provides platform policy services used during a capsule update that uses the\r
+  services of the EDKII_CAPSULE_UPDATE_POLICY_PROTOCOL.\r
+\r
+  Copyright (c) 2019, Intel Corporation. All rights reserved.<BR>\r
+\r
+  SPDX-License-Identifier: BSD-2-Clause-Patent\r
+\r
+**/\r
+\r
+#ifndef __CAPSULE_UPDATE_POLICY_DXE_H__\r
+#define __CAPSULE_UPDATE_POLICY_DXE_H__\r
+\r
+#include <PiDxe.h>\r
+\r
+#include <Protocol/CapsuleUpdatePolicy.h>\r
+\r
+#include <Library/BaseLib.h>\r
+#include <Library/DebugLib.h>\r
+#include <Library/UefiBootServicesTableLib.h>\r
+#include <Library/CapsuleUpdatePolicyLib.h>\r
+\r
+/**\r
+  Determine if the system power state supports a capsule update.\r
+\r
+  @param[in]  This  A pointer to the EDKII_CAPSULE_UPDATE_POLICY_PROTOCOL instance.\r
+  @param[out] Good  Returns TRUE if system power state supports a capsule\r
+                    update.  Returns FALSE if system power state does not\r
+                    support a capsule update.  Return value is only valid if\r
+                    return status is EFI_SUCCESS.\r
+\r
+  @retval EFI_SUCCESS            Good parameter has been updated with result.\r
+  @retval EFI_INVALID_PARAMETER  Good is NULL.\r
+  @retval EFI_DEVICE_ERROR       System power state can not be determined.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+CapsuleUpdatePolicyCheckSystemPower (\r
+  IN  EDKII_CAPSULE_UPDATE_POLICY_PROTOCOL  *This,\r
+  OUT BOOLEAN                               *Good\r
+  );\r
+\r
+/**\r
+  Determines if the system thermal state supports a capsule update.\r
+\r
+  @param[in]  This  A pointer to the EDKII_CAPSULE_UPDATE_POLICY_PROTOCOL instance.\r
+  @param[out] Good  Returns TRUE if system thermal state supports a capsule\r
+                    update.  Returns FALSE if system thermal state does not\r
+                    support a capsule update.  Return value is only valid if\r
+                    return status is EFI_SUCCESS.\r
+\r
+  @retval EFI_SUCCESS            Good parameter has been updated with result.\r
+  @retval EFI_INVALID_PARAMETER  Good is NULL.\r
+  @retval EFI_DEVICE_ERROR       System thermal state can not be determined.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+CapsuleUpdatePolicyCheckSystemThermal (\r
+  IN  EDKII_CAPSULE_UPDATE_POLICY_PROTOCOL  *This,\r
+  OUT BOOLEAN                               *Good\r
+  );\r
+\r
+/**\r
+  Determines if the system environment state supports a capsule update.\r
+\r
+  @param[in]  This  A pointer to the EDKII_CAPSULE_UPDATE_POLICY_PROTOCOL instance.\r
+  @param[out] Good  Returns TRUE if system environment state supports a capsule\r
+                    update.  Returns FALSE if system environment state does not\r
+                    support a capsule update.  Return value is only valid if\r
+                    return status is EFI_SUCCESS.\r
+\r
+  @retval EFI_SUCCESS            Good parameter has been updated with result.\r
+  @retval EFI_INVALID_PARAMETER  Good is NULL.\r
+  @retval EFI_DEVICE_ERROR       System environment state can not be determined.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+CapsuleUpdatePolicyCheckSystemEnvironment (\r
+  IN  EDKII_CAPSULE_UPDATE_POLICY_PROTOCOL  *This,\r
+  OUT BOOLEAN                               *Good\r
+  );\r
+\r
+/**\r
+  Determines if the Lowest Supported Version checks should be performed.  The\r
+  expected result from this function is TRUE.  A platform can choose to return\r
+  FALSE (e.g. during manufacturing or servicing) to allow a capsule update to a\r
+  version below the current Lowest Supported Version.\r
+\r
+  @param[in]  This  A pointer to the EDKII_CAPSULE_UPDATE_POLICY_PROTOCOL instance.\r
+\r
+  @retval TRUE   The lowest supported version check is required.\r
+  @retval FALSE  Do not perform lowest support version check.\r
+\r
+**/\r
+BOOLEAN\r
+EFIAPI\r
+CapsuleUpdatePolicyIsLowestSupportedVersionCheckRequired (\r
+  IN  EDKII_CAPSULE_UPDATE_POLICY_PROTOCOL  *This\r
+  );\r
+\r
+/**\r
+  Determines if the FMP device should be locked when the event specified by\r
+  PcdFmpDeviceLockEventGuid is signaled. The expected result from this function\r
+  is TRUE so the FMP device is always locked.  A platform can choose to return\r
+  FALSE (e.g. during manufacturing) to allow FMP devices to remain unlocked.\r
+\r
+  @param[in]  This  A pointer to the EDKII_CAPSULE_UPDATE_POLICY_PROTOCOL instance.\r
+\r
+  @retval TRUE   The FMP device lock action is required at lock event guid.\r
+  @retval FALSE  Do not perform FMP device lock at lock event guid.\r
+\r
+**/\r
+BOOLEAN\r
+EFIAPI\r
+CapsuleUpdatePolicyIsLockFmpDeviceAtLockEventGuidRequired (\r
+  IN  EDKII_CAPSULE_UPDATE_POLICY_PROTOCOL  *This\r
+  );\r
+\r
+/**\r
+  The user Entry Point for module CapsuleUpdatePolicyDxe. The user code starts\r
+  with this function.\r
+\r
+  @param[in] ImageHandle    The firmware allocated handle for the EFI image.\r
+  @param[in] SystemTable    A pointer to the EFI System Table.\r
+\r
+  @retval EFI_SUCCESS       The entry point is executed successfully.\r
+  @retval other             Some error occurs when executing this entry point.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+CapsuleUpdatePolicyInitialize (\r
+  IN EFI_HANDLE        ImageHandle,\r
+  IN EFI_SYSTEM_TABLE  *SystemTable\r
+  );\r
+\r
+#endif\r