2 The variable data structures are related to EDK II-specific implementation of UEFI variables.
3 VariableFormat.h defines variable data headers and variable storage region headers.
5 Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>
6 This program and the accompanying materials are licensed and made available under
7 the terms and conditions of the BSD License that accompanies this distribution.
8 The full text of the license may be found at
9 http://opensource.org/licenses/bsd-license.php.
11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
12 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
16 #ifndef __VARIABLE_FORMAT_H__
17 #define __VARIABLE_FORMAT_H__
19 #define EFI_VARIABLE_GUID \
20 { 0xddcf3616, 0x3275, 0x4164, { 0x98, 0xb6, 0xfe, 0x85, 0x70, 0x7f, 0xfe, 0x7d } }
22 extern EFI_GUID gEfiVariableGuid
;
25 /// Alignment of variable name and data, according to the architecture:
26 /// * For IA-32 and Intel(R) 64 architectures: 1.
27 /// * For IA-64 architecture: 8.
29 #if defined (MDE_CPU_IPF)
36 // GET_PAD_SIZE calculates the miminal pad bytes needed to make the current pad size satisfy the alignment requirement.
39 #define GET_PAD_SIZE(a) (0)
41 #define GET_PAD_SIZE(a) (((~a) + 1) & (ALIGNMENT - 1))
45 /// Alignment of Variable Data Header in Variable Store region.
47 #define HEADER_ALIGNMENT 4
48 #define HEADER_ALIGN(Header) (((UINTN) (Header) + HEADER_ALIGNMENT - 1) & (~(HEADER_ALIGNMENT - 1)))
51 /// Status of Variable Store Region.
58 } VARIABLE_STORE_STATUS
;
62 #define VARIABLE_STORE_SIGNATURE EFI_VARIABLE_GUID
65 /// Variable Store Header Format and State.
67 #define VARIABLE_STORE_FORMATTED 0x5a
68 #define VARIABLE_STORE_HEALTHY 0xfe
71 /// Variable Store region header.
75 /// Variable store region signature.
79 /// Size of entire variable store,
80 /// including size of variable store header but not including the size of FvHeader.
84 /// Variable region format state.
88 /// Variable region healthy state.
93 } VARIABLE_STORE_HEADER
;
96 /// Variable data start flag.
98 #define VARIABLE_DATA 0x55AA
101 /// Variable State flags.
103 #define VAR_IN_DELETED_TRANSITION 0xfe ///< Variable is in obsolete transition.
104 #define VAR_DELETED 0xfd ///< Variable is obsolete.
105 #define VAR_HEADER_VALID_ONLY 0x7f ///< Variable header has been valid.
106 #define VAR_ADDED 0x3f ///< Variable has been completely added.
109 /// Single Variable Data Header Structure.
113 /// Variable Data Start Flag.
117 /// Variable State defined above.
122 /// Attributes of variable defined in UEFI specification.
126 /// Size of variable null-terminated Unicode string name.
130 /// Size of the variable data without this header.
134 /// A unique identifier for the vendor that produces and consumes this varaible.
141 typedef struct _VARIABLE_INFO_ENTRY VARIABLE_INFO_ENTRY
;
144 /// This structure contains the variable list that is put in EFI system table.
145 /// The variable driver collects all variables that were used at boot service time and produces this list.
146 /// This is an optional feature to dump all used variables in shell environment.
148 struct _VARIABLE_INFO_ENTRY
{
149 VARIABLE_INFO_ENTRY
*Next
; ///< Pointer to next entry.
150 EFI_GUID VendorGuid
; ///< Guid of Variable.
151 CHAR16
*Name
; ///< Name of Variable.
152 UINT32 Attributes
; ///< Attributes of variable defined in UEFI specification.
153 UINT32 ReadCount
; ///< Number of times to read this variable.
154 UINT32 WriteCount
; ///< Number of times to write this variable.
155 UINT32 DeleteCount
; ///< Number of times to delete this variable.
156 UINT32 CacheCount
; ///< Number of times that cache hits this variable.
157 BOOLEAN Volatile
; ///< TRUE if volatile, FALSE if non-volatile.
160 #endif // _EFI_VARIABLE_H_