2007-06-08 13:31:52 +02:00
|
|
|
/** @file
|
2007-06-18 22:28:02 +02:00
|
|
|
This includes some definitions introduced in UEFI that will be used in both PEI and DXE phases.
|
2007-06-08 13:31:52 +02:00
|
|
|
|
2015-04-29 03:36:16 +02:00
|
|
|
Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.<BR>
|
2014-10-22 05:03:18 +02:00
|
|
|
This program and the accompanying materials are licensed and made available under
|
|
|
|
the terms and conditions of the BSD License that accompanies this distribution.
|
2010-03-12 23:19:12 +01:00
|
|
|
The full text of the license may be found at
|
2014-10-22 05:03:18 +02:00
|
|
|
http://opensource.org/licenses/bsd-license.php.
|
|
|
|
|
|
|
|
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
|
|
|
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
2007-06-08 13:31:52 +02:00
|
|
|
|
|
|
|
**/
|
|
|
|
|
|
|
|
#ifndef __UEFI_MULTIPHASE_H__
|
|
|
|
#define __UEFI_MULTIPHASE_H__
|
|
|
|
|
2009-09-02 11:23:28 +02:00
|
|
|
#include <Guid/WinCertificate.h>
|
2008-06-24 09:14:18 +02:00
|
|
|
///
|
|
|
|
/// Enumeration of memory types introduced in UEFI.
|
2014-10-22 05:03:18 +02:00
|
|
|
///
|
2007-06-08 13:31:52 +02:00
|
|
|
typedef enum {
|
2008-12-10 09:22:03 +01:00
|
|
|
///
|
|
|
|
/// Not used.
|
|
|
|
///
|
2007-06-18 22:28:02 +02:00
|
|
|
EfiReservedMemoryType,
|
2008-12-10 09:22:03 +01:00
|
|
|
///
|
2014-10-22 05:03:18 +02:00
|
|
|
/// The code portions of a loaded application.
|
2008-12-10 09:22:03 +01:00
|
|
|
/// (Note that UEFI OS loaders are UEFI applications.)
|
|
|
|
///
|
2007-06-18 22:28:02 +02:00
|
|
|
EfiLoaderCode,
|
2008-12-10 09:22:03 +01:00
|
|
|
///
|
|
|
|
/// The data portions of a loaded application and the default data allocation
|
|
|
|
/// type used by an application to allocate pool memory.
|
|
|
|
///
|
2007-06-18 22:28:02 +02:00
|
|
|
EfiLoaderData,
|
2008-12-10 09:22:03 +01:00
|
|
|
///
|
2010-03-12 23:19:12 +01:00
|
|
|
/// The code portions of a loaded Boot Services Driver.
|
2008-12-10 09:22:03 +01:00
|
|
|
///
|
2007-06-18 22:28:02 +02:00
|
|
|
EfiBootServicesCode,
|
2008-12-10 09:22:03 +01:00
|
|
|
///
|
|
|
|
/// The data portions of a loaded Boot Serves Driver, and the default data
|
|
|
|
/// allocation type used by a Boot Services Driver to allocate pool memory.
|
|
|
|
///
|
2007-06-18 22:28:02 +02:00
|
|
|
EfiBootServicesData,
|
2008-12-10 09:22:03 +01:00
|
|
|
///
|
|
|
|
/// The code portions of a loaded Runtime Services Driver.
|
|
|
|
///
|
2007-06-18 22:28:02 +02:00
|
|
|
EfiRuntimeServicesCode,
|
2008-12-10 09:22:03 +01:00
|
|
|
///
|
|
|
|
/// The data portions of a loaded Runtime Services Driver and the default
|
|
|
|
/// data allocation type used by a Runtime Services Driver to allocate pool memory.
|
|
|
|
///
|
2007-06-18 22:28:02 +02:00
|
|
|
EfiRuntimeServicesData,
|
2008-12-10 09:22:03 +01:00
|
|
|
///
|
|
|
|
/// Free (unallocated) memory.
|
|
|
|
///
|
2007-06-18 22:28:02 +02:00
|
|
|
EfiConventionalMemory,
|
2008-12-10 09:22:03 +01:00
|
|
|
///
|
|
|
|
/// Memory in which errors have been detected.
|
|
|
|
///
|
2007-06-18 22:28:02 +02:00
|
|
|
EfiUnusableMemory,
|
2008-12-10 09:22:03 +01:00
|
|
|
///
|
|
|
|
/// Memory that holds the ACPI tables.
|
|
|
|
///
|
2007-06-18 22:28:02 +02:00
|
|
|
EfiACPIReclaimMemory,
|
2008-12-10 09:22:03 +01:00
|
|
|
///
|
|
|
|
/// Address space reserved for use by the firmware.
|
|
|
|
///
|
2007-06-18 22:28:02 +02:00
|
|
|
EfiACPIMemoryNVS,
|
2008-12-10 09:22:03 +01:00
|
|
|
///
|
|
|
|
/// Used by system firmware to request that a memory-mapped IO region
|
|
|
|
/// be mapped by the OS to a virtual address so it can be accessed by EFI runtime services.
|
|
|
|
///
|
2007-06-18 22:28:02 +02:00
|
|
|
EfiMemoryMappedIO,
|
2008-12-10 09:22:03 +01:00
|
|
|
///
|
|
|
|
/// System memory-mapped IO region that is used to translate memory
|
|
|
|
/// cycles to IO cycles by the processor.
|
|
|
|
///
|
2007-06-18 22:28:02 +02:00
|
|
|
EfiMemoryMappedIOPortSpace,
|
2008-12-10 09:22:03 +01:00
|
|
|
///
|
|
|
|
/// Address space reserved by the firmware for code that is part of the processor.
|
|
|
|
///
|
2007-06-18 22:28:02 +02:00
|
|
|
EfiPalCode,
|
2015-04-29 03:36:16 +02:00
|
|
|
///
|
|
|
|
/// A memory region that operates as EfiConventionalMemory,
|
|
|
|
/// however it happens to also support byte-addressable non-volatility.
|
|
|
|
///
|
|
|
|
EfiPersistentMemory,
|
2007-06-18 22:28:02 +02:00
|
|
|
EfiMaxMemoryType
|
2007-06-08 13:31:52 +02:00
|
|
|
} EFI_MEMORY_TYPE;
|
|
|
|
|
2015-05-11 04:05:52 +02:00
|
|
|
///
|
|
|
|
/// Enumeration of reset types.
|
|
|
|
///
|
|
|
|
typedef enum {
|
|
|
|
///
|
|
|
|
/// Used to induce a system-wide reset. This sets all circuitry within the
|
|
|
|
/// system to its initial state. This type of reset is asynchronous to system
|
|
|
|
/// operation and operates withgout regard to cycle boundaries. EfiColdReset
|
|
|
|
/// is tantamount to a system power cycle.
|
|
|
|
///
|
|
|
|
EfiResetCold,
|
|
|
|
///
|
|
|
|
/// Used to induce a system-wide initialization. The processors are set to their
|
|
|
|
/// initial state, and pending cycles are not corrupted. If the system does
|
|
|
|
/// not support this reset type, then an EfiResetCold must be performed.
|
|
|
|
///
|
|
|
|
EfiResetWarm,
|
|
|
|
///
|
|
|
|
/// Used to induce an entry into a power state equivalent to the ACPI G2/S5 or G3
|
|
|
|
/// state. If the system does not support this reset type, then when the system
|
|
|
|
/// is rebooted, it should exhibit the EfiResetCold attributes.
|
|
|
|
///
|
|
|
|
EfiResetShutdown,
|
|
|
|
///
|
|
|
|
/// Used to induce a system-wide reset. The exact type of the reset is defined by
|
|
|
|
/// the EFI_GUID that follows the Null-terminated Unicode string passed into
|
|
|
|
/// ResetData. If the platform does not recognize the EFI_GUID in ResetData the
|
|
|
|
/// platform must pick a supported reset type to perform. The platform may
|
|
|
|
/// optionally log the parameters from any non-normal reset that occurs.
|
|
|
|
///
|
|
|
|
EfiResetPlatformSpecific
|
|
|
|
} EFI_RESET_TYPE;
|
|
|
|
|
2008-06-24 09:14:18 +02:00
|
|
|
///
|
|
|
|
/// Data structure that precedes all of the standard EFI table types.
|
2014-10-22 05:03:18 +02:00
|
|
|
///
|
2007-06-08 13:31:52 +02:00
|
|
|
typedef struct {
|
2008-12-10 09:22:03 +01:00
|
|
|
///
|
|
|
|
/// A 64-bit signature that identifies the type of table that follows.
|
|
|
|
/// Unique signatures have been generated for the EFI System Table,
|
|
|
|
/// the EFI Boot Services Table, and the EFI Runtime Services Table.
|
|
|
|
///
|
2007-06-18 22:28:02 +02:00
|
|
|
UINT64 Signature;
|
2008-12-10 09:22:03 +01:00
|
|
|
///
|
|
|
|
/// The revision of the EFI Specification to which this table
|
|
|
|
/// conforms. The upper 16 bits of this field contain the major
|
|
|
|
/// revision value, and the lower 16 bits contain the minor revision
|
|
|
|
/// value. The minor revision values are limited to the range of 00..99.
|
|
|
|
///
|
2007-06-18 22:28:02 +02:00
|
|
|
UINT32 Revision;
|
2008-12-10 09:22:03 +01:00
|
|
|
///
|
|
|
|
/// The size, in bytes, of the entire table including the EFI_TABLE_HEADER.
|
|
|
|
///
|
2007-06-18 22:28:02 +02:00
|
|
|
UINT32 HeaderSize;
|
2008-12-10 09:22:03 +01:00
|
|
|
///
|
|
|
|
/// The 32-bit CRC for the entire table. This value is computed by
|
|
|
|
/// setting this field to 0, and computing the 32-bit CRC for HeaderSize bytes.
|
|
|
|
///
|
2007-06-18 22:28:02 +02:00
|
|
|
UINT32 CRC32;
|
2008-12-10 09:22:03 +01:00
|
|
|
///
|
|
|
|
/// Reserved field that must be set to 0.
|
|
|
|
///
|
2007-06-18 22:28:02 +02:00
|
|
|
UINT32 Reserved;
|
2007-06-08 13:31:52 +02:00
|
|
|
} EFI_TABLE_HEADER;
|
|
|
|
|
2008-06-24 09:14:18 +02:00
|
|
|
///
|
|
|
|
/// Attributes of variable.
|
2014-10-22 05:03:18 +02:00
|
|
|
///
|
2011-08-16 09:16:02 +02:00
|
|
|
#define EFI_VARIABLE_NON_VOLATILE 0x00000001
|
|
|
|
#define EFI_VARIABLE_BOOTSERVICE_ACCESS 0x00000002
|
|
|
|
#define EFI_VARIABLE_RUNTIME_ACCESS 0x00000004
|
2008-06-24 09:14:18 +02:00
|
|
|
///
|
2014-10-22 05:03:18 +02:00
|
|
|
/// This attribute is identified by the mnemonic 'HR'
|
2008-06-24 09:14:18 +02:00
|
|
|
/// elsewhere in this specification.
|
2014-10-22 05:03:18 +02:00
|
|
|
///
|
2011-08-16 09:16:02 +02:00
|
|
|
#define EFI_VARIABLE_HARDWARE_ERROR_RECORD 0x00000008
|
|
|
|
///
|
|
|
|
/// Attributes of Authenticated Variable
|
|
|
|
///
|
|
|
|
#define EFI_VARIABLE_AUTHENTICATED_WRITE_ACCESS 0x00000010
|
|
|
|
#define EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS 0x00000020
|
|
|
|
#define EFI_VARIABLE_APPEND_WRITE 0x00000040
|
|
|
|
|
2007-06-08 13:31:52 +02:00
|
|
|
|
2014-10-22 05:03:18 +02:00
|
|
|
///
|
2008-10-22 11:27:42 +02:00
|
|
|
/// AuthInfo is a WIN_CERTIFICATE using the wCertificateType
|
|
|
|
/// WIN_CERTIFICATE_UEFI_GUID and the CertType
|
2011-12-09 08:22:59 +01:00
|
|
|
/// EFI_CERT_TYPE_RSA2048_SHA256_GUID. If the attribute specifies
|
2008-10-22 11:27:42 +02:00
|
|
|
/// authenticated access, then the Data buffer should begin with an
|
|
|
|
/// authentication descriptor prior to the data payload and DataSize
|
|
|
|
/// should reflect the the data.and descriptor size. The caller
|
|
|
|
/// shall digest the Monotonic Count value and the associated data
|
|
|
|
/// for the variable update using the SHA-256 1-way hash algorithm.
|
|
|
|
/// The ensuing the 32-byte digest will be signed using the private
|
|
|
|
/// key associated w/ the public/private 2048-bit RSA key-pair. The
|
|
|
|
/// WIN_CERTIFICATE shall be used to describe the signature of the
|
|
|
|
/// Variable data *Data. In addition, the signature will also
|
2010-03-12 23:19:12 +01:00
|
|
|
/// include the MonotonicCount value to guard against replay attacks.
|
2014-10-22 05:03:18 +02:00
|
|
|
///
|
2007-06-08 13:31:52 +02:00
|
|
|
typedef struct {
|
2008-10-22 11:27:42 +02:00
|
|
|
///
|
2014-10-22 05:03:18 +02:00
|
|
|
/// Included in the signature of
|
2008-10-22 11:27:42 +02:00
|
|
|
/// AuthInfo.Used to ensure freshness/no
|
2014-10-22 05:03:18 +02:00
|
|
|
/// replay. Incremented during each
|
|
|
|
/// "Write" access.
|
|
|
|
///
|
2007-06-18 22:28:02 +02:00
|
|
|
UINT64 MonotonicCount;
|
2008-10-22 11:27:42 +02:00
|
|
|
///
|
2014-10-22 05:03:18 +02:00
|
|
|
/// Provides the authorization for the variable
|
|
|
|
/// access. It is a signature across the
|
|
|
|
/// variable data and the Monotonic Count
|
|
|
|
/// value. Caller uses Private key that is
|
|
|
|
/// associated with a public key that has been
|
|
|
|
/// provisioned via the key exchange.
|
2008-10-22 11:27:42 +02:00
|
|
|
///
|
2007-06-18 22:28:02 +02:00
|
|
|
WIN_CERTIFICATE_UEFI_GUID AuthInfo;
|
2007-06-08 13:31:52 +02:00
|
|
|
} EFI_VARIABLE_AUTHENTICATION;
|
|
|
|
|
2011-08-16 09:16:02 +02:00
|
|
|
///
|
2014-10-22 05:03:18 +02:00
|
|
|
/// When the attribute EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS is
|
2011-08-16 09:16:02 +02:00
|
|
|
/// set, then the Data buffer shall begin with an instance of a complete (and serialized)
|
2014-10-22 05:03:18 +02:00
|
|
|
/// EFI_VARIABLE_AUTHENTICATION_2 descriptor. The descriptor shall be followed by the new
|
|
|
|
/// variable value and DataSize shall reflect the combined size of the descriptor and the new
|
|
|
|
/// variable value. The authentication descriptor is not part of the variable data and is not
|
2011-08-16 09:16:02 +02:00
|
|
|
/// returned by subsequent calls to GetVariable().
|
|
|
|
///
|
|
|
|
typedef struct {
|
|
|
|
///
|
2014-10-22 05:03:18 +02:00
|
|
|
/// For the TimeStamp value, components Pad1, Nanosecond, TimeZone, Daylight and
|
2011-08-16 09:16:02 +02:00
|
|
|
/// Pad2 shall be set to 0. This means that the time shall always be expressed in GMT.
|
|
|
|
///
|
|
|
|
EFI_TIME TimeStamp;
|
2014-10-22 05:03:18 +02:00
|
|
|
///
|
2011-08-16 09:16:02 +02:00
|
|
|
/// Only a CertType of EFI_CERT_TYPE_PKCS7_GUID is accepted.
|
|
|
|
///
|
|
|
|
WIN_CERTIFICATE_UEFI_GUID AuthInfo;
|
|
|
|
} EFI_VARIABLE_AUTHENTICATION_2;
|
2007-06-08 13:31:52 +02:00
|
|
|
|
2011-08-16 09:16:02 +02:00
|
|
|
#endif
|