3 The header of MonotonicBasedVariable.c.
5 Copyright (c) 2011-2019, Intel Corporation. All rights reserved.<BR>
6 SPDX-License-Identifier: BSD-2-Clause-Patent
10 #ifndef __AUTHENTICATED_VARIABLE_FORMAT_H__
11 #define __AUTHENTICATED_VARIABLE_FORMAT_H__
13 #define EFI_AUTHENTICATED_VARIABLE_GUID \
14 { 0x515fa686, 0xb06e, 0x4550, { 0x91, 0x12, 0x38, 0x2b, 0xf1, 0x6, 0x7b, 0xfb }}
16 extern EFI_GUID gEfiAuthenticatedVariableGuid
;
19 /// Alignment of variable name and data, according to the architecture:
20 /// * For IA-32 and Intel(R) 64 architectures: 1
21 /// * For IA-64 architecture: 8
23 #if defined (MDE_CPU_IPF)
30 /// GET_PAD_SIZE calculates the miminal pad bytes needed to make the current pad size satisfy the alignment requirement.
33 #define GET_PAD_SIZE(a) (0)
35 #define GET_PAD_SIZE(a) (((~a) + 1) & (ALIGNMENT - 1))
39 /// Alignment of Variable Data Header in Variable Store region
41 #define HEADER_ALIGNMENT 4
42 #define HEADER_ALIGN(Header) (((UINTN) (Header) + HEADER_ALIGNMENT - 1) & (~(HEADER_ALIGNMENT - 1)))
45 /// Status of Variable Store Region
52 } VARIABLE_STORE_STATUS
;
56 #define VARIABLE_STORE_SIGNATURE EFI_VARIABLE_GUID
59 /// Variable Store Header Format and State
61 #define VARIABLE_STORE_FORMATTED 0x5a
62 #define VARIABLE_STORE_HEALTHY 0xfe
65 /// Variable Store region header
69 /// Variable store region signature.
73 /// Size of entire variable store,
74 /// including size of variable store header but not including the size of FvHeader.
78 /// Variable region format state.
82 /// Variable region healthy state.
87 } VARIABLE_STORE_HEADER
;
90 /// Variable data start flag.
92 #define VARIABLE_DATA 0x55AA
95 /// Variable State flags
97 #define VAR_IN_DELETED_TRANSITION 0xfe ///< Variable is in obsolete transition
98 #define VAR_DELETED 0xfd ///< Variable is obsolete
99 #define VAR_HEADER_VALID_ONLY 0x7f ///< Variable header has been valid
100 #define VAR_ADDED 0x3f ///< Variable has been completely added
103 /// Single Variable Data Header Structure.
107 /// Variable Data Start Flag.
111 /// Variable State defined above.
116 /// Attributes of variable defined in UEFI spec
120 /// Associated monotonic count value against replay attack.
122 UINT64 MonotonicCount
;
124 /// Index of associated public key in database.
128 /// Size of variable null-terminated Unicode string name.
132 /// Size of the variable data without this header.
136 /// A unique identifier for the vendor that produces and consumes this varaible.
143 typedef struct _VARIABLE_INFO_ENTRY VARIABLE_INFO_ENTRY
;
146 /// This structure contains the variable list that is put in EFI system table.
147 /// The variable driver collects all variables that were used at boot service time and produces this list.
148 /// This is an optional feature to dump all used variables in shell environment.
150 struct _VARIABLE_INFO_ENTRY
{
151 VARIABLE_INFO_ENTRY
*Next
; ///< Pointer to next entry.
152 EFI_GUID VendorGuid
; ///< Guid of Variable.
153 CHAR16
*Name
; ///< Name of Variable.
154 UINT32 Attributes
; ///< Attributes of variable defined in UEFI spec.
155 UINT32 ReadCount
; ///< Number of times to read this variable.
156 UINT32 WriteCount
; ///< Number of times to write this variable.
157 UINT32 DeleteCount
; ///< Number of times to delete this variable.
158 UINT32 CacheCount
; ///< Number of times that cache hits this variable.
159 BOOLEAN Volatile
; ///< TRUE if volatile, FALSE if non-volatile.
162 #endif // _EFI_VARIABLE_H_