2 The variable data structures are related to EDK II specific UEFI variable implementation.
3 Variable data header and Variable storage region header are defined here.
5 Copyright (c) 2006 - 2008 Intel Corporation. <BR>
6 All rights reserved. This program and the accompanying materials
7 are licensed and made available under the terms and conditions of the BSD License
8 which accompanies this distribution. 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.
26 /// For IA32/X64 architecture, the alignment is set to 1, and 8 is for IPF archtecture.
28 #if defined (MDE_CPU_IPF)
35 // GET_PAD_SIZE to calculate miminal pad bytes to make current size satisfy the alignment requirement
38 #define GET_PAD_SIZE(a) (0)
40 #define GET_PAD_SIZE(a) (((~a) + 1) & (ALIGNMENT - 1))
44 /// Alignment of Variable Data Header in Variable Store region
46 #define HEADER_ALIGNMENT 4
47 #define HEADER_ALIGN(Header) (((UINTN) (Header) + HEADER_ALIGNMENT - 1) & (~(HEADER_ALIGNMENT - 1)))
50 /// Status of Variable Store Region
57 } VARIABLE_STORE_STATUS
;
61 #define VARIABLE_STORE_SIGNATURE EFI_VARIABLE_GUID
64 /// Variable Store Header Format and State
66 #define VARIABLE_STORE_FORMATTED 0x5a
67 #define VARIABLE_STORE_HEALTHY 0xfe
70 /// Variable Store region header
74 /// Variable store region signature.
78 /// Size of entire variable store,
79 /// including size of variable store header but not including the size of FvHeader.
83 /// variable region format state
87 /// variable region healthy state
92 } VARIABLE_STORE_HEADER
;
95 /// Variable data start flag
97 #define VARIABLE_DATA 0x55AA
100 /// Variable State flags
102 #define VAR_IN_DELETED_TRANSITION 0xfe ///< Variable is in obsolete transistion
103 #define VAR_DELETED 0xfd ///< Variable is obsolete
104 #define VAR_HEADER_VALID_ONLY 0x7f ///< Variable header has been valid
105 #define VAR_ADDED 0x3f ///< Variable has been completely added
108 /// Single Variable Data Header Structure
112 /// Variable Data Start Flag
116 /// Variable State defined above
121 /// Attributes of variable defined in UEFI spec
125 /// Size of variable Null-terminated Unicode string name
129 /// Size of the variable data without this header
133 /// A unique identifier for the vendor that produce and consume this varaible.
140 typedef struct _VARIABLE_INFO_ENTRY VARIABLE_INFO_ENTRY
;
143 /// This structure contains the variable list that is put in EFI system table.
144 /// The variable driver collects all used variables at boot service time and produce this list.
145 /// This is an optional feature to dump all used variables in shell environment.
147 struct _VARIABLE_INFO_ENTRY
{
148 VARIABLE_INFO_ENTRY
*Next
; ///> Pointer to next entry
149 EFI_GUID VendorGuid
; ///> Guid of Variable
150 CHAR16
*Name
; ///> Name of Variable
151 UINT32 Attributes
; ///> Attributes of variable defined in UEFI spec
152 UINT32 ReadCount
; ///> Times to read this variable
153 UINT32 WriteCount
; ///> Times to write this variable
154 UINT32 DeleteCount
; ///> Times to delete this variable
155 UINT32 CacheCount
; ///> Times that cache hits this variable
156 BOOLEAN Volatile
; ///> TRUE if volatile FALSE if non-volatile
159 #endif // _EFI_VARIABLE_H_