Path: blob/main/sys/contrib/edk2/Include/Uefi/UefiMultiPhase.h
48383 views
/** @file1This includes some definitions introduced in UEFI that will be used in both PEI and DXE phases.23Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>4SPDX-License-Identifier: BSD-2-Clause-Patent56**/78#ifndef __UEFI_MULTIPHASE_H__9#define __UEFI_MULTIPHASE_H__1011///12/// Attributes of variable.13///14#define EFI_VARIABLE_NON_VOLATILE 0x0000000115#define EFI_VARIABLE_BOOTSERVICE_ACCESS 0x0000000216#define EFI_VARIABLE_RUNTIME_ACCESS 0x0000000417///18/// This attribute is identified by the mnemonic 'HR'19/// elsewhere in this specification.20///21#define EFI_VARIABLE_HARDWARE_ERROR_RECORD 0x0000000822///23/// Attributes of Authenticated Variable24///25#define EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS 0x0000002026#define EFI_VARIABLE_APPEND_WRITE 0x0000004027///28/// NOTE: EFI_VARIABLE_AUTHENTICATED_WRITE_ACCESS is deprecated and should be considered reserved.29///30#define EFI_VARIABLE_AUTHENTICATED_WRITE_ACCESS 0x000000103132#ifndef VFRCOMPILE33#include <Guid/WinCertificate.h>34///35/// Enumeration of memory types introduced in UEFI.36///37typedef enum {38///39/// Not used.40///41EfiReservedMemoryType,42///43/// The code portions of a loaded application.44/// (Note that UEFI OS loaders are UEFI applications.)45///46EfiLoaderCode,47///48/// The data portions of a loaded application and the default data allocation49/// type used by an application to allocate pool memory.50///51EfiLoaderData,52///53/// The code portions of a loaded Boot Services Driver.54///55EfiBootServicesCode,56///57/// The data portions of a loaded Boot Serves Driver, and the default data58/// allocation type used by a Boot Services Driver to allocate pool memory.59///60EfiBootServicesData,61///62/// The code portions of a loaded Runtime Services Driver.63///64EfiRuntimeServicesCode,65///66/// The data portions of a loaded Runtime Services Driver and the default67/// data allocation type used by a Runtime Services Driver to allocate pool memory.68///69EfiRuntimeServicesData,70///71/// Free (unallocated) memory.72///73EfiConventionalMemory,74///75/// Memory in which errors have been detected.76///77EfiUnusableMemory,78///79/// Memory that holds the ACPI tables.80///81EfiACPIReclaimMemory,82///83/// Address space reserved for use by the firmware.84///85EfiACPIMemoryNVS,86///87/// Used by system firmware to request that a memory-mapped IO region88/// be mapped by the OS to a virtual address so it can be accessed by EFI runtime services.89///90EfiMemoryMappedIO,91///92/// System memory-mapped IO region that is used to translate memory93/// cycles to IO cycles by the processor.94///95EfiMemoryMappedIOPortSpace,96///97/// Address space reserved by the firmware for code that is part of the processor.98///99EfiPalCode,100///101/// A memory region that operates as EfiConventionalMemory,102/// however it happens to also support byte-addressable non-volatility.103///104EfiPersistentMemory,105///106/// A memory region that describes system memory that has not been accepted107/// by a corresponding call to the underlying isolation architecture.108///109EfiUnacceptedMemoryType,110EfiMaxMemoryType,111//112// +---------------------------------------------------+113// | 0..(EfiMaxMemoryType - 1) - Normal memory type |114// +---------------------------------------------------+115// | EfiMaxMemoryType..0x6FFFFFFF - Invalid |116// +---------------------------------------------------+117// | 0x70000000..0x7FFFFFFF - OEM reserved |118// +---------------------------------------------------+119// | 0x80000000..0xFFFFFFFF - OS reserved |120// +---------------------------------------------------+121//122MEMORY_TYPE_OEM_RESERVED_MIN = 0x70000000,123MEMORY_TYPE_OEM_RESERVED_MAX = 0x7FFFFFFF,124MEMORY_TYPE_OS_RESERVED_MIN = 0x80000000,125MEMORY_TYPE_OS_RESERVED_MAX = 0xFFFFFFFF126} EFI_MEMORY_TYPE;127128///129/// Enumeration of reset types.130///131typedef enum {132///133/// Used to induce a system-wide reset. This sets all circuitry within the134/// system to its initial state. This type of reset is asynchronous to system135/// operation and operates withgout regard to cycle boundaries. EfiColdReset136/// is tantamount to a system power cycle.137///138EfiResetCold,139///140/// Used to induce a system-wide initialization. The processors are set to their141/// initial state, and pending cycles are not corrupted. If the system does142/// not support this reset type, then an EfiResetCold must be performed.143///144EfiResetWarm,145///146/// Used to induce an entry into a power state equivalent to the ACPI G2/S5 or G3147/// state. If the system does not support this reset type, then when the system148/// is rebooted, it should exhibit the EfiResetCold attributes.149///150EfiResetShutdown,151///152/// Used to induce a system-wide reset. The exact type of the reset is defined by153/// the EFI_GUID that follows the Null-terminated Unicode string passed into154/// ResetData. If the platform does not recognize the EFI_GUID in ResetData the155/// platform must pick a supported reset type to perform. The platform may156/// optionally log the parameters from any non-normal reset that occurs.157///158EfiResetPlatformSpecific159} EFI_RESET_TYPE;160161///162/// Data structure that precedes all of the standard EFI table types.163///164typedef struct {165///166/// A 64-bit signature that identifies the type of table that follows.167/// Unique signatures have been generated for the EFI System Table,168/// the EFI Boot Services Table, and the EFI Runtime Services Table.169///170UINT64 Signature;171///172/// The revision of the EFI Specification to which this table173/// conforms. The upper 16 bits of this field contain the major174/// revision value, and the lower 16 bits contain the minor revision175/// value. The minor revision values are limited to the range of 00..99.176///177UINT32 Revision;178///179/// The size, in bytes, of the entire table including the EFI_TABLE_HEADER.180///181UINT32 HeaderSize;182///183/// The 32-bit CRC for the entire table. This value is computed by184/// setting this field to 0, and computing the 32-bit CRC for HeaderSize bytes.185///186UINT32 CRC32;187///188/// Reserved field that must be set to 0.189///190UINT32 Reserved;191} EFI_TABLE_HEADER;192193///194/// AuthInfo is a WIN_CERTIFICATE using the wCertificateType195/// WIN_CERTIFICATE_UEFI_GUID and the CertType196/// EFI_CERT_TYPE_RSA2048_SHA256_GUID. If the attribute specifies197/// authenticated access, then the Data buffer should begin with an198/// authentication descriptor prior to the data payload and DataSize199/// should reflect the the data.and descriptor size. The caller200/// shall digest the Monotonic Count value and the associated data201/// for the variable update using the SHA-256 1-way hash algorithm.202/// The ensuing the 32-byte digest will be signed using the private203/// key associated w/ the public/private 2048-bit RSA key-pair. The204/// WIN_CERTIFICATE shall be used to describe the signature of the205/// Variable data *Data. In addition, the signature will also206/// include the MonotonicCount value to guard against replay attacks.207///208typedef struct {209///210/// Included in the signature of211/// AuthInfo.Used to ensure freshness/no212/// replay. Incremented during each213/// "Write" access.214///215UINT64 MonotonicCount;216///217/// Provides the authorization for the variable218/// access. It is a signature across the219/// variable data and the Monotonic Count220/// value. Caller uses Private key that is221/// associated with a public key that has been222/// provisioned via the key exchange.223///224WIN_CERTIFICATE_UEFI_GUID AuthInfo;225} EFI_VARIABLE_AUTHENTICATION;226227///228/// When the attribute EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS is229/// set, then the Data buffer shall begin with an instance of a complete (and serialized)230/// EFI_VARIABLE_AUTHENTICATION_2 descriptor. The descriptor shall be followed by the new231/// variable value and DataSize shall reflect the combined size of the descriptor and the new232/// variable value. The authentication descriptor is not part of the variable data and is not233/// returned by subsequent calls to GetVariable().234///235typedef struct {236///237/// For the TimeStamp value, components Pad1, Nanosecond, TimeZone, Daylight and238/// Pad2 shall be set to 0. This means that the time shall always be expressed in GMT.239///240EFI_TIME TimeStamp;241///242/// Only a CertType of EFI_CERT_TYPE_PKCS7_GUID is accepted.243///244WIN_CERTIFICATE_UEFI_GUID AuthInfo;245} EFI_VARIABLE_AUTHENTICATION_2;246#endif // VFRCOMPILE247248#endif249250251