FmpDevicePkg: Add package, library classes, and PCDs
[mirror_edk2.git] / FmpDevicePkg / Include / Library / CapsuleUpdatePolicyLib.h
1 /** @file
2 Provides platform policy services used during a capsule update.
3
4 Copyright (c) 2016, Microsoft Corporation. All rights reserved.<BR>
5 Copyright (c) 2018, Intel Corporation. All rights reserved.<BR>
6
7 Redistribution and use in source and binary forms, with or without
8 modification, are permitted provided that the following conditions are met:
9 1. Redistributions of source code must retain the above copyright notice,
10 this list of conditions and the following disclaimer.
11 2. Redistributions in binary form must reproduce the above copyright notice,
12 this list of conditions and the following disclaimer in the documentation
13 and/or other materials provided with the distribution.
14
15 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
16 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
17 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
18 IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
19 INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
20 BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
21 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
22 LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
23 OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
24 ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25
26 **/
27
28 #ifndef __CAPSULE_UPDATE_POLICY_LIB__
29 #define __CAPSULE_UPDATE_POLICY_LIB__
30
31 /**
32 Determine if the system power state supports a capsule update.
33
34 @param[out] Good Returns TRUE if system power state supports a capsule
35 update. Returns FALSE if system power state does not
36 support a capsule update. Return value is only valid if
37 return status is EFI_SUCCESS.
38
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 power state can not be determined.
42
43 **/
44 EFI_STATUS
45 EFIAPI
46 CheckSystemPower (
47 OUT BOOLEAN *Good
48 );
49
50 /**
51 Determines if the system thermal state supports a capsule update.
52
53 @param[out] Good Returns TRUE if system thermal state supports a capsule
54 update. Returns FALSE if system thermal state does not
55 support a capsule update. Return value is only valid if
56 return status is EFI_SUCCESS.
57
58 @retval EFI_SUCCESS Good parameter has been updated with result.
59 @retval EFI_INVALID_PARAMETER Good is NULL.
60 @retval EFI_DEVICE_ERROR System thermal state can not be determined.
61
62 **/
63 EFI_STATUS
64 EFIAPI
65 CheckSystemThermal (
66 IN OUT BOOLEAN *Good
67 );
68
69 /**
70 Determines if the system environment state supports a capsule update.
71
72 @param[out] Good Returns TRUE if system environment state supports a capsule
73 update. Returns FALSE if system environment state does not
74 support a capsule update. Return value is only valid if
75 return status is EFI_SUCCESS.
76
77 @retval EFI_SUCCESS Good parameter has been updated with result.
78 @retval EFI_INVALID_PARAMETER Good is NULL.
79 @retval EFI_DEVICE_ERROR System environment state can not be determined.
80
81 **/
82 EFI_STATUS
83 EFIAPI
84 CheckSystemEnvironment (
85 IN OUT BOOLEAN *Good
86 );
87
88 /**
89 Determines if the Lowest Supported Version checks should be performed. The
90 expected result from this function is TRUE. A platform can choose to return
91 FALSE (e.g. during manufacturing or servicing) to allow a capsule update to a
92 version below the current Lowest Supported Version.
93
94 @retval TRUE The lowest supported version check is required.
95 @retval FALSE Do not perform lowest support version check.
96
97 **/
98 BOOLEAN
99 EFIAPI
100 IsLowestSupportedVersionCheckRequired (
101 VOID
102 );
103
104 /**
105 Determines if the FMP device should be locked when the event specified by
106 PcdFmpDeviceLockEventGuid is signaled. The expected result from this function
107 is TRUE so the FMP device is always locked. A platform can choose to return
108 FALSE (e.g. during manufacturing) to allow FMP devices to remain unlocked.
109
110 @retval TRUE The FMP device lock action is required at lock event guid.
111 @retval FALSE Do not perform FMP device lock at lock event guid.
112
113 **/
114 BOOLEAN
115 EFIAPI
116 IsLockFmpDeviceAtLockEventGuidRequired (
117 VOID
118 );
119
120 #endif