]>
Commit | Line | Data |
---|---|---|
1 | /** @file\r | |
2 | The variable data structure related to EDK II specific UEFI variable implementation.\r | |
3 | \r | |
4 | Copyright (c) 2006 - 2008 Intel Corporation. <BR>\r | |
5 | All rights reserved. This program and the accompanying materials\r | |
6 | are licensed and made available under the terms and conditions of the BSD License\r | |
7 | which accompanies this distribution. The full text of the license may be found at\r | |
8 | http://opensource.org/licenses/bsd-license.php\r | |
9 | \r | |
10 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r | |
11 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r | |
12 | \r | |
13 | **/\r | |
14 | \r | |
15 | #ifndef __VARIABLE_FORMAT_H__\r | |
16 | #define __VARIABLE_FORMAT_H__\r | |
17 | \r | |
18 | ///\r | |
19 | /// Maximum buffer for the single variable.\r | |
20 | ///\r | |
21 | #ifndef MAX_VARIABLE_SIZE\r | |
22 | #define MAX_VARIABLE_SIZE FixedPcdGet32(PcdMaxVariableSize)\r | |
23 | #endif\r | |
24 | \r | |
25 | ///\r | |
26 | /// Maximum buffer for Hardware error record variable\r | |
27 | ///\r | |
28 | #ifndef MAX_HARDWARE_ERROR_VARIABLE_SIZE\r | |
29 | #define MAX_HARDWARE_ERROR_VARIABLE_SIZE FixedPcdGet32(PcdMaxHardwareErrorVariableSize)\r | |
30 | #endif\r | |
31 | \r | |
32 | ///\r | |
33 | /// The alignment of variable's start offset.\r | |
34 | /// For IA32/X64 architecture, the alignment is set to 1, and\r | |
35 | /// 8 is for IPF archtecture.\r | |
36 | ///\r | |
37 | #if defined (MDE_CPU_IPF)\r | |
38 | #define ALIGNMENT 8\r | |
39 | #else\r | |
40 | #define ALIGNMENT 1\r | |
41 | #endif\r | |
42 | \r | |
43 | #define HEADER_ALIGNMENT 4\r | |
44 | \r | |
45 | ///\r | |
46 | /// Variable Store Status\r | |
47 | ///\r | |
48 | typedef enum {\r | |
49 | EfiRaw,\r | |
50 | EfiValid,\r | |
51 | EfiInvalid,\r | |
52 | EfiUnknown\r | |
53 | } VARIABLE_STORE_STATUS;\r | |
54 | \r | |
55 | #pragma pack(1)\r | |
56 | \r | |
57 | #define VARIABLE_STORE_SIGNATURE SIGNATURE_32 ('$', 'V', 'S', 'S')\r | |
58 | \r | |
59 | ///\r | |
60 | /// Variable Store Header Format and State\r | |
61 | ///\r | |
62 | #define VARIABLE_STORE_FORMATTED 0x5a\r | |
63 | #define VARIABLE_STORE_HEALTHY 0xfe\r | |
64 | \r | |
65 | ///\r | |
66 | /// Variable Store region header\r | |
67 | ///\r | |
68 | typedef struct {\r | |
69 | ///\r | |
70 | /// Variable store region signature.\r | |
71 | ///\r | |
72 | UINT32 Signature;\r | |
73 | ///\r | |
74 | /// Size of variable store region including this header\r | |
75 | ///\r | |
76 | UINT32 Size;\r | |
77 | ///\r | |
78 | /// variable region format state\r | |
79 | ///\r | |
80 | UINT8 Format;\r | |
81 | ///\r | |
82 | /// variable region healthy state\r | |
83 | ///\r | |
84 | UINT8 State;\r | |
85 | UINT16 Reserved;\r | |
86 | UINT32 Reserved1;\r | |
87 | } VARIABLE_STORE_HEADER;\r | |
88 | \r | |
89 | ///\r | |
90 | /// Variable data start flag\r | |
91 | ///\r | |
92 | #define VARIABLE_DATA 0x55AA\r | |
93 | \r | |
94 | ///\r | |
95 | /// Variable State flags\r | |
96 | ///\r | |
97 | #define VAR_IN_DELETED_TRANSITION 0xfe /// Variable is in obsolete transistion\r | |
98 | #define VAR_DELETED 0xfd /// Variable is obsolete\r | |
99 | #define VAR_HEADER_VALID_ONLY 0x7f /// Variable header has been valid\r | |
100 | #define VAR_ADDED 0x3f /// Variable has been completely added\r | |
101 | \r | |
102 | ///\r | |
103 | /// Removed\r | |
104 | ///\r | |
105 | #define IS_VARIABLE_STATE(_c, _Mask) (BOOLEAN) (((~_c) & (~_Mask)) != 0)\r | |
106 | \r | |
107 | ///\r | |
108 | /// Variable Data Header Structure\r | |
109 | ///\r | |
110 | typedef struct {\r | |
111 | ///\r | |
112 | /// Variable Data Start Flag\r | |
113 | ///\r | |
114 | UINT16 StartId;\r | |
115 | ///\r | |
116 | /// Variable State defined above\r | |
117 | ///\r | |
118 | UINT8 State;\r | |
119 | UINT8 Reserved;\r | |
120 | ///\r | |
121 | /// Attributes of variable defined in UEFI spec\r | |
122 | ///\r | |
123 | UINT32 Attributes;\r | |
124 | ///\r | |
125 | /// Size of variable Null-terminated Unicode string name\r | |
126 | ///\r | |
127 | UINT32 NameSize;\r | |
128 | ///\r | |
129 | /// Size of the variable data without this header\r | |
130 | ///\r | |
131 | UINT32 DataSize;\r | |
132 | ///\r | |
133 | /// A unique identifier for the vendor.\r | |
134 | ///\r | |
135 | EFI_GUID VendorGuid;\r | |
136 | } VARIABLE_HEADER;\r | |
137 | \r | |
138 | #pragma pack()\r | |
139 | \r | |
140 | #endif // _EFI_VARIABLE_H_\r |