iPXE
PiMultiPhase.h
Go to the documentation of this file.
00001 /** @file
00002   Include file matches things in PI for multiple module types.
00003 
00004 Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.<BR>
00005 This program and the accompanying materials are licensed and made available under
00006 the terms and conditions of the BSD License that accompanies this distribution.
00007 The full text of the license may be found at
00008 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   @par Revision Reference:
00014   These elements are defined in UEFI Platform Initialization Specification 1.2.
00015 
00016 **/
00017 
00018 #ifndef __PI_MULTIPHASE_H__
00019 #define __PI_MULTIPHASE_H__
00020 
00021 FILE_LICENCE ( BSD3 );
00022 
00023 #include <ipxe/efi/Pi/PiFirmwareVolume.h>
00024 #include <ipxe/efi/Pi/PiFirmwareFile.h>
00025 #include <ipxe/efi/Pi/PiBootMode.h>
00026 #include <ipxe/efi/Pi/PiHob.h>
00027 #include <ipxe/efi/Pi/PiDependency.h>
00028 #include <ipxe/efi/Pi/PiStatusCode.h>
00029 #include <ipxe/efi/Pi/PiS3BootScript.h>
00030 
00031 /**
00032   Produces an error code in the range reserved for use by the Platform Initialization
00033   Architecture Specification.
00034 
00035   The supported 32-bit range is 0xA0000000-0xBFFFFFFF
00036   The supported 64-bit range is 0xA000000000000000-0xBFFFFFFFFFFFFFFF
00037 
00038   @param  StatusCode    The status code value to convert into a warning code.
00039                         StatusCode must be in the range 0x00000000..0x1FFFFFFF.
00040 
00041   @return The value specified by StatusCode in the PI reserved range.
00042 
00043 **/
00044 #define DXE_ERROR(StatusCode)  (MAX_BIT | (MAX_BIT >> 2) | StatusCode)
00045 
00046 ///
00047 /// If this value is returned by an EFI image, then the image should be unloaded.
00048 ///
00049 #define EFI_REQUEST_UNLOAD_IMAGE  DXE_ERROR (1)
00050 
00051 ///
00052 /// If this value is returned by an API, it means the capability is not yet
00053 /// installed/available/ready to use.
00054 ///
00055 #define EFI_NOT_AVAILABLE_YET     DXE_ERROR (2)
00056 
00057 ///
00058 /// Success and warning codes reserved for use by PI.
00059 /// Supported 32-bit range is 0x20000000-0x3fffffff.
00060 /// Supported 64-bit range is 0x2000000000000000-0x3fffffffffffffff.
00061 ///
00062 #define PI_ENCODE_WARNING(a)                ((MAX_BIT >> 2) | (a))
00063 
00064 ///
00065 /// Error codes reserved for use by PI.
00066 /// Supported 32-bit range is 0xa0000000-0xbfffffff.
00067 /// Supported 64-bit range is 0xa000000000000000-0xbfffffffffffffff.
00068 ///
00069 #define PI_ENCODE_ERROR(a)                  (MAX_BIT | (MAX_BIT >> 2) | (a))
00070 
00071 ///
00072 /// Return status codes defined in SMM CIS.
00073 ///
00074 #define EFI_INTERRUPT_PENDING               PI_ENCODE_ERROR (0)
00075 
00076 #define EFI_WARN_INTERRUPT_SOURCE_PENDING   PI_ENCODE_WARNING (0)
00077 #define EFI_WARN_INTERRUPT_SOURCE_QUIESCED  PI_ENCODE_WARNING (1)
00078 
00079 ///
00080 /// Bitmask of values for Authentication Status.
00081 /// Authentication Status is returned from EFI_GUIDED_SECTION_EXTRACTION_PROTOCOL
00082 /// and the EFI_PEI_GUIDED_SECTION_EXTRACTION_PPI
00083 ///
00084 /// xx00 Image was not signed.
00085 /// xxx1 Platform security policy override. Assumes the same meaning as 0010 (the image was signed, the
00086 ///      signature was tested, and the signature passed authentication test).
00087 /// 0010 Image was signed, the signature was tested, and the signature passed authentication test.
00088 /// 0110 Image was signed and the signature was not tested.
00089 /// 1010 Image was signed, the signature was tested, and the signature failed the authentication test.
00090 ///
00091 ///@{
00092 #define EFI_AUTH_STATUS_PLATFORM_OVERRIDE   0x01
00093 #define EFI_AUTH_STATUS_IMAGE_SIGNED        0x02
00094 #define EFI_AUTH_STATUS_NOT_TESTED          0x04
00095 #define EFI_AUTH_STATUS_TEST_FAILED         0x08
00096 #define EFI_AUTH_STATUS_ALL                 0x0f
00097 ///@}
00098 
00099 ///
00100 /// SMRAM states and capabilities
00101 ///
00102 #define EFI_SMRAM_OPEN                  0x00000001
00103 #define EFI_SMRAM_CLOSED                0x00000002
00104 #define EFI_SMRAM_LOCKED                0x00000004
00105 #define EFI_CACHEABLE                   0x00000008
00106 #define EFI_ALLOCATED                   0x00000010
00107 #define EFI_NEEDS_TESTING               0x00000020
00108 #define EFI_NEEDS_ECC_INITIALIZATION    0x00000040
00109 
00110 ///
00111 /// Structure describing a SMRAM region and its accessibility attributes.
00112 ///
00113 typedef struct {
00114   ///
00115   /// Designates the physical address of the SMRAM in memory. This view of memory is
00116   /// the same as seen by I/O-based agents, for example, but it may not be the address seen
00117   /// by the processors.
00118   ///
00119   EFI_PHYSICAL_ADDRESS  PhysicalStart;
00120   ///
00121   /// Designates the address of the SMRAM, as seen by software executing on the
00122   /// processors. This address may or may not match PhysicalStart.
00123   ///
00124   EFI_PHYSICAL_ADDRESS  CpuStart;
00125   ///
00126   /// Describes the number of bytes in the SMRAM region.
00127   ///
00128   UINT64                PhysicalSize;
00129   ///
00130   /// Describes the accessibility attributes of the SMRAM.  These attributes include the
00131   /// hardware state (e.g., Open/Closed/Locked), capability (e.g., cacheable), logical
00132   /// allocation (e.g., allocated), and pre-use initialization (e.g., needs testing/ECC
00133   /// initialization).
00134   ///
00135   UINT64                RegionState;
00136 } EFI_SMRAM_DESCRIPTOR;
00137 
00138 typedef enum {
00139   EFI_PCD_TYPE_8,
00140   EFI_PCD_TYPE_16,
00141   EFI_PCD_TYPE_32,
00142   EFI_PCD_TYPE_64,
00143   EFI_PCD_TYPE_BOOL,
00144   EFI_PCD_TYPE_PTR
00145 } EFI_PCD_TYPE;
00146 
00147 typedef struct {
00148   ///
00149   /// The returned information associated with the requested TokenNumber. If
00150   /// TokenNumber is 0, then PcdType is set to EFI_PCD_TYPE_8.
00151   ///
00152   EFI_PCD_TYPE      PcdType;
00153   ///
00154   /// The size of the data in bytes associated with the TokenNumber specified. If
00155   /// TokenNumber is 0, then PcdSize is set 0.
00156   ///
00157   UINTN             PcdSize;
00158   ///
00159   /// The null-terminated ASCII string associated with a given token. If the
00160   /// TokenNumber specified was 0, then this field corresponds to the null-terminated
00161   /// ASCII string associated with the token's namespace Guid. If NULL, there is no
00162   /// name associated with this request.
00163   ///
00164   CHAR8             *PcdName;
00165 } EFI_PCD_INFO;
00166 
00167 /**
00168   The function prototype for invoking a function on an Application Processor.
00169 
00170   This definition is used by the UEFI MP Serices Protocol, and the
00171   PI SMM System Table.
00172 
00173   @param[in,out] Buffer  The pointer to private data buffer.
00174 **/
00175 typedef
00176 VOID
00177 (EFIAPI *EFI_AP_PROCEDURE)(
00178   IN OUT VOID  *Buffer
00179   );
00180 
00181 #endif