iPXE
UefiMultiPhase.h
Go to the documentation of this file.
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 SPDX-License-Identifier: BSD-2-Clause-Patent
6 
7 **/
8 
9 #ifndef __UEFI_MULTIPHASE_H__
10 #define __UEFI_MULTIPHASE_H__
11 
12 FILE_LICENCE ( BSD2_PATENT );
13 FILE_SECBOOT ( PERMITTED );
14 
15 ///
16 /// Attributes of variable.
17 ///
18 #define EFI_VARIABLE_NON_VOLATILE 0x00000001
19 #define EFI_VARIABLE_BOOTSERVICE_ACCESS 0x00000002
20 #define EFI_VARIABLE_RUNTIME_ACCESS 0x00000004
21 ///
22 /// This attribute is identified by the mnemonic 'HR'
23 /// elsewhere in this specification.
24 ///
25 #define EFI_VARIABLE_HARDWARE_ERROR_RECORD 0x00000008
26 ///
27 /// Attributes of Authenticated Variable
28 ///
29 #define EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS 0x00000020
30 #define EFI_VARIABLE_APPEND_WRITE 0x00000040
31 ///
32 /// NOTE: EFI_VARIABLE_AUTHENTICATED_WRITE_ACCESS is deprecated and should be considered reserved.
33 ///
34 #define EFI_VARIABLE_AUTHENTICATED_WRITE_ACCESS 0x00000010
35 
36 #ifndef VFRCOMPILE
38 ///
39 /// Enumeration of memory types introduced in UEFI.
40 ///
41 typedef enum {
42  ///
43  /// Not used.
44  ///
46  ///
47  /// The code portions of a loaded application.
48  /// (Note that UEFI OS loaders are UEFI applications.)
49  ///
51  ///
52  /// The data portions of a loaded application and the default data allocation
53  /// type used by an application to allocate pool memory.
54  ///
56  ///
57  /// The code portions of a loaded Boot Services Driver.
58  ///
60  ///
61  /// The data portions of a loaded Boot Serves Driver, and the default data
62  /// allocation type used by a Boot Services Driver to allocate pool memory.
63  ///
65  ///
66  /// The code portions of a loaded Runtime Services Driver.
67  ///
69  ///
70  /// The data portions of a loaded Runtime Services Driver and the default
71  /// data allocation type used by a Runtime Services Driver to allocate pool memory.
72  ///
74  ///
75  /// Free (unallocated) memory.
76  ///
78  ///
79  /// Memory in which errors have been detected.
80  ///
82  ///
83  /// Memory that holds the ACPI tables.
84  ///
86  ///
87  /// Address space reserved for use by the firmware.
88  ///
90  ///
91  /// Used by system firmware to request that a memory-mapped IO region
92  /// be mapped by the OS to a virtual address so it can be accessed by EFI runtime services.
93  ///
95  ///
96  /// System memory-mapped IO region that is used to translate memory
97  /// cycles to IO cycles by the processor.
98  ///
100  ///
101  /// Address space reserved by the firmware for code that is part of the processor.
102  ///
104  ///
105  /// A memory region that operates as EfiConventionalMemory,
106  /// however it happens to also support byte-addressable non-volatility.
107  ///
109  ///
110  /// A memory region that describes system memory that has not been accepted
111  /// by a corresponding call to the underlying isolation architecture.
112  ///
115  //
116  // +---------------------------------------------------+
117  // | 0..(EfiMaxMemoryType - 1) - Normal memory type |
118  // +---------------------------------------------------+
119  // | EfiMaxMemoryType..0x6FFFFFFF - Invalid |
120  // +---------------------------------------------------+
121  // | 0x70000000..0x7FFFFFFF - OEM reserved |
122  // +---------------------------------------------------+
123  // | 0x80000000..0xFFFFFFFF - OS reserved |
124  // +---------------------------------------------------+
125  //
131 
132 ///
133 /// Enumeration of reset types.
134 ///
135 typedef enum {
136  ///
137  /// Used to induce a system-wide reset. This sets all circuitry within the
138  /// system to its initial state. This type of reset is asynchronous to system
139  /// operation and operates withgout regard to cycle boundaries. EfiColdReset
140  /// is tantamount to a system power cycle.
141  ///
143  ///
144  /// Used to induce a system-wide initialization. The processors are set to their
145  /// initial state, and pending cycles are not corrupted. If the system does
146  /// not support this reset type, then an EfiResetCold must be performed.
147  ///
149  ///
150  /// Used to induce an entry into a power state equivalent to the ACPI G2/S5 or G3
151  /// state. If the system does not support this reset type, then when the system
152  /// is rebooted, it should exhibit the EfiResetCold attributes.
153  ///
155  ///
156  /// Used to induce a system-wide reset. The exact type of the reset is defined by
157  /// the EFI_GUID that follows the Null-terminated Unicode string passed into
158  /// ResetData. If the platform does not recognize the EFI_GUID in ResetData the
159  /// platform must pick a supported reset type to perform. The platform may
160  /// optionally log the parameters from any non-normal reset that occurs.
161  ///
164 
165 ///
166 /// Data structure that precedes all of the standard EFI table types.
167 ///
168 typedef struct {
169  ///
170  /// A 64-bit signature that identifies the type of table that follows.
171  /// Unique signatures have been generated for the EFI System Table,
172  /// the EFI Boot Services Table, and the EFI Runtime Services Table.
173  ///
175  ///
176  /// The revision of the EFI Specification to which this table
177  /// conforms. The upper 16 bits of this field contain the major
178  /// revision value, and the lower 16 bits contain the minor revision
179  /// value. The minor revision values are limited to the range of 00..99.
180  ///
182  ///
183  /// The size, in bytes, of the entire table including the EFI_TABLE_HEADER.
184  ///
186  ///
187  /// The 32-bit CRC for the entire table. This value is computed by
188  /// setting this field to 0, and computing the 32-bit CRC for HeaderSize bytes.
189  ///
191  ///
192  /// Reserved field that must be set to 0.
193  ///
196 
197 ///
198 /// AuthInfo is a WIN_CERTIFICATE using the wCertificateType
199 /// WIN_CERTIFICATE_UEFI_GUID and the CertType
200 /// EFI_CERT_TYPE_RSA2048_SHA256_GUID. If the attribute specifies
201 /// authenticated access, then the Data buffer should begin with an
202 /// authentication descriptor prior to the data payload and DataSize
203 /// should reflect the the data.and descriptor size. The caller
204 /// shall digest the Monotonic Count value and the associated data
205 /// for the variable update using the SHA-256 1-way hash algorithm.
206 /// The ensuing the 32-byte digest will be signed using the private
207 /// key associated w/ the public/private 2048-bit RSA key-pair. The
208 /// WIN_CERTIFICATE shall be used to describe the signature of the
209 /// Variable data *Data. In addition, the signature will also
210 /// include the MonotonicCount value to guard against replay attacks.
211 ///
212 typedef struct {
213  ///
214  /// Included in the signature of
215  /// AuthInfo.Used to ensure freshness/no
216  /// replay. Incremented during each
217  /// "Write" access.
218  ///
220  ///
221  /// Provides the authorization for the variable
222  /// access. It is a signature across the
223  /// variable data and the Monotonic Count
224  /// value. Caller uses Private key that is
225  /// associated with a public key that has been
226  /// provisioned via the key exchange.
227  ///
230 
231 ///
232 /// When the attribute EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS is
233 /// set, then the Data buffer shall begin with an instance of a complete (and serialized)
234 /// EFI_VARIABLE_AUTHENTICATION_2 descriptor. The descriptor shall be followed by the new
235 /// variable value and DataSize shall reflect the combined size of the descriptor and the new
236 /// variable value. The authentication descriptor is not part of the variable data and is not
237 /// returned by subsequent calls to GetVariable().
238 ///
239 typedef struct {
240  ///
241  /// For the TimeStamp value, components Pad1, Nanosecond, TimeZone, Daylight and
242  /// Pad2 shall be set to 0. This means that the time shall always be expressed in GMT.
243  ///
245  ///
246  /// Only a CertType of EFI_CERT_TYPE_PKCS7_GUID is accepted.
247  ///
250 #endif // VFRCOMPILE
251 
252 #endif
UINT32 Reserved
Reserved field that must be set to 0.
EFI_RESET_TYPE
Enumeration of reset types.
UINT64 MonotonicCount
Included in the signature of AuthInfo.Used to ensure freshness/no replay.
A memory region that operates as EfiConventionalMemory, however it happens to also support byte-addre...
unsigned int UINT32
Definition: ProcessorBind.h:99
Certificate which encapsulates a GUID-specific digital signature.
UINT64 Signature
A 64-bit signature that identifies the type of table that follows.
WIN_CERTIFICATE_UEFI_GUID AuthInfo
Provides the authorization for the variable access.
A memory region that describes system memory that has not been accepted by a corresponding call to th...
Used to induce a system-wide reset.
UINT32 CRC32
The 32-bit CRC for the entire table.
The code portions of a loaded application.
WIN_CERTIFICATE_UEFI_GUID AuthInfo
Only a CertType of EFI_CERT_TYPE_PKCS7_GUID is accepted.
Used to induce a system-wide reset.
Used to induce a system-wide initialization.
EFI_MEMORY_TYPE
Enumeration of memory types introduced in UEFI.
Address space reserved by the firmware for code that is part of the processor.
Used by system firmware to request that a memory-mapped IO region be mapped by the OS to a virtual ad...
Memory that holds the ACPI tables.
EFI_TIME TimeStamp
For the TimeStamp value, components Pad1, Nanosecond, TimeZone, Daylight and Pad2 shall be set to 0.
FILE_SECBOOT(PERMITTED)
The code portions of a loaded Boot Services Driver.
Free (unallocated) memory.
Used to induce an entry into a power state equivalent to the ACPI G2/S5 or G3 state.
UINT32 Revision
The revision of the EFI Specification to which this table conforms.
unsigned long long UINT64
Definition: ProcessorBind.h:97
System memory-mapped IO region that is used to translate memory cycles to IO cycles by the processor.
EFI Time Abstraction: Year: 1900 - 9999 Month: 1 - 12 Day: 1 - 31 Hour: 0 - 23 Minute: 0 - 59 Second:...
Definition: UefiBaseType.h:71
FILE_LICENCE(BSD2_PATENT)
The data portions of a loaded Runtime Services Driver and the default data allocation type used by a ...
GUID for UEFI WIN_CERTIFICATE structure.
The code portions of a loaded Runtime Services Driver.
When the attribute EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS is set, then the Data buffer sh...
Data structure that precedes all of the standard EFI table types.
Address space reserved for use by the firmware.
The data portions of a loaded Boot Serves Driver, and the default data allocation type used by a Boot...
AuthInfo is a WIN_CERTIFICATE using the wCertificateType WIN_CERTIFICATE_UEFI_GUID and the CertType E...
UINT32 HeaderSize
The size, in bytes, of the entire table including the EFI_TABLE_HEADER.
The data portions of a loaded application and the default data allocation type used by an application...
Memory in which errors have been detected.