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