CapsuleUpdatePolicyDxe.h 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  1. /** @file
  2. Provides platform policy services used during a capsule update that uses the
  3. services of the EDKII_CAPSULE_UPDATE_POLICY_PROTOCOL.
  4. Copyright (c) 2019, Intel Corporation. All rights reserved.<BR>
  5. SPDX-License-Identifier: BSD-2-Clause-Patent
  6. **/
  7. #ifndef __CAPSULE_UPDATE_POLICY_DXE_H__
  8. #define __CAPSULE_UPDATE_POLICY_DXE_H__
  9. #include <PiDxe.h>
  10. #include <Protocol/CapsuleUpdatePolicy.h>
  11. #include <Library/BaseLib.h>
  12. #include <Library/DebugLib.h>
  13. #include <Library/UefiBootServicesTableLib.h>
  14. #include <Library/CapsuleUpdatePolicyLib.h>
  15. /**
  16. Determine if the system power state supports a capsule update.
  17. @param[in] This A pointer to the EDKII_CAPSULE_UPDATE_POLICY_PROTOCOL instance.
  18. @param[out] Good Returns TRUE if system power state supports a capsule
  19. update. Returns FALSE if system power state does not
  20. support a capsule update. Return value is only valid if
  21. return status is EFI_SUCCESS.
  22. @retval EFI_SUCCESS Good parameter has been updated with result.
  23. @retval EFI_INVALID_PARAMETER Good is NULL.
  24. @retval EFI_DEVICE_ERROR System power state can not be determined.
  25. **/
  26. EFI_STATUS
  27. EFIAPI
  28. CapsuleUpdatePolicyCheckSystemPower (
  29. IN EDKII_CAPSULE_UPDATE_POLICY_PROTOCOL *This,
  30. OUT BOOLEAN *Good
  31. );
  32. /**
  33. Determines if the system thermal state supports a capsule update.
  34. @param[in] This A pointer to the EDKII_CAPSULE_UPDATE_POLICY_PROTOCOL instance.
  35. @param[out] Good Returns TRUE if system thermal state supports a capsule
  36. update. Returns FALSE if system thermal state does not
  37. support a capsule update. Return value is only valid if
  38. return status is EFI_SUCCESS.
  39. @retval EFI_SUCCESS Good parameter has been updated with result.
  40. @retval EFI_INVALID_PARAMETER Good is NULL.
  41. @retval EFI_DEVICE_ERROR System thermal state can not be determined.
  42. **/
  43. EFI_STATUS
  44. EFIAPI
  45. CapsuleUpdatePolicyCheckSystemThermal (
  46. IN EDKII_CAPSULE_UPDATE_POLICY_PROTOCOL *This,
  47. OUT BOOLEAN *Good
  48. );
  49. /**
  50. Determines if the system environment state supports a capsule update.
  51. @param[in] This A pointer to the EDKII_CAPSULE_UPDATE_POLICY_PROTOCOL instance.
  52. @param[out] Good Returns TRUE if system environment state supports a capsule
  53. update. Returns FALSE if system environment state does not
  54. support a capsule update. Return value is only valid if
  55. return status is EFI_SUCCESS.
  56. @retval EFI_SUCCESS Good parameter has been updated with result.
  57. @retval EFI_INVALID_PARAMETER Good is NULL.
  58. @retval EFI_DEVICE_ERROR System environment state can not be determined.
  59. **/
  60. EFI_STATUS
  61. EFIAPI
  62. CapsuleUpdatePolicyCheckSystemEnvironment (
  63. IN EDKII_CAPSULE_UPDATE_POLICY_PROTOCOL *This,
  64. OUT BOOLEAN *Good
  65. );
  66. /**
  67. Determines if the Lowest Supported Version checks should be performed. The
  68. expected result from this function is TRUE. A platform can choose to return
  69. FALSE (e.g. during manufacturing or servicing) to allow a capsule update to a
  70. version below the current Lowest Supported Version.
  71. @param[in] This A pointer to the EDKII_CAPSULE_UPDATE_POLICY_PROTOCOL instance.
  72. @retval TRUE The lowest supported version check is required.
  73. @retval FALSE Do not perform lowest support version check.
  74. **/
  75. BOOLEAN
  76. EFIAPI
  77. CapsuleUpdatePolicyIsLowestSupportedVersionCheckRequired (
  78. IN EDKII_CAPSULE_UPDATE_POLICY_PROTOCOL *This
  79. );
  80. /**
  81. Determines if the FMP device should be locked when the event specified by
  82. PcdFmpDeviceLockEventGuid is signaled. The expected result from this function
  83. is TRUE so the FMP device is always locked. A platform can choose to return
  84. FALSE (e.g. during manufacturing) to allow FMP devices to remain unlocked.
  85. @param[in] This A pointer to the EDKII_CAPSULE_UPDATE_POLICY_PROTOCOL instance.
  86. @retval TRUE The FMP device lock action is required at lock event guid.
  87. @retval FALSE Do not perform FMP device lock at lock event guid.
  88. **/
  89. BOOLEAN
  90. EFIAPI
  91. CapsuleUpdatePolicyIsLockFmpDeviceAtLockEventGuidRequired (
  92. IN EDKII_CAPSULE_UPDATE_POLICY_PROTOCOL *This
  93. );
  94. /**
  95. The user Entry Point for module CapsuleUpdatePolicyDxe. The user code starts
  96. with this function.
  97. @param[in] ImageHandle The firmware allocated handle for the EFI image.
  98. @param[in] SystemTable A pointer to the EFI System Table.
  99. @retval EFI_SUCCESS The entry point is executed successfully.
  100. @retval other Some error occurs when executing this entry point.
  101. **/
  102. EFI_STATUS
  103. EFIAPI
  104. CapsuleUpdatePolicyInitialize (
  105. IN EFI_HANDLE ImageHandle,
  106. IN EFI_SYSTEM_TABLE *SystemTable
  107. );
  108. #endif