TianoCore EDK2 master
Loading...
Searching...
No Matches
VariableFormat.h
Go to the documentation of this file.
1
10#ifndef __VARIABLE_FORMAT_H__
11#define __VARIABLE_FORMAT_H__
12
13#define EFI_VARIABLE_GUID \
14 { 0xddcf3616, 0x3275, 0x4164, { 0x98, 0xb6, 0xfe, 0x85, 0x70, 0x7f, 0xfe, 0x7d } }
15
16#define EFI_AUTHENTICATED_VARIABLE_GUID \
17 { 0xaaf32c78, 0x947b, 0x439a, { 0xa1, 0x80, 0x2e, 0x14, 0x4e, 0xc3, 0x77, 0x92 } }
18
19extern EFI_GUID gEfiVariableGuid;
20extern EFI_GUID gEfiAuthenticatedVariableGuid;
21
26#define ALIGNMENT 1
27
28//
29// GET_PAD_SIZE calculates the miminal pad bytes needed to make the current pad size satisfy the alignment requirement.
30//
31#if (ALIGNMENT == 1)
32#define GET_PAD_SIZE(a) (0)
33#else
34#define GET_PAD_SIZE(a) (((~a) + 1) & (ALIGNMENT - 1))
35#endif
36
40#define HEADER_ALIGNMENT 4
41#define HEADER_ALIGN(Header) (((UINTN) (Header) + HEADER_ALIGNMENT - 1) & (~(HEADER_ALIGNMENT - 1)))
42
46typedef enum {
47 EfiRaw,
48 EfiValid,
49 EfiInvalid,
50 EfiUnknown
52
53#pragma pack(1)
54
55#define VARIABLE_STORE_SIGNATURE EFI_VARIABLE_GUID
56#define AUTHENTICATED_VARIABLE_STORE_SIGNATURE EFI_AUTHENTICATED_VARIABLE_GUID
57
61#define VARIABLE_STORE_FORMATTED 0x5a
62#define VARIABLE_STORE_HEALTHY 0xfe
63
67typedef struct {
76 UINT32 Size;
80 UINT8 Format;
84 UINT8 State;
85 UINT16 Reserved;
86 UINT32 Reserved1;
88
92#define VARIABLE_DATA 0x55AA
93
97#define VAR_IN_DELETED_TRANSITION 0xfe
98#define VAR_DELETED 0xfd
99#define VAR_HEADER_VALID_ONLY 0x7f
100#define VAR_ADDED 0x3f
101
105#define VARIABLE_ATTRIBUTE_NV_BS (EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS)
106#define VARIABLE_ATTRIBUTE_BS_RT (EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS)
107#define VARIABLE_ATTRIBUTE_BS_RT_AT (VARIABLE_ATTRIBUTE_BS_RT | EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS)
108#define VARIABLE_ATTRIBUTE_NV_BS_RT (VARIABLE_ATTRIBUTE_BS_RT | EFI_VARIABLE_NON_VOLATILE)
109#define VARIABLE_ATTRIBUTE_NV_BS_RT_HR (VARIABLE_ATTRIBUTE_NV_BS_RT | EFI_VARIABLE_HARDWARE_ERROR_RECORD)
110#define VARIABLE_ATTRIBUTE_NV_BS_RT_AT (VARIABLE_ATTRIBUTE_NV_BS_RT | EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS)
111#define VARIABLE_ATTRIBUTE_AT EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS
112#define VARIABLE_ATTRIBUTE_NV_BS_RT_HR_AT (VARIABLE_ATTRIBUTE_NV_BS_RT_HR | VARIABLE_ATTRIBUTE_AT)
116#define VARIABLE_ATTRIBUTE_AT_AW (EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS | EFI_VARIABLE_AUTHENTICATED_WRITE_ACCESS)
117#define VARIABLE_ATTRIBUTE_NV_BS_RT_AW (VARIABLE_ATTRIBUTE_NV_BS_RT | EFI_VARIABLE_AUTHENTICATED_WRITE_ACCESS)
118#define VARIABLE_ATTRIBUTE_NV_BS_RT_HR_AT_AW (VARIABLE_ATTRIBUTE_NV_BS_RT_HR | VARIABLE_ATTRIBUTE_AT_AW)
119
123typedef struct {
127 UINT16 StartId;
131 UINT8 State;
132 UINT8 Reserved;
140 UINT32 NameSize;
144 UINT32 DataSize;
150
154typedef struct {
158 UINT16 StartId;
162 UINT8 State;
163 UINT8 Reserved;
183 UINT32 NameSize;
187 UINT32 DataSize;
193
194typedef struct {
195 EFI_GUID *Guid;
196 CHAR16 *Name;
197 UINTN VariableSize;
199
200#pragma pack()
201
203
212 CHAR16 *Name;
213 UINT32 Attributes;
214 UINT32 ReadCount;
215 UINT32 WriteCount;
216 UINT32 DeleteCount;
217 UINT32 CacheCount;
218 BOOLEAN Volatile;
219};
220
221#endif // _EFI_VARIABLE_H_
UINT64 UINTN
VARIABLE_STORE_STATUS
UINT32 DeleteCount
Number of times to delete this variable.
VARIABLE_INFO_ENTRY * Next
Pointer to next entry.
UINT32 CacheCount
Number of times that cache hits this variable.
UINT32 ReadCount
Number of times to read this variable.
CHAR16 * Name
Name of Variable.
BOOLEAN Volatile
TRUE if volatile, FALSE if non-volatile.
EFI_GUID VendorGuid
Guid of Variable.
UINT32 WriteCount
Number of times to write this variable.
UINT32 Attributes
Attributes of variable defined in UEFI specification.
Definition: Base.h:213