2 The variable data structures are related to EDKII-specific
3 implementation of UEFI authenticated variables.
4 AuthenticatedVariableFormat.h defines variable data headers
5 and variable storage region headers.
7 Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>
8 This program and the accompanying materials
9 are licensed and made available under the terms and conditions of the BSD License
10 which accompanies this distribution. The full text of the license may be found at
11 http://opensource.org/licenses/bsd-license.php
13 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
14 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
18 #ifndef __AUTHENTICATED_VARIABLE_FORMAT_H__
19 #define __AUTHENTICATED_VARIABLE_FORMAT_H__
21 #define EFI_AUTHENTICATED_VARIABLE_GUID \
22 { 0xaaf32c78, 0x947b, 0x439a, { 0xa1, 0x80, 0x2e, 0x14, 0x4e, 0xc3, 0x77, 0x92 } }
24 extern EFI_GUID gEfiAuthenticatedVariableGuid
;
27 /// Alignment of variable name and data, according to the architecture:
28 /// * For IA-32 and Intel(R) 64 architectures: 1.
29 /// * For IA-64 architecture: 8.
31 #if defined (MDE_CPU_IPF)
38 // GET_PAD_SIZE calculates the miminal pad bytes needed to make the current pad size satisfy the alignment requirement.
41 #define GET_PAD_SIZE(a) (0)
43 #define GET_PAD_SIZE(a) (((~a) + 1) & (ALIGNMENT - 1))
47 /// Alignment of Variable Data Header in Variable Store region.
49 #define HEADER_ALIGNMENT 4
50 #define HEADER_ALIGN(Header) (((UINTN) (Header) + HEADER_ALIGNMENT - 1) & (~(HEADER_ALIGNMENT - 1)))
53 /// Status of Variable Store Region.
60 } VARIABLE_STORE_STATUS
;
64 #define VARIABLE_STORE_SIGNATURE EFI_AUTHENTICATED_VARIABLE_GUID
67 /// Variable Store Header Format and State.
69 #define VARIABLE_STORE_FORMATTED 0x5a
70 #define VARIABLE_STORE_HEALTHY 0xfe
73 /// Variable Store region header.
77 /// Variable store region signature.
81 /// Size of entire variable store,
82 /// including size of variable store header but not including the size of FvHeader.
86 /// Variable region format state.
90 /// Variable region healthy state.
95 } VARIABLE_STORE_HEADER
;
98 /// Variable data start flag.
100 #define VARIABLE_DATA 0x55AA
103 /// Variable State flags.
105 #define VAR_IN_DELETED_TRANSITION 0xfe ///< Variable is in obsolete transition.
106 #define VAR_DELETED 0xfd ///< Variable is obsolete.
107 #define VAR_HEADER_VALID_ONLY 0x7f ///< Variable header has been valid.
108 #define VAR_ADDED 0x3f ///< Variable has been completely added.
111 /// Single Variable Data Header Structure.
115 /// Variable Data Start Flag.
119 /// Variable State defined above.
124 /// Attributes of variable defined in UEFI specification.
128 /// Associated monotonic count value against replay attack.
130 UINT64 MonotonicCount
;
132 /// Associated TimeStamp value against replay attack.
136 /// Index of associated public key in database.
140 /// Size of variable null-terminated Unicode string name.
144 /// Size of the variable data without this header.
148 /// A unique identifier for the vendor that produces and consumes this varaible.
155 typedef struct _VARIABLE_INFO_ENTRY VARIABLE_INFO_ENTRY
;
158 /// This structure contains the variable list that is put in EFI system table.
159 /// The variable driver collects all variables that were used at boot service time and produces this list.
160 /// This is an optional feature to dump all used variables in shell environment.
162 struct _VARIABLE_INFO_ENTRY
{
163 VARIABLE_INFO_ENTRY
*Next
; ///< Pointer to next entry.
164 EFI_GUID VendorGuid
; ///< Guid of Variable.
165 CHAR16
*Name
; ///< Name of Variable.
166 UINT32 Attributes
; ///< Attributes of variable defined in UEFI spec.
167 UINT32 ReadCount
; ///< Number of times to read this variable.
168 UINT32 WriteCount
; ///< Number of times to write this variable.
169 UINT32 DeleteCount
; ///< Number of times to delete this variable.
170 UINT32 CacheCount
; ///< Number of times that cache hits this variable.
171 BOOLEAN Volatile
; ///< TRUE if volatile, FALSE if non-volatile.
174 #endif // __AUTHENTICATED_VARIABLE_FORMAT_H__