2 This includes some definitions introduced in UEFI that will be used in both PEI and DXE phases.
4 Copyright (c) 2006 - 2017, 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.
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.
15 #ifndef __UEFI_MULTIPHASE_H__
16 #define __UEFI_MULTIPHASE_H__
19 /// Attributes of variable.
21 #define EFI_VARIABLE_NON_VOLATILE 0x00000001
22 #define EFI_VARIABLE_BOOTSERVICE_ACCESS 0x00000002
23 #define EFI_VARIABLE_RUNTIME_ACCESS 0x00000004
25 /// This attribute is identified by the mnemonic 'HR'
26 /// elsewhere in this specification.
28 #define EFI_VARIABLE_HARDWARE_ERROR_RECORD 0x00000008
30 /// Attributes of Authenticated Variable
32 #define EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS 0x00000020
33 #define EFI_VARIABLE_APPEND_WRITE 0x00000040
35 /// NOTE: EFI_VARIABLE_AUTHENTICATED_WRITE_ACCESS is deprecated and should be considered reserved.
37 #define EFI_VARIABLE_AUTHENTICATED_WRITE_ACCESS 0x00000010
40 #include <Guid/WinCertificate.h>
42 /// Enumeration of memory types introduced in UEFI.
48 EfiReservedMemoryType
,
50 /// The code portions of a loaded application.
51 /// (Note that UEFI OS loaders are UEFI applications.)
55 /// The data portions of a loaded application and the default data allocation
56 /// type used by an application to allocate pool memory.
60 /// The code portions of a loaded Boot Services Driver.
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.
69 /// The code portions of a loaded Runtime Services Driver.
71 EfiRuntimeServicesCode
,
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.
76 EfiRuntimeServicesData
,
78 /// Free (unallocated) memory.
80 EfiConventionalMemory
,
82 /// Memory in which errors have been detected.
86 /// Memory that holds the ACPI tables.
90 /// Address space reserved for use by the firmware.
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.
99 /// System memory-mapped IO region that is used to translate memory
100 /// cycles to IO cycles by the processor.
102 EfiMemoryMappedIOPortSpace
,
104 /// Address space reserved by the firmware for code that is part of the processor.
108 /// A memory region that operates as EfiConventionalMemory,
109 /// however it happens to also support byte-addressable non-volatility.
116 /// Enumeration of reset types.
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.
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.
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.
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.
145 EfiResetPlatformSpecific
149 /// Data structure that precedes all of the standard EFI table types.
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.
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.
166 /// The size, in bytes, of the entire table including the EFI_TABLE_HEADER.
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.
175 /// Reserved field that must be set to 0.
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.
197 /// Included in the signature of
198 /// AuthInfo.Used to ensure freshness/no
199 /// replay. Incremented during each
202 UINT64 MonotonicCount
;
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.
211 WIN_CERTIFICATE_UEFI_GUID AuthInfo
;
212 } EFI_VARIABLE_AUTHENTICATION
;
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().
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.
229 /// Only a CertType of EFI_CERT_TYPE_PKCS7_GUID is accepted.
231 WIN_CERTIFICATE_UEFI_GUID AuthInfo
;
232 } EFI_VARIABLE_AUTHENTICATION_2
;