2 UEFI variable support functions for Firmware Management Protocol based
5 Copyright (c) 2016, Microsoft Corporation. All rights reserved.<BR>
6 Copyright (c) 2018, Intel Corporation. All rights reserved.<BR>
8 SPDX-License-Identifier: BSD-2-Clause-Patent
12 #ifndef __VARIABLE_SUPPORT_H__
13 #define __VARIABLE_SUPPORT_H__
15 #define DEFAULT_VERSION 0x1
16 #define DEFAULT_LOWESTSUPPORTEDVERSION 0x0
17 #define DEFAULT_LASTATTEMPT 0x0
19 #define VARNAME_VERSION L"FmpVersion"
20 #define VARNAME_LSV L"FmpLsv"
22 #define VARNAME_LASTATTEMPTSTATUS L"LastAttemptStatus"
23 #define VARNAME_LASTATTEMPTVERSION L"LastAttemptVersion"
26 Returns the value used to fill in the Version field of the
27 EFI_FIRMWARE_IMAGE_DESCRIPTOR structure that is returned by the GetImageInfo()
28 service of the Firmware Management Protocol. The value is read from a UEFI
29 variable. If the UEFI variables does not exist, then a default version value
32 UEFI Variable accessed: GUID = gEfiCallerIdGuid, Name = L"FmpVersion"
34 @return The version of the firmware image in the firmware device.
38 GetVersionFromVariable (
43 Returns the value used to fill in the LowestSupportedVersion field of the
44 EFI_FIRMWARE_IMAGE_DESCRIPTOR structure that is returned by the GetImageInfo()
45 service of the Firmware Management Protocol. The value is read from a UEFI
46 variable. If the UEFI variables does not exist, then a default lowest
47 supported version value is returned.
49 UEFI Variable accessed: GUID = gEfiCallerIdGuid, Name = L"FmpLsv"
51 @return The lowest supported version of the firmware image in the firmware
56 GetLowestSupportedVersionFromVariable (
61 Returns the value used to fill in the LastAttemptStatus field of the
62 EFI_FIRMWARE_IMAGE_DESCRIPTOR structure that is returned by the GetImageInfo()
63 service of the Firmware Management Protocol. The value is read from a UEFI
64 variable. If the UEFI variables does not exist, then a default last attempt
65 status value is returned.
67 UEFI Variable accessed: GUID = gEfiCallerIdGuid, Name = L"LastAttemptStatus"
69 @return The last attempt status value for the most recent capsule update.
73 GetLastAttemptStatusFromVariable (
78 Returns the value used to fill in the LastAttemptVersion field of the
79 EFI_FIRMWARE_IMAGE_DESCRIPTOR structure that is returned by the GetImageInfo()
80 service of the Firmware Management Protocol. The value is read from a UEFI
81 variable. If the UEFI variables does not exist, then a default last attempt
82 version value is returned.
84 UEFI Variable accessed: GUID = gEfiCallerIdGuid, Name = L"LastAttemptVersion"
86 @return The last attempt version value for the most recent capsule update.
90 GetLastAttemptVersionFromVariable (
95 Saves the version current of the firmware image in the firmware device to a
98 UEFI Variable accessed: GUID = gEfiCallerIdGuid, Name = L"FmpVersion"
100 @param[in] Version The version of the firmware image in the firmware device.
104 SetVersionInVariable (
109 Saves the lowest supported version current of the firmware image in the
110 firmware device to a UEFI variable.
112 UEFI Variable accessed: GUID = gEfiCallerIdGuid, Name = L"FmpLsv"
114 @param[in] LowestSupportedVersion The lowest supported version of the firmware image
115 in the firmware device.
119 SetLowestSupportedVersionInVariable (
120 UINT32 LowestSupportedVersion
124 Saves the last attempt status value of the most recent FMP capsule update to a
127 UEFI Variable accessed: GUID = gEfiCallerIdGuid, Name = L"LastAttemptStatus"
129 @param[in] LastAttemptStatus The last attempt status of the most recent FMP
134 SetLastAttemptStatusInVariable (
135 UINT32 LastAttemptStatus
139 Saves the last attempt version value of the most recent FMP capsule update to
142 UEFI Variable accessed: GUID = gEfiCallerIdGuid, Name = L"LastAttemptVersion"
144 @param[in] LastAttemptVersion The last attempt version value of the most
145 recent FMP capsule update.
149 SetLastAttemptVersionInVariable (
150 UINT32 LastAttemptVersion
154 Locks all the UEFI Variables that use gEfiCallerIdGuid of the currently
159 LockAllFmpVariables (