00001 /** @file00002 This includes some definitions introduced in UEFI that will be used in both PEI and DXE phases.00003 00004 Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.<BR>00005 This program and the accompanying materials are licensed and made available under00006 the terms and conditions of the BSD License that accompanies this distribution.00007 The full text of the license may be found at00008 http://opensource.org/licenses/bsd-license.php.00009 00010 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,00011 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.00012 00013 **/00014
00015 #ifndef __UEFI_MULTIPHASE_H__00016 #define __UEFI_MULTIPHASE_H__00017 00018 FILE_LICENCE ( BSD3 );
00019
00020 #include <ipxe/efi/Guid/WinCertificate.h>00021 ///00022 /// Enumeration of memory types introduced in UEFI.00023 ///00024typedefenum {00025 ///00026 /// Not used.00027 ///00028EfiReservedMemoryType,00029 ///00030 /// The code portions of a loaded application.00031 /// (Note that UEFI OS loaders are UEFI applications.)00032 ///00033EfiLoaderCode,00034 ///00035 /// The data portions of a loaded application and the default data allocation00036 /// type used by an application to allocate pool memory.00037 ///00038EfiLoaderData,00039 ///00040 /// The code portions of a loaded Boot Services Driver.00041 ///00042EfiBootServicesCode,00043 ///00044 /// The data portions of a loaded Boot Serves Driver, and the default data00045 /// allocation type used by a Boot Services Driver to allocate pool memory.00046 ///00047EfiBootServicesData,00048 ///00049 /// The code portions of a loaded Runtime Services Driver.00050 ///00051EfiRuntimeServicesCode,00052 ///00053 /// The data portions of a loaded Runtime Services Driver and the default00054 /// data allocation type used by a Runtime Services Driver to allocate pool memory.00055 ///00056EfiRuntimeServicesData,00057 ///00058 /// Free (unallocated) memory.00059 ///00060EfiConventionalMemory,00061 ///00062 /// Memory in which errors have been detected.00063 ///00064EfiUnusableMemory,00065 ///00066 /// Memory that holds the ACPI tables.00067 ///00068EfiACPIReclaimMemory,00069 ///00070 /// Address space reserved for use by the firmware.00071 ///00072EfiACPIMemoryNVS,00073 ///00074 /// Used by system firmware to request that a memory-mapped IO region00075 /// be mapped by the OS to a virtual address so it can be accessed by EFI runtime services.00076 ///00077EfiMemoryMappedIO,00078 ///00079 /// System memory-mapped IO region that is used to translate memory00080 /// cycles to IO cycles by the processor.00081 ///00082EfiMemoryMappedIOPortSpace,00083 ///00084 /// Address space reserved by the firmware for code that is part of the processor.00085 ///00086EfiPalCode,00087 ///00088 /// A memory region that operates as EfiConventionalMemory,00089 /// however it happens to also support byte-addressable non-volatility.00090 ///00091EfiPersistentMemory,
00092EfiMaxMemoryType00093 } EFI_MEMORY_TYPE;
00094 00095 ///00096 /// Enumeration of reset types.00097 ///00098typedefenum {00099 ///00100 /// Used to induce a system-wide reset. This sets all circuitry within the00101 /// system to its initial state. This type of reset is asynchronous to system00102 /// operation and operates withgout regard to cycle boundaries. EfiColdReset00103 /// is tantamount to a system power cycle.00104 ///00105EfiResetCold,00106 ///00107 /// Used to induce a system-wide initialization. The processors are set to their00108 /// initial state, and pending cycles are not corrupted. If the system does00109 /// not support this reset type, then an EfiResetCold must be performed.00110 ///00111EfiResetWarm,00112 ///00113 /// Used to induce an entry into a power state equivalent to the ACPI G2/S5 or G300114 /// state. If the system does not support this reset type, then when the system00115 /// is rebooted, it should exhibit the EfiResetCold attributes.00116 ///00117EfiResetShutdown,00118 ///00119 /// Used to induce a system-wide reset. The exact type of the reset is defined by00120 /// the EFI_GUID that follows the Null-terminated Unicode string passed into00121 /// ResetData. If the platform does not recognize the EFI_GUID in ResetData the00122 /// platform must pick a supported reset type to perform. The platform may00123 /// optionally log the parameters from any non-normal reset that occurs.00124 ///00125EfiResetPlatformSpecific00126 } EFI_RESET_TYPE;
00127 00128 ///00129 /// Data structure that precedes all of the standard EFI table types.00130 ///00131typedefstruct {00132 ///00133 /// A 64-bit signature that identifies the type of table that follows.00134 /// Unique signatures have been generated for the EFI System Table,00135 /// the EFI Boot Services Table, and the EFI Runtime Services Table.00136 ///00137UINT64Signature;00138 ///00139 /// The revision of the EFI Specification to which this table00140 /// conforms. The upper 16 bits of this field contain the major00141 /// revision value, and the lower 16 bits contain the minor revision00142 /// value. The minor revision values are limited to the range of 00..99.00143 ///00144UINT32Revision;00145 ///00146 /// The size, in bytes, of the entire table including the EFI_TABLE_HEADER.00147 ///00148UINT32HeaderSize;00149 ///00150 /// The 32-bit CRC for the entire table. This value is computed by00151 /// setting this field to 0, and computing the 32-bit CRC for HeaderSize bytes.00152 ///00153UINT32CRC32;00154 ///00155 /// Reserved field that must be set to 0.00156 ///00157UINT32Reserved;
00158 } EFI_TABLE_HEADER;
00159 00160 ///00161 /// Attributes of variable.00162 ///00163#define EFI_VARIABLE_NON_VOLATILE 0x0000000100164#define EFI_VARIABLE_BOOTSERVICE_ACCESS 0x0000000200165#define EFI_VARIABLE_RUNTIME_ACCESS 0x0000000400166 ///00167 /// This attribute is identified by the mnemonic 'HR'00168 /// elsewhere in this specification.00169 ///00170#define EFI_VARIABLE_HARDWARE_ERROR_RECORD 0x0000000800171 ///00172 /// Attributes of Authenticated Variable00173 ///00174#define EFI_VARIABLE_AUTHENTICATED_WRITE_ACCESS 0x0000001000175#define EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS 0x0000002000176#define EFI_VARIABLE_APPEND_WRITE 0x0000004000177 00178 00179 ///00180 /// AuthInfo is a WIN_CERTIFICATE using the wCertificateType00181 /// WIN_CERTIFICATE_UEFI_GUID and the CertType00182 /// EFI_CERT_TYPE_RSA2048_SHA256_GUID. If the attribute specifies00183 /// authenticated access, then the Data buffer should begin with an00184 /// authentication descriptor prior to the data payload and DataSize00185 /// should reflect the the data.and descriptor size. The caller00186 /// shall digest the Monotonic Count value and the associated data00187 /// for the variable update using the SHA-256 1-way hash algorithm.00188 /// The ensuing the 32-byte digest will be signed using the private00189 /// key associated w/ the public/private 2048-bit RSA key-pair. The00190 /// WIN_CERTIFICATE shall be used to describe the signature of the00191 /// Variable data *Data. In addition, the signature will also00192 /// include the MonotonicCount value to guard against replay attacks.00193 ///00194typedefstruct {00195 ///00196 /// Included in the signature of00197 /// AuthInfo.Used to ensure freshness/no00198 /// replay. Incremented during each00199 /// "Write" access.00200 ///00201UINT64MonotonicCount;00202 ///00203 /// Provides the authorization for the variable00204 /// access. It is a signature across the00205 /// variable data and the Monotonic Count00206 /// value. Caller uses Private key that is00207 /// associated with a public key that has been00208 /// provisioned via the key exchange.00209 ///00210WIN_CERTIFICATE_UEFI_GUIDAuthInfo;
00211 } EFI_VARIABLE_AUTHENTICATION;
00212 00213 ///00214 /// When the attribute EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS is00215 /// set, then the Data buffer shall begin with an instance of a complete (and serialized)00216 /// EFI_VARIABLE_AUTHENTICATION_2 descriptor. The descriptor shall be followed by the new00217 /// variable value and DataSize shall reflect the combined size of the descriptor and the new00218 /// variable value. The authentication descriptor is not part of the variable data and is not00219 /// returned by subsequent calls to GetVariable().00220 ///00221typedefstruct {00222 ///00223 /// For the TimeStamp value, components Pad1, Nanosecond, TimeZone, Daylight and00224 /// Pad2 shall be set to 0. This means that the time shall always be expressed in GMT.00225 ///00226EFI_TIMETimeStamp;00227 ///00228 /// Only a CertType of EFI_CERT_TYPE_PKCS7_GUID is accepted.00229 ///00230WIN_CERTIFICATE_UEFI_GUIDAuthInfo;
00231 } EFI_VARIABLE_AUTHENTICATION_2;
00232
00233 #endif