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