]> git.proxmox.com Git - mirror_edk2.git/blame_incremental - MdePkg/Include/Uefi/UefiMultiPhase.h
UefiCpuPkg: Move AsmRelocateApLoopStart from Mpfuncs.nasm to AmdSev.nasm
[mirror_edk2.git] / MdePkg / Include / Uefi / UefiMultiPhase.h
... / ...
CommitLineData
1/** @file\r
2 This includes some definitions introduced in UEFI that will be used in both PEI and DXE phases.\r
3\r
4Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>\r
5SPDX-License-Identifier: BSD-2-Clause-Patent\r
6\r
7**/\r
8\r
9#ifndef __UEFI_MULTIPHASE_H__\r
10#define __UEFI_MULTIPHASE_H__\r
11\r
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
34 #include <Guid/WinCertificate.h>\r
35///\r
36/// Enumeration of memory types introduced in UEFI.\r
37///\r
38typedef enum {\r
39 ///\r
40 /// Not used.\r
41 ///\r
42 EfiReservedMemoryType,\r
43 ///\r
44 /// The code portions of a loaded application.\r
45 /// (Note that UEFI OS loaders are UEFI applications.)\r
46 ///\r
47 EfiLoaderCode,\r
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
52 EfiLoaderData,\r
53 ///\r
54 /// The code portions of a loaded Boot Services Driver.\r
55 ///\r
56 EfiBootServicesCode,\r
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
61 EfiBootServicesData,\r
62 ///\r
63 /// The code portions of a loaded Runtime Services Driver.\r
64 ///\r
65 EfiRuntimeServicesCode,\r
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
70 EfiRuntimeServicesData,\r
71 ///\r
72 /// Free (unallocated) memory.\r
73 ///\r
74 EfiConventionalMemory,\r
75 ///\r
76 /// Memory in which errors have been detected.\r
77 ///\r
78 EfiUnusableMemory,\r
79 ///\r
80 /// Memory that holds the ACPI tables.\r
81 ///\r
82 EfiACPIReclaimMemory,\r
83 ///\r
84 /// Address space reserved for use by the firmware.\r
85 ///\r
86 EfiACPIMemoryNVS,\r
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
91 EfiMemoryMappedIO,\r
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
96 EfiMemoryMappedIOPortSpace,\r
97 ///\r
98 /// Address space reserved by the firmware for code that is part of the processor.\r
99 ///\r
100 EfiPalCode,\r
101 ///\r
102 /// A memory region that operates as EfiConventionalMemory,\r
103 /// however it happens to also support byte-addressable non-volatility.\r
104 ///\r
105 EfiPersistentMemory,\r
106 EfiMaxMemoryType\r
107} EFI_MEMORY_TYPE;\r
108\r
109///\r
110/// Enumeration of reset types.\r
111///\r
112typedef 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
142///\r
143/// Data structure that precedes all of the standard EFI table types.\r
144///\r
145typedef struct {\r
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
151 UINT64 Signature;\r
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
158 UINT32 Revision;\r
159 ///\r
160 /// The size, in bytes, of the entire table including the EFI_TABLE_HEADER.\r
161 ///\r
162 UINT32 HeaderSize;\r
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
167 UINT32 CRC32;\r
168 ///\r
169 /// Reserved field that must be set to 0.\r
170 ///\r
171 UINT32 Reserved;\r
172} EFI_TABLE_HEADER;\r
173\r
174///\r
175/// AuthInfo is a WIN_CERTIFICATE using the wCertificateType\r
176/// WIN_CERTIFICATE_UEFI_GUID and the CertType\r
177/// EFI_CERT_TYPE_RSA2048_SHA256_GUID. If the attribute specifies\r
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
187/// include the MonotonicCount value to guard against replay attacks.\r
188///\r
189typedef struct {\r
190 ///\r
191 /// Included in the signature of\r
192 /// AuthInfo.Used to ensure freshness/no\r
193 /// replay. Incremented during each\r
194 /// "Write" access.\r
195 ///\r
196 UINT64 MonotonicCount;\r
197 ///\r
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
204 ///\r
205 WIN_CERTIFICATE_UEFI_GUID AuthInfo;\r
206} EFI_VARIABLE_AUTHENTICATION;\r
207\r
208///\r
209/// When the attribute EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS is\r
210/// set, then the Data buffer shall begin with an instance of a complete (and serialized)\r
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
214/// returned by subsequent calls to GetVariable().\r
215///\r
216typedef struct {\r
217 ///\r
218 /// For the TimeStamp value, components Pad1, Nanosecond, TimeZone, Daylight and\r
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
222 ///\r
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
227#endif // VFRCOMPILE\r
228\r
229#endif\r