Path: blob/main/sys/contrib/edk2/Include/Pi/PiMultiPhase.h
96339 views
/** @file1Include file matches things in PI for multiple module types.23Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>4SPDX-License-Identifier: BSD-2-Clause-Patent56@par Revision Reference:7These elements are defined in UEFI Platform Initialization Specification 1.8.A89**/1011#ifndef __PI_MULTIPHASE_H__12#define __PI_MULTIPHASE_H__1314#include <Pi/PiFirmwareVolume.h>15#include <Pi/PiFirmwareFile.h>16#include <Pi/PiBootMode.h>17#include <Pi/PiHob.h>18#include <Pi/PiDependency.h>19#include <Pi/PiStatusCode.h>20#include <Pi/PiS3BootScript.h>2122//23// PI Specification Version Information24//25#define PI_SPECIFICATION_MAJOR_REVISION 126#define PI_SPECIFICATION_MINOR_REVISION 8027#define PI_SPECIFICATION_VERSION ((PI_SPECIFICATION_MAJOR_REVISION << 16) | (PI_SPECIFICATION_MINOR_REVISION))2829/**30Produces an error code in the range reserved for use by the Platform Initialization31Architecture Specification.3233The supported 32-bit range is 0xA0000000-0xBFFFFFFF34The supported 64-bit range is 0xA000000000000000-0xBFFFFFFFFFFFFFFF3536@param StatusCode The status code value to convert into a warning code.37StatusCode must be in the range 0x00000000..0x1FFFFFFF.3839@return The value specified by StatusCode in the PI reserved range.4041**/42#define DXE_ERROR(StatusCode) (MAX_BIT | (MAX_BIT >> 2) | StatusCode)4344///45/// If this value is returned by an EFI image, then the image should be unloaded.46///47#define EFI_REQUEST_UNLOAD_IMAGE DXE_ERROR (1)4849///50/// If this value is returned by an API, it means the capability is not yet51/// installed/available/ready to use.52///53#define EFI_NOT_AVAILABLE_YET DXE_ERROR (2)5455///56/// Success and warning codes reserved for use by PI.57/// Supported 32-bit range is 0x20000000-0x3fffffff.58/// Supported 64-bit range is 0x2000000000000000-0x3fffffffffffffff.59///60#define PI_ENCODE_WARNING(a) ((MAX_BIT >> 2) | (a))6162///63/// Error codes reserved for use by PI.64/// Supported 32-bit range is 0xa0000000-0xbfffffff.65/// Supported 64-bit range is 0xa000000000000000-0xbfffffffffffffff.66///67#define PI_ENCODE_ERROR(a) (MAX_BIT | (MAX_BIT >> 2) | (a))6869///70/// Return status codes defined in SMM CIS.71///72#define EFI_INTERRUPT_PENDING PI_ENCODE_ERROR (0)7374#define EFI_WARN_INTERRUPT_SOURCE_PENDING PI_ENCODE_WARNING (0)75#define EFI_WARN_INTERRUPT_SOURCE_QUIESCED PI_ENCODE_WARNING (1)7677///78/// Bitmask of values for Authentication Status.79/// Authentication Status is returned from EFI_GUIDED_SECTION_EXTRACTION_PROTOCOL80/// and the EFI_PEI_GUIDED_SECTION_EXTRACTION_PPI81///82/// xx00 Image was not signed.83/// xxx1 Platform security policy override. Assumes the same meaning as 0010 (the image was signed, the84/// signature was tested, and the signature passed authentication test).85/// 0010 Image was signed, the signature was tested, and the signature passed authentication test.86/// 0110 Image was signed and the signature was not tested.87/// 1010 Image was signed, the signature was tested, and the signature failed the authentication test.88///89///@{90#define EFI_AUTH_STATUS_PLATFORM_OVERRIDE 0x0191#define EFI_AUTH_STATUS_IMAGE_SIGNED 0x0292#define EFI_AUTH_STATUS_NOT_TESTED 0x0493#define EFI_AUTH_STATUS_TEST_FAILED 0x0894#define EFI_AUTH_STATUS_ALL 0x0f95///@}9697///98/// MMRAM states and capabilities99///100#define EFI_MMRAM_OPEN 0x00000001101#define EFI_MMRAM_CLOSED 0x00000002102#define EFI_MMRAM_LOCKED 0x00000004103#define EFI_CACHEABLE 0x00000008104#define EFI_ALLOCATED 0x00000010105#define EFI_NEEDS_TESTING 0x00000020106#define EFI_NEEDS_ECC_INITIALIZATION 0x00000040107108#define EFI_SMRAM_OPEN EFI_MMRAM_OPEN109#define EFI_SMRAM_CLOSED EFI_MMRAM_CLOSED110#define EFI_SMRAM_LOCKED EFI_MMRAM_LOCKED111112///113/// Structure describing a MMRAM region and its accessibility attributes.114///115typedef struct {116///117/// Designates the physical address of the MMRAM in memory. This view of memory is118/// the same as seen by I/O-based agents, for example, but it may not be the address seen119/// by the processors.120///121EFI_PHYSICAL_ADDRESS PhysicalStart;122///123/// Designates the address of the MMRAM, as seen by software executing on the124/// processors. This address may or may not match PhysicalStart.125///126EFI_PHYSICAL_ADDRESS CpuStart;127///128/// Describes the number of bytes in the MMRAM region.129///130UINT64 PhysicalSize;131///132/// Describes the accessibility attributes of the MMRAM. These attributes include the133/// hardware state (e.g., Open/Closed/Locked), capability (e.g., cacheable), logical134/// allocation (e.g., allocated), and pre-use initialization (e.g., needs testing/ECC135/// initialization).136///137UINT64 RegionState;138} EFI_MMRAM_DESCRIPTOR;139140typedef EFI_MMRAM_DESCRIPTOR EFI_SMRAM_DESCRIPTOR;141142///143/// Structure describing a MMRAM region which cannot be used for the MMRAM heap.144///145typedef struct _EFI_MM_RESERVED_MMRAM_REGION {146///147/// Starting address of the reserved MMRAM area, as it appears while MMRAM is open.148/// Ignored if MmramReservedSize is 0.149///150EFI_PHYSICAL_ADDRESS MmramReservedStart;151///152/// Number of bytes occupied by the reserved MMRAM area. A size of zero indicates the153/// last MMRAM area.154///155UINT64 MmramReservedSize;156} EFI_MM_RESERVED_MMRAM_REGION;157158typedef enum {159EFI_PCD_TYPE_8,160EFI_PCD_TYPE_16,161EFI_PCD_TYPE_32,162EFI_PCD_TYPE_64,163EFI_PCD_TYPE_BOOL,164EFI_PCD_TYPE_PTR165} EFI_PCD_TYPE;166167typedef struct {168///169/// The returned information associated with the requested TokenNumber. If170/// TokenNumber is 0, then PcdType is set to EFI_PCD_TYPE_8.171///172EFI_PCD_TYPE PcdType;173///174/// The size of the data in bytes associated with the TokenNumber specified. If175/// TokenNumber is 0, then PcdSize is set 0.176///177UINTN PcdSize;178///179/// The null-terminated ASCII string associated with a given token. If the180/// TokenNumber specified was 0, then this field corresponds to the null-terminated181/// ASCII string associated with the token's namespace Guid. If NULL, there is no182/// name associated with this request.183///184CHAR8 *PcdName;185} EFI_PCD_INFO;186187/**188The function prototype for invoking a function on an Application Processor.189190This definition is used by the UEFI MP Serices Protocol, and the191PI SMM System Table.192193@param[in,out] Buffer The pointer to private data buffer.194**/195typedef196VOID197(EFIAPI *EFI_AP_PROCEDURE)(198IN OUT VOID *Buffer199);200201/**202The function prototype for invoking a function on an Application Processor.203204This definition is used by the UEFI MM MP Serices Protocol.205206@param[in] ProcedureArgument The pointer to private data buffer.207208@retval EFI_SUCCESS Excutive the procedure successfully209210**/211typedef212EFI_STATUS213(EFIAPI *EFI_AP_PROCEDURE2)(214IN VOID *ProcedureArgument215);216217#endif218219220