]>
Commit | Line | Data |
---|---|---|
959ccb23 | 1 | /** @file\r |
00edb218 | 2 | This includes some definitions introduced in UEFI that will be used in both PEI and DXE phases.\r |
959ccb23 | 3 | \r |
403170bb | 4 | Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.<BR>\r |
fbb393ab LL |
5 | This program and the accompanying materials are licensed and made available under\r |
6 | the terms and conditions of the BSD License that accompanies this distribution.\r | |
af2dc6a7 | 7 | The full text of the license may be found at\r |
fbb393ab LL |
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 | |
959ccb23 | 12 | \r |
959ccb23 | 13 | **/\r |
14 | \r | |
15 | #ifndef __UEFI_MULTIPHASE_H__\r | |
16 | #define __UEFI_MULTIPHASE_H__\r | |
17 | \r | |
8bbb56b4 LL |
18 | ///\r |
19 | /// Attributes of variable.\r | |
20 | ///\r | |
21 | #define EFI_VARIABLE_NON_VOLATILE 0x00000001\r | |
22 | #define EFI_VARIABLE_BOOTSERVICE_ACCESS 0x00000002\r | |
23 | #define EFI_VARIABLE_RUNTIME_ACCESS 0x00000004\r | |
24 | ///\r | |
25 | /// This attribute is identified by the mnemonic 'HR'\r | |
26 | /// elsewhere in this specification.\r | |
27 | ///\r | |
28 | #define EFI_VARIABLE_HARDWARE_ERROR_RECORD 0x00000008\r | |
29 | ///\r | |
30 | /// Attributes of Authenticated Variable\r | |
31 | ///\r | |
32 | #define EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS 0x00000020\r | |
33 | #define EFI_VARIABLE_APPEND_WRITE 0x00000040\r | |
34 | ///\r | |
35 | /// NOTE: EFI_VARIABLE_AUTHENTICATED_WRITE_ACCESS is deprecated and should be considered reserved.\r | |
36 | ///\r | |
37 | #define EFI_VARIABLE_AUTHENTICATED_WRITE_ACCESS 0x00000010\r | |
38 | \r | |
39 | #ifndef VFRCOMPILE\r | |
bd86cb02 | 40 | #include <Guid/WinCertificate.h>\r |
8b13229b | 41 | ///\r |
42 | /// Enumeration of memory types introduced in UEFI.\r | |
fbb393ab | 43 | ///\r |
959ccb23 | 44 | typedef enum {\r |
1bf79370 LG |
45 | ///\r |
46 | /// Not used.\r | |
47 | ///\r | |
00edb218 | 48 | EfiReservedMemoryType,\r |
1bf79370 | 49 | ///\r |
fbb393ab | 50 | /// The code portions of a loaded application.\r |
1bf79370 LG |
51 | /// (Note that UEFI OS loaders are UEFI applications.)\r |
52 | ///\r | |
00edb218 | 53 | EfiLoaderCode,\r |
1bf79370 LG |
54 | ///\r |
55 | /// The data portions of a loaded application and the default data allocation\r | |
56 | /// type used by an application to allocate pool memory.\r | |
57 | ///\r | |
00edb218 | 58 | EfiLoaderData,\r |
1bf79370 | 59 | ///\r |
af2dc6a7 | 60 | /// The code portions of a loaded Boot Services Driver.\r |
1bf79370 | 61 | ///\r |
00edb218 | 62 | EfiBootServicesCode,\r |
1bf79370 LG |
63 | ///\r |
64 | /// The data portions of a loaded Boot Serves Driver, and the default data\r | |
65 | /// allocation type used by a Boot Services Driver to allocate pool memory.\r | |
66 | ///\r | |
00edb218 | 67 | EfiBootServicesData,\r |
1bf79370 LG |
68 | ///\r |
69 | /// The code portions of a loaded Runtime Services Driver.\r | |
70 | ///\r | |
00edb218 | 71 | EfiRuntimeServicesCode,\r |
1bf79370 LG |
72 | ///\r |
73 | /// The data portions of a loaded Runtime Services Driver and the default\r | |
74 | /// data allocation type used by a Runtime Services Driver to allocate pool memory.\r | |
75 | ///\r | |
00edb218 | 76 | EfiRuntimeServicesData,\r |
1bf79370 LG |
77 | ///\r |
78 | /// Free (unallocated) memory.\r | |
79 | ///\r | |
00edb218 | 80 | EfiConventionalMemory,\r |
1bf79370 LG |
81 | ///\r |
82 | /// Memory in which errors have been detected.\r | |
83 | ///\r | |
00edb218 | 84 | EfiUnusableMemory,\r |
1bf79370 LG |
85 | ///\r |
86 | /// Memory that holds the ACPI tables.\r | |
87 | ///\r | |
00edb218 | 88 | EfiACPIReclaimMemory,\r |
1bf79370 LG |
89 | ///\r |
90 | /// Address space reserved for use by the firmware.\r | |
91 | ///\r | |
00edb218 | 92 | EfiACPIMemoryNVS,\r |
1bf79370 LG |
93 | ///\r |
94 | /// Used by system firmware to request that a memory-mapped IO region\r | |
95 | /// be mapped by the OS to a virtual address so it can be accessed by EFI runtime services.\r | |
96 | ///\r | |
00edb218 | 97 | EfiMemoryMappedIO,\r |
1bf79370 LG |
98 | ///\r |
99 | /// System memory-mapped IO region that is used to translate memory\r | |
100 | /// cycles to IO cycles by the processor.\r | |
101 | ///\r | |
00edb218 | 102 | EfiMemoryMappedIOPortSpace,\r |
1bf79370 LG |
103 | ///\r |
104 | /// Address space reserved by the firmware for code that is part of the processor.\r | |
105 | ///\r | |
00edb218 | 106 | EfiPalCode,\r |
6c98edac LG |
107 | ///\r |
108 | /// A memory region that operates as EfiConventionalMemory, \r | |
109 | /// however it happens to also support byte-addressable non-volatility.\r | |
110 | ///\r | |
111 | EfiPersistentMemory,\r | |
00edb218 | 112 | EfiMaxMemoryType\r |
959ccb23 | 113 | } EFI_MEMORY_TYPE;\r |
114 | \r | |
ddcf46b2 SZ |
115 | ///\r |
116 | /// Enumeration of reset types.\r | |
117 | ///\r | |
118 | typedef enum {\r | |
119 | ///\r | |
120 | /// Used to induce a system-wide reset. This sets all circuitry within the\r | |
121 | /// system to its initial state. This type of reset is asynchronous to system\r | |
122 | /// operation and operates withgout regard to cycle boundaries. EfiColdReset\r | |
123 | /// is tantamount to a system power cycle.\r | |
124 | ///\r | |
125 | EfiResetCold,\r | |
126 | ///\r | |
127 | /// Used to induce a system-wide initialization. The processors are set to their\r | |
128 | /// initial state, and pending cycles are not corrupted. If the system does\r | |
129 | /// not support this reset type, then an EfiResetCold must be performed.\r | |
130 | ///\r | |
131 | EfiResetWarm,\r | |
132 | ///\r | |
133 | /// Used to induce an entry into a power state equivalent to the ACPI G2/S5 or G3\r | |
134 | /// state. If the system does not support this reset type, then when the system\r | |
135 | /// is rebooted, it should exhibit the EfiResetCold attributes.\r | |
136 | ///\r | |
137 | EfiResetShutdown,\r | |
138 | ///\r | |
139 | /// Used to induce a system-wide reset. The exact type of the reset is defined by\r | |
140 | /// the EFI_GUID that follows the Null-terminated Unicode string passed into\r | |
141 | /// ResetData. If the platform does not recognize the EFI_GUID in ResetData the\r | |
142 | /// platform must pick a supported reset type to perform. The platform may\r | |
143 | /// optionally log the parameters from any non-normal reset that occurs.\r | |
144 | ///\r | |
145 | EfiResetPlatformSpecific\r | |
146 | } EFI_RESET_TYPE;\r | |
147 | \r | |
8b13229b | 148 | ///\r |
149 | /// Data structure that precedes all of the standard EFI table types.\r | |
fbb393ab | 150 | ///\r |
959ccb23 | 151 | typedef struct {\r |
1bf79370 LG |
152 | ///\r |
153 | /// A 64-bit signature that identifies the type of table that follows.\r | |
154 | /// Unique signatures have been generated for the EFI System Table,\r | |
155 | /// the EFI Boot Services Table, and the EFI Runtime Services Table.\r | |
156 | ///\r | |
00edb218 | 157 | UINT64 Signature;\r |
1bf79370 LG |
158 | ///\r |
159 | /// The revision of the EFI Specification to which this table\r | |
160 | /// conforms. The upper 16 bits of this field contain the major\r | |
161 | /// revision value, and the lower 16 bits contain the minor revision\r | |
162 | /// value. The minor revision values are limited to the range of 00..99.\r | |
163 | ///\r | |
00edb218 | 164 | UINT32 Revision;\r |
1bf79370 LG |
165 | ///\r |
166 | /// The size, in bytes, of the entire table including the EFI_TABLE_HEADER.\r | |
167 | ///\r | |
00edb218 | 168 | UINT32 HeaderSize;\r |
1bf79370 LG |
169 | ///\r |
170 | /// The 32-bit CRC for the entire table. This value is computed by\r | |
171 | /// setting this field to 0, and computing the 32-bit CRC for HeaderSize bytes.\r | |
172 | ///\r | |
00edb218 | 173 | UINT32 CRC32;\r |
1bf79370 LG |
174 | ///\r |
175 | /// Reserved field that must be set to 0.\r | |
176 | ///\r | |
00edb218 | 177 | UINT32 Reserved;\r |
959ccb23 | 178 | } EFI_TABLE_HEADER;\r |
179 | \r | |
fbb393ab | 180 | ///\r |
3ed785e9 | 181 | /// AuthInfo is a WIN_CERTIFICATE using the wCertificateType\r |
182 | /// WIN_CERTIFICATE_UEFI_GUID and the CertType\r | |
85560919 | 183 | /// EFI_CERT_TYPE_RSA2048_SHA256_GUID. If the attribute specifies\r |
3ed785e9 | 184 | /// authenticated access, then the Data buffer should begin with an\r |
185 | /// authentication descriptor prior to the data payload and DataSize\r | |
186 | /// should reflect the the data.and descriptor size. The caller\r | |
187 | /// shall digest the Monotonic Count value and the associated data\r | |
188 | /// for the variable update using the SHA-256 1-way hash algorithm.\r | |
189 | /// The ensuing the 32-byte digest will be signed using the private\r | |
190 | /// key associated w/ the public/private 2048-bit RSA key-pair. The\r | |
191 | /// WIN_CERTIFICATE shall be used to describe the signature of the\r | |
192 | /// Variable data *Data. In addition, the signature will also\r | |
af2dc6a7 | 193 | /// include the MonotonicCount value to guard against replay attacks.\r |
fbb393ab | 194 | ///\r |
959ccb23 | 195 | typedef struct {\r |
3ed785e9 | 196 | ///\r |
fbb393ab | 197 | /// Included in the signature of\r |
3ed785e9 | 198 | /// AuthInfo.Used to ensure freshness/no\r |
fbb393ab LL |
199 | /// replay. Incremented during each\r |
200 | /// "Write" access.\r | |
201 | ///\r | |
00edb218 | 202 | UINT64 MonotonicCount;\r |
3ed785e9 | 203 | ///\r |
fbb393ab LL |
204 | /// Provides the authorization for the variable\r |
205 | /// access. It is a signature across the\r | |
206 | /// variable data and the Monotonic Count\r | |
207 | /// value. Caller uses Private key that is\r | |
208 | /// associated with a public key that has been\r | |
209 | /// provisioned via the key exchange.\r | |
3ed785e9 | 210 | ///\r |
00edb218 | 211 | WIN_CERTIFICATE_UEFI_GUID AuthInfo;\r |
959ccb23 | 212 | } EFI_VARIABLE_AUTHENTICATION;\r |
213 | \r | |
ab0eecec | 214 | ///\r |
fbb393ab | 215 | /// When the attribute EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS is\r |
ab0eecec | 216 | /// set, then the Data buffer shall begin with an instance of a complete (and serialized)\r |
fbb393ab LL |
217 | /// EFI_VARIABLE_AUTHENTICATION_2 descriptor. The descriptor shall be followed by the new\r |
218 | /// variable value and DataSize shall reflect the combined size of the descriptor and the new\r | |
219 | /// variable value. The authentication descriptor is not part of the variable data and is not\r | |
ab0eecec | 220 | /// returned by subsequent calls to GetVariable().\r |
221 | ///\r | |
222 | typedef struct {\r | |
223 | ///\r | |
fbb393ab | 224 | /// For the TimeStamp value, components Pad1, Nanosecond, TimeZone, Daylight and\r |
ab0eecec | 225 | /// Pad2 shall be set to 0. This means that the time shall always be expressed in GMT.\r |
226 | ///\r | |
227 | EFI_TIME TimeStamp;\r | |
fbb393ab | 228 | ///\r |
ab0eecec | 229 | /// Only a CertType of EFI_CERT_TYPE_PKCS7_GUID is accepted.\r |
230 | ///\r | |
231 | WIN_CERTIFICATE_UEFI_GUID AuthInfo;\r | |
232 | } EFI_VARIABLE_AUTHENTICATION_2;\r | |
8bbb56b4 | 233 | #endif // VFRCOMPILE\r |
959ccb23 | 234 | \r |
ab0eecec | 235 | #endif\r |