2 This includes some definitions introduced in UEFI that will be used in both PEI and DXE phases.
4 Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
5 SPDX-License-Identifier: BSD-2-Clause-Patent
9 #ifndef __UEFI_MULTIPHASE_H__
10 #define __UEFI_MULTIPHASE_H__
13 /// Attributes of variable.
15 #define EFI_VARIABLE_NON_VOLATILE 0x00000001
16 #define EFI_VARIABLE_BOOTSERVICE_ACCESS 0x00000002
17 #define EFI_VARIABLE_RUNTIME_ACCESS 0x00000004
19 /// This attribute is identified by the mnemonic 'HR'
20 /// elsewhere in this specification.
22 #define EFI_VARIABLE_HARDWARE_ERROR_RECORD 0x00000008
24 /// Attributes of Authenticated Variable
26 #define EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS 0x00000020
27 #define EFI_VARIABLE_APPEND_WRITE 0x00000040
29 /// NOTE: EFI_VARIABLE_AUTHENTICATED_WRITE_ACCESS is deprecated and should be considered reserved.
31 #define EFI_VARIABLE_AUTHENTICATED_WRITE_ACCESS 0x00000010
34 #include <Guid/WinCertificate.h>
36 /// Enumeration of memory types introduced in UEFI.
42 EfiReservedMemoryType
,
44 /// The code portions of a loaded application.
45 /// (Note that UEFI OS loaders are UEFI applications.)
49 /// The data portions of a loaded application and the default data allocation
50 /// type used by an application to allocate pool memory.
54 /// The code portions of a loaded Boot Services Driver.
58 /// The data portions of a loaded Boot Serves Driver, and the default data
59 /// allocation type used by a Boot Services Driver to allocate pool memory.
63 /// The code portions of a loaded Runtime Services Driver.
65 EfiRuntimeServicesCode
,
67 /// The data portions of a loaded Runtime Services Driver and the default
68 /// data allocation type used by a Runtime Services Driver to allocate pool memory.
70 EfiRuntimeServicesData
,
72 /// Free (unallocated) memory.
74 EfiConventionalMemory
,
76 /// Memory in which errors have been detected.
80 /// Memory that holds the ACPI tables.
84 /// Address space reserved for use by the firmware.
88 /// Used by system firmware to request that a memory-mapped IO region
89 /// be mapped by the OS to a virtual address so it can be accessed by EFI runtime services.
93 /// System memory-mapped IO region that is used to translate memory
94 /// cycles to IO cycles by the processor.
96 EfiMemoryMappedIOPortSpace
,
98 /// Address space reserved by the firmware for code that is part of the processor.
102 /// A memory region that operates as EfiConventionalMemory,
103 /// however it happens to also support byte-addressable non-volatility.
110 /// Enumeration of reset types.
114 /// Used to induce a system-wide reset. This sets all circuitry within the
115 /// system to its initial state. This type of reset is asynchronous to system
116 /// operation and operates withgout regard to cycle boundaries. EfiColdReset
117 /// is tantamount to a system power cycle.
121 /// Used to induce a system-wide initialization. The processors are set to their
122 /// initial state, and pending cycles are not corrupted. If the system does
123 /// not support this reset type, then an EfiResetCold must be performed.
127 /// Used to induce an entry into a power state equivalent to the ACPI G2/S5 or G3
128 /// state. If the system does not support this reset type, then when the system
129 /// is rebooted, it should exhibit the EfiResetCold attributes.
133 /// Used to induce a system-wide reset. The exact type of the reset is defined by
134 /// the EFI_GUID that follows the Null-terminated Unicode string passed into
135 /// ResetData. If the platform does not recognize the EFI_GUID in ResetData the
136 /// platform must pick a supported reset type to perform. The platform may
137 /// optionally log the parameters from any non-normal reset that occurs.
139 EfiResetPlatformSpecific
143 /// Data structure that precedes all of the standard EFI table types.
147 /// A 64-bit signature that identifies the type of table that follows.
148 /// Unique signatures have been generated for the EFI System Table,
149 /// the EFI Boot Services Table, and the EFI Runtime Services Table.
153 /// The revision of the EFI Specification to which this table
154 /// conforms. The upper 16 bits of this field contain the major
155 /// revision value, and the lower 16 bits contain the minor revision
156 /// value. The minor revision values are limited to the range of 00..99.
160 /// The size, in bytes, of the entire table including the EFI_TABLE_HEADER.
164 /// The 32-bit CRC for the entire table. This value is computed by
165 /// setting this field to 0, and computing the 32-bit CRC for HeaderSize bytes.
169 /// Reserved field that must be set to 0.
175 /// AuthInfo is a WIN_CERTIFICATE using the wCertificateType
176 /// WIN_CERTIFICATE_UEFI_GUID and the CertType
177 /// EFI_CERT_TYPE_RSA2048_SHA256_GUID. If the attribute specifies
178 /// authenticated access, then the Data buffer should begin with an
179 /// authentication descriptor prior to the data payload and DataSize
180 /// should reflect the the data.and descriptor size. The caller
181 /// shall digest the Monotonic Count value and the associated data
182 /// for the variable update using the SHA-256 1-way hash algorithm.
183 /// The ensuing the 32-byte digest will be signed using the private
184 /// key associated w/ the public/private 2048-bit RSA key-pair. The
185 /// WIN_CERTIFICATE shall be used to describe the signature of the
186 /// Variable data *Data. In addition, the signature will also
187 /// include the MonotonicCount value to guard against replay attacks.
191 /// Included in the signature of
192 /// AuthInfo.Used to ensure freshness/no
193 /// replay. Incremented during each
196 UINT64 MonotonicCount
;
198 /// Provides the authorization for the variable
199 /// access. It is a signature across the
200 /// variable data and the Monotonic Count
201 /// value. Caller uses Private key that is
202 /// associated with a public key that has been
203 /// provisioned via the key exchange.
205 WIN_CERTIFICATE_UEFI_GUID AuthInfo
;
206 } EFI_VARIABLE_AUTHENTICATION
;
209 /// When the attribute EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS is
210 /// set, then the Data buffer shall begin with an instance of a complete (and serialized)
211 /// EFI_VARIABLE_AUTHENTICATION_2 descriptor. The descriptor shall be followed by the new
212 /// variable value and DataSize shall reflect the combined size of the descriptor and the new
213 /// variable value. The authentication descriptor is not part of the variable data and is not
214 /// returned by subsequent calls to GetVariable().
218 /// For the TimeStamp value, components Pad1, Nanosecond, TimeZone, Daylight and
219 /// Pad2 shall be set to 0. This means that the time shall always be expressed in GMT.
223 /// Only a CertType of EFI_CERT_TYPE_PKCS7_GUID is accepted.
225 WIN_CERTIFICATE_UEFI_GUID AuthInfo
;
226 } EFI_VARIABLE_AUTHENTICATION_2
;