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