]> git.proxmox.com Git - mirror_edk2.git/blob - FmpDevicePkg/CapsuleUpdatePolicyDxe/CapsuleUpdatePolicyDxe.h
1be15a40dbcee426e25a2b83ab1408954657b6f9
[mirror_edk2.git] / FmpDevicePkg / CapsuleUpdatePolicyDxe / CapsuleUpdatePolicyDxe.h
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
5 Copyright (c) 2019, Intel Corporation. All rights reserved.<BR>
6
7 SPDX-License-Identifier: BSD-2-Clause-Patent
8
9 **/
10
11 #ifndef __CAPSULE_UPDATE_POLICY_DXE_H__
12 #define __CAPSULE_UPDATE_POLICY_DXE_H__
13
14 #include <PiDxe.h>
15
16 #include <Protocol/CapsuleUpdatePolicy.h>
17
18 #include <Library/BaseLib.h>
19 #include <Library/DebugLib.h>
20 #include <Library/UefiBootServicesTableLib.h>
21 #include <Library/CapsuleUpdatePolicyLib.h>
22
23 /**
24 Determine if the system power state supports a capsule update.
25
26 @param[in] This A pointer to the EDKII_CAPSULE_UPDATE_POLICY_PROTOCOL instance.
27 @param[out] Good Returns TRUE if system power state supports a capsule
28 update. Returns FALSE if system power state does not
29 support a capsule update. Return value is only valid if
30 return status is EFI_SUCCESS.
31
32 @retval EFI_SUCCESS Good parameter has been updated with result.
33 @retval EFI_INVALID_PARAMETER Good is NULL.
34 @retval EFI_DEVICE_ERROR System power state can not be determined.
35
36 **/
37 EFI_STATUS
38 EFIAPI
39 CapsuleUpdatePolicyCheckSystemPower (
40 IN EDKII_CAPSULE_UPDATE_POLICY_PROTOCOL *This,
41 OUT BOOLEAN *Good
42 );
43
44 /**
45 Determines if the system thermal state supports a capsule update.
46
47 @param[in] This A pointer to the EDKII_CAPSULE_UPDATE_POLICY_PROTOCOL instance.
48 @param[out] Good Returns TRUE if system thermal state supports a capsule
49 update. Returns FALSE if system thermal state does not
50 support a capsule update. Return value is only valid if
51 return status is EFI_SUCCESS.
52
53 @retval EFI_SUCCESS Good parameter has been updated with result.
54 @retval EFI_INVALID_PARAMETER Good is NULL.
55 @retval EFI_DEVICE_ERROR System thermal state can not be determined.
56
57 **/
58 EFI_STATUS
59 EFIAPI
60 CapsuleUpdatePolicyCheckSystemThermal (
61 IN EDKII_CAPSULE_UPDATE_POLICY_PROTOCOL *This,
62 OUT BOOLEAN *Good
63 );
64
65 /**
66 Determines if the system environment state supports a capsule update.
67
68 @param[in] This A pointer to the EDKII_CAPSULE_UPDATE_POLICY_PROTOCOL instance.
69 @param[out] Good Returns TRUE if system environment state supports a capsule
70 update. Returns FALSE if system environment state does not
71 support a capsule update. Return value is only valid if
72 return status is EFI_SUCCESS.
73
74 @retval EFI_SUCCESS Good parameter has been updated with result.
75 @retval EFI_INVALID_PARAMETER Good is NULL.
76 @retval EFI_DEVICE_ERROR System environment state can not be determined.
77
78 **/
79 EFI_STATUS
80 EFIAPI
81 CapsuleUpdatePolicyCheckSystemEnvironment (
82 IN EDKII_CAPSULE_UPDATE_POLICY_PROTOCOL *This,
83 OUT BOOLEAN *Good
84 );
85
86 /**
87 Determines if the Lowest Supported Version checks should be performed. The
88 expected result from this function is TRUE. A platform can choose to return
89 FALSE (e.g. during manufacturing or servicing) to allow a capsule update to a
90 version below the current Lowest Supported Version.
91
92 @param[in] This A pointer to the EDKII_CAPSULE_UPDATE_POLICY_PROTOCOL instance.
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 CapsuleUpdatePolicyIsLowestSupportedVersionCheckRequired (
101 IN EDKII_CAPSULE_UPDATE_POLICY_PROTOCOL *This
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 @param[in] This A pointer to the EDKII_CAPSULE_UPDATE_POLICY_PROTOCOL instance.
111
112 @retval TRUE The FMP device lock action is required at lock event guid.
113 @retval FALSE Do not perform FMP device lock at lock event guid.
114
115 **/
116 BOOLEAN
117 EFIAPI
118 CapsuleUpdatePolicyIsLockFmpDeviceAtLockEventGuidRequired (
119 IN EDKII_CAPSULE_UPDATE_POLICY_PROTOCOL *This
120 );
121
122 /**
123 The user Entry Point for module CapsuleUpdatePolicyDxe. The user code starts
124 with this function.
125
126 @param[in] ImageHandle The firmware allocated handle for the EFI image.
127 @param[in] SystemTable A pointer to the EFI System Table.
128
129 @retval EFI_SUCCESS The entry point is executed successfully.
130 @retval other Some error occurs when executing this entry point.
131
132 **/
133 EFI_STATUS
134 EFIAPI
135 CapsuleUpdatePolicyInitialize (
136 IN EFI_HANDLE ImageHandle,
137 IN EFI_SYSTEM_TABLE *SystemTable
138 );
139
140 #endif