]> git.proxmox.com Git - mirror_edk2.git/blob - FmpDevicePkg/Library/CapsuleUpdatePolicyLibNull/CapsuleUpdatePolicyLibNull.c
FmpDevicePkg: Add DSC file to build all package components
[mirror_edk2.git] / FmpDevicePkg / Library / CapsuleUpdatePolicyLibNull / CapsuleUpdatePolicyLibNull.c
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 #include <PiDxe.h>
29 #include <Library/CapsuleUpdatePolicyLib.h>
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 *Good = TRUE;
51 return EFI_SUCCESS;
52 }
53
54 /**
55 Determines if the system thermal state supports a capsule update.
56
57 @param[out] Good Returns TRUE if system thermal state supports a capsule
58 update. Returns FALSE if system thermal state does not
59 support a capsule update. Return value is only valid if
60 return status is EFI_SUCCESS.
61
62 @retval EFI_SUCCESS Good parameter has been updated with result.
63 @retval EFI_INVALID_PARAMETER Good is NULL.
64 @retval EFI_DEVICE_ERROR System thermal state can not be determined.
65
66 **/
67 EFI_STATUS
68 EFIAPI
69 CheckSystemThermal (
70 IN OUT BOOLEAN *Good
71 )
72 {
73 *Good = TRUE;
74 return EFI_SUCCESS;
75 }
76
77 /**
78 Determines if the system environment state supports a capsule update.
79
80 @param[out] Good Returns TRUE if system environment state supports a capsule
81 update. Returns FALSE if system environment state does not
82 support a capsule update. Return value is only valid if
83 return status is EFI_SUCCESS.
84
85 @retval EFI_SUCCESS Good parameter has been updated with result.
86 @retval EFI_INVALID_PARAMETER Good is NULL.
87 @retval EFI_DEVICE_ERROR System environment state can not be determined.
88
89 **/
90 EFI_STATUS
91 EFIAPI
92 CheckSystemEnvironment (
93 IN OUT BOOLEAN *Good
94 )
95 {
96 *Good = TRUE;
97 return EFI_SUCCESS;
98 }
99
100 /**
101 Determines if the Lowest Supported Version checks should be performed. The
102 expected result from this function is TRUE. A platform can choose to return
103 FALSE (e.g. during manufacturing or servicing) to allow a capsule update to a
104 version below the current Lowest Supported Version.
105
106 @retval TRUE The lowest supported version check is required.
107 @retval FALSE Do not perform lowest support version check.
108
109 **/
110 BOOLEAN
111 EFIAPI
112 IsLowestSupportedVersionCheckRequired (
113 VOID
114 )
115 {
116 return TRUE;
117 }
118
119 /**
120 Determines if the FMP device should be locked when the event specified by
121 PcdFmpDeviceLockEventGuid is signaled. The expected result from this function
122 is TRUE so the FMP device is always locked. A platform can choose to return
123 FALSE (e.g. during manufacturing) to allow FMP devices to remain unlocked.
124
125 @retval TRUE The FMP device lock action is required at lock event guid.
126 @retval FALSE Do not perform FMP device lock at lock event guid.
127
128 **/
129 BOOLEAN
130 EFIAPI
131 IsLockFmpDeviceAtLockEventGuidRequired (
132 VOID
133 )
134 {
135 return TRUE;
136 }