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