]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Include/Uefi/UefiMultiPhase.h
UefiCpuPkg: Move AsmRelocateApLoopStart from Mpfuncs.nasm to AmdSev.nasm
[mirror_edk2.git] / MdePkg / Include / Uefi / UefiMultiPhase.h
CommitLineData
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 4Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>\r
9344f092 5SPDX-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
2f88bd3a
MK
15#define EFI_VARIABLE_NON_VOLATILE 0x00000001\r
16#define EFI_VARIABLE_BOOTSERVICE_ACCESS 0x00000002\r
17#define EFI_VARIABLE_RUNTIME_ACCESS 0x00000004\r
8bbb56b4
LL
18///\r
19/// This attribute is identified by the mnemonic 'HR'\r
20/// elsewhere in this specification.\r
21///\r
2f88bd3a 22#define EFI_VARIABLE_HARDWARE_ERROR_RECORD 0x00000008\r
8bbb56b4
LL
23///\r
24/// Attributes of Authenticated Variable\r
25///\r
2f88bd3a
MK
26#define EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS 0x00000020\r
27#define EFI_VARIABLE_APPEND_WRITE 0x00000040\r
8bbb56b4
LL
28///\r
29/// NOTE: EFI_VARIABLE_AUTHENTICATED_WRITE_ACCESS is deprecated and should be considered reserved.\r
30///\r
2f88bd3a 31#define EFI_VARIABLE_AUTHENTICATED_WRITE_ACCESS 0x00000010\r
8bbb56b4
LL
32\r
33#ifndef VFRCOMPILE\r
2f88bd3a 34 #include <Guid/WinCertificate.h>\r
8b13229b 35///\r
36/// Enumeration of memory types introduced in UEFI.\r
fbb393ab 37///\r
959ccb23 38typedef 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
502c01c5
MX
106 ///\r
107 /// A memory region that describes system memory that has not been accepted\r
108 /// by a corresponding call to the underlying isolation architecture.\r
109 ///\r
110 EfiUnacceptedMemoryType,\r
00edb218 111 EfiMaxMemoryType\r
959ccb23 112} EFI_MEMORY_TYPE;\r
113\r
ddcf46b2
SZ
114///\r
115/// Enumeration of reset types.\r
116///\r
117typedef enum {\r
118 ///\r
119 /// Used to induce a system-wide reset. This sets all circuitry within the\r
120 /// system to its initial state. This type of reset is asynchronous to system\r
121 /// operation and operates withgout regard to cycle boundaries. EfiColdReset\r
122 /// is tantamount to a system power cycle.\r
123 ///\r
124 EfiResetCold,\r
125 ///\r
126 /// Used to induce a system-wide initialization. The processors are set to their\r
127 /// initial state, and pending cycles are not corrupted. If the system does\r
128 /// not support this reset type, then an EfiResetCold must be performed.\r
129 ///\r
130 EfiResetWarm,\r
131 ///\r
132 /// Used to induce an entry into a power state equivalent to the ACPI G2/S5 or G3\r
133 /// state. If the system does not support this reset type, then when the system\r
134 /// is rebooted, it should exhibit the EfiResetCold attributes.\r
135 ///\r
136 EfiResetShutdown,\r
137 ///\r
138 /// Used to induce a system-wide reset. The exact type of the reset is defined by\r
139 /// the EFI_GUID that follows the Null-terminated Unicode string passed into\r
140 /// ResetData. If the platform does not recognize the EFI_GUID in ResetData the\r
141 /// platform must pick a supported reset type to perform. The platform may\r
142 /// optionally log the parameters from any non-normal reset that occurs.\r
143 ///\r
144 EfiResetPlatformSpecific\r
145} EFI_RESET_TYPE;\r
146\r
8b13229b 147///\r
148/// Data structure that precedes all of the standard EFI table types.\r
fbb393ab 149///\r
959ccb23 150typedef struct {\r
1bf79370
LG
151 ///\r
152 /// A 64-bit signature that identifies the type of table that follows.\r
153 /// Unique signatures have been generated for the EFI System Table,\r
154 /// the EFI Boot Services Table, and the EFI Runtime Services Table.\r
155 ///\r
2f88bd3a 156 UINT64 Signature;\r
1bf79370
LG
157 ///\r
158 /// The revision of the EFI Specification to which this table\r
159 /// conforms. The upper 16 bits of this field contain the major\r
160 /// revision value, and the lower 16 bits contain the minor revision\r
161 /// value. The minor revision values are limited to the range of 00..99.\r
162 ///\r
2f88bd3a 163 UINT32 Revision;\r
1bf79370
LG
164 ///\r
165 /// The size, in bytes, of the entire table including the EFI_TABLE_HEADER.\r
166 ///\r
2f88bd3a 167 UINT32 HeaderSize;\r
1bf79370
LG
168 ///\r
169 /// The 32-bit CRC for the entire table. This value is computed by\r
170 /// setting this field to 0, and computing the 32-bit CRC for HeaderSize bytes.\r
171 ///\r
2f88bd3a 172 UINT32 CRC32;\r
1bf79370
LG
173 ///\r
174 /// Reserved field that must be set to 0.\r
175 ///\r
2f88bd3a 176 UINT32 Reserved;\r
959ccb23 177} EFI_TABLE_HEADER;\r
178\r
fbb393ab 179///\r
3ed785e9 180/// AuthInfo is a WIN_CERTIFICATE using the wCertificateType\r
181/// WIN_CERTIFICATE_UEFI_GUID and the CertType\r
85560919 182/// EFI_CERT_TYPE_RSA2048_SHA256_GUID. If the attribute specifies\r
3ed785e9 183/// authenticated access, then the Data buffer should begin with an\r
184/// authentication descriptor prior to the data payload and DataSize\r
185/// should reflect the the data.and descriptor size. The caller\r
186/// shall digest the Monotonic Count value and the associated data\r
187/// for the variable update using the SHA-256 1-way hash algorithm.\r
188/// The ensuing the 32-byte digest will be signed using the private\r
189/// key associated w/ the public/private 2048-bit RSA key-pair. The\r
190/// WIN_CERTIFICATE shall be used to describe the signature of the\r
191/// Variable data *Data. In addition, the signature will also\r
af2dc6a7 192/// include the MonotonicCount value to guard against replay attacks.\r
fbb393ab 193///\r
959ccb23 194typedef struct {\r
3ed785e9 195 ///\r
fbb393ab 196 /// Included in the signature of\r
3ed785e9 197 /// AuthInfo.Used to ensure freshness/no\r
fbb393ab
LL
198 /// replay. Incremented during each\r
199 /// "Write" access.\r
200 ///\r
2f88bd3a 201 UINT64 MonotonicCount;\r
3ed785e9 202 ///\r
fbb393ab
LL
203 /// Provides the authorization for the variable\r
204 /// access. It is a signature across the\r
205 /// variable data and the Monotonic Count\r
206 /// value. Caller uses Private key that is\r
207 /// associated with a public key that has been\r
208 /// provisioned via the key exchange.\r
3ed785e9 209 ///\r
2f88bd3a 210 WIN_CERTIFICATE_UEFI_GUID AuthInfo;\r
959ccb23 211} EFI_VARIABLE_AUTHENTICATION;\r
212\r
ab0eecec 213///\r
fbb393ab 214/// When the attribute EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS is\r
ab0eecec 215/// set, then the Data buffer shall begin with an instance of a complete (and serialized)\r
fbb393ab
LL
216/// EFI_VARIABLE_AUTHENTICATION_2 descriptor. The descriptor shall be followed by the new\r
217/// variable value and DataSize shall reflect the combined size of the descriptor and the new\r
218/// variable value. The authentication descriptor is not part of the variable data and is not\r
ab0eecec 219/// returned by subsequent calls to GetVariable().\r
220///\r
221typedef struct {\r
222 ///\r
fbb393ab 223 /// For the TimeStamp value, components Pad1, Nanosecond, TimeZone, Daylight and\r
ab0eecec 224 /// Pad2 shall be set to 0. This means that the time shall always be expressed in GMT.\r
225 ///\r
2f88bd3a 226 EFI_TIME TimeStamp;\r
fbb393ab 227 ///\r
ab0eecec 228 /// Only a CertType of EFI_CERT_TYPE_PKCS7_GUID is accepted.\r
229 ///\r
2f88bd3a
MK
230 WIN_CERTIFICATE_UEFI_GUID AuthInfo;\r
231} EFI_VARIABLE_AUTHENTICATION_2;\r
8bbb56b4 232#endif // VFRCOMPILE\r
959ccb23 233\r
ab0eecec 234#endif\r