--- /dev/null
+/** @file\r
+ Provides platform policy services used during a capsule update.\r
+\r
+ Copyright (c) 2016, Microsoft Corporation. All rights reserved.<BR>\r
+ Copyright (c) 2018, Intel Corporation. All rights reserved.<BR>\r
+\r
+ Redistribution and use in source and binary forms, with or without\r
+ modification, are permitted provided that the following conditions are met:\r
+ 1. Redistributions of source code must retain the above copyright notice,\r
+ this list of conditions and the following disclaimer.\r
+ 2. Redistributions in binary form must reproduce the above copyright notice,\r
+ this list of conditions and the following disclaimer in the documentation\r
+ and/or other materials provided with the distribution.\r
+\r
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND\r
+ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\r
+ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\r
+ IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,\r
+ INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,\r
+ BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\r
+ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\r
+ LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE\r
+ OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\r
+ ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
+\r
+**/\r
+\r
+#include <PiDxe.h>\r
+#include <Library/CapsuleUpdatePolicyLib.h>\r
+\r
+/**\r
+ Determine if the system power state supports a capsule update.\r
+\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
+CheckSystemPower (\r
+ OUT BOOLEAN *Good\r
+ )\r
+{\r
+ *Good = TRUE;\r
+ return EFI_SUCCESS;\r
+}\r
+\r
+/**\r
+ Determines if the system thermal state supports a capsule update.\r
+\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
+CheckSystemThermal (\r
+ IN OUT BOOLEAN *Good\r
+ )\r
+{\r
+ *Good = TRUE;\r
+ return EFI_SUCCESS;\r
+}\r
+\r
+/**\r
+ Determines if the system environment state supports a capsule update.\r
+\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
+CheckSystemEnvironment (\r
+ IN OUT BOOLEAN *Good\r
+ )\r
+{\r
+ *Good = TRUE;\r
+ return EFI_SUCCESS;\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
+ @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
+IsLowestSupportedVersionCheckRequired (\r
+ VOID\r
+ )\r
+{\r
+ return TRUE;\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
+ @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
+IsLockFmpDeviceAtLockEventGuidRequired (\r
+ VOID\r
+ )\r
+{\r
+ return TRUE;\r
+}\r