iPXE
PiMultiPhase.h
Go to the documentation of this file.
1/** @file
2 Include file matches things in PI for multiple module types.
3
4Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
5SPDX-License-Identifier: BSD-2-Clause-Patent
6
7 @par Revision Reference:
8 These elements are defined in UEFI Platform Initialization Specification 1.8.A
9
10**/
11
12#pragma once
13
14FILE_LICENCE ( BSD2_PATENT );
15FILE_SECBOOT ( PERMITTED );
16
20#include <ipxe/efi/Pi/PiHob.h>
24
25//
26// PI Specification Version Information
27//
28#define PI_SPECIFICATION_MAJOR_REVISION 1
29#define PI_SPECIFICATION_MINOR_REVISION 80
30#define PI_SPECIFICATION_VERSION ((PI_SPECIFICATION_MAJOR_REVISION << 16) | (PI_SPECIFICATION_MINOR_REVISION))
31
32/**
33 Produces an error code in the range reserved for use by the Platform Initialization
34 Architecture Specification.
35
36 The supported 32-bit range is 0xA0000000-0xBFFFFFFF
37 The supported 64-bit range is 0xA000000000000000-0xBFFFFFFFFFFFFFFF
38
39 @param StatusCode The status code value to convert into a warning code.
40 StatusCode must be in the range 0x00000000..0x1FFFFFFF.
41
42 @return The value specified by StatusCode in the PI reserved range.
43
44**/
45#define DXE_ERROR(StatusCode) (MAX_BIT | (MAX_BIT >> 2) | StatusCode)
46
47///
48/// If this value is returned by an EFI image, then the image should be unloaded.
49///
50#define EFI_REQUEST_UNLOAD_IMAGE DXE_ERROR (1)
51
52///
53/// If this value is returned by an API, it means the capability is not yet
54/// installed/available/ready to use.
55///
56#define EFI_NOT_AVAILABLE_YET DXE_ERROR (2)
57
58///
59/// Success and warning codes reserved for use by PI.
60/// Supported 32-bit range is 0x20000000-0x3fffffff.
61/// Supported 64-bit range is 0x2000000000000000-0x3fffffffffffffff.
62///
63#define PI_ENCODE_WARNING(a) ((MAX_BIT >> 2) | (a))
64
65///
66/// Error codes reserved for use by PI.
67/// Supported 32-bit range is 0xa0000000-0xbfffffff.
68/// Supported 64-bit range is 0xa000000000000000-0xbfffffffffffffff.
69///
70#define PI_ENCODE_ERROR(a) (MAX_BIT | (MAX_BIT >> 2) | (a))
71
72///
73/// Return status codes defined in SMM CIS.
74///
75#define EFI_INTERRUPT_PENDING PI_ENCODE_ERROR (0)
76
77#define EFI_WARN_INTERRUPT_SOURCE_PENDING PI_ENCODE_WARNING (0)
78#define EFI_WARN_INTERRUPT_SOURCE_QUIESCED PI_ENCODE_WARNING (1)
79
80///
81/// Bitmask of values for Authentication Status.
82/// Authentication Status is returned from EFI_GUIDED_SECTION_EXTRACTION_PROTOCOL
83/// and the EFI_PEI_GUIDED_SECTION_EXTRACTION_PPI
84///
85/// xx00 Image was not signed.
86/// xxx1 Platform security policy override. Assumes the same meaning as 0010 (the image was signed, the
87/// signature was tested, and the signature passed authentication test).
88/// 0010 Image was signed, the signature was tested, and the signature passed authentication test.
89/// 0110 Image was signed and the signature was not tested.
90/// 1010 Image was signed, the signature was tested, and the signature failed the authentication test.
91///
92///@{
93#define EFI_AUTH_STATUS_PLATFORM_OVERRIDE 0x01
94#define EFI_AUTH_STATUS_IMAGE_SIGNED 0x02
95#define EFI_AUTH_STATUS_NOT_TESTED 0x04
96#define EFI_AUTH_STATUS_TEST_FAILED 0x08
97#define EFI_AUTH_STATUS_ALL 0x0f
98///@}
99
100///
101/// MMRAM states and capabilities
102///
103#define EFI_MMRAM_OPEN 0x00000001
104#define EFI_MMRAM_CLOSED 0x00000002
105#define EFI_MMRAM_LOCKED 0x00000004
106#define EFI_CACHEABLE 0x00000008
107#define EFI_ALLOCATED 0x00000010
108#define EFI_NEEDS_TESTING 0x00000020
109#define EFI_NEEDS_ECC_INITIALIZATION 0x00000040
110
111#define EFI_SMRAM_OPEN EFI_MMRAM_OPEN
112#define EFI_SMRAM_CLOSED EFI_MMRAM_CLOSED
113#define EFI_SMRAM_LOCKED EFI_MMRAM_LOCKED
114
115///
116/// MM Communicate header constants
117///
118#define COMMUNICATE_HEADER_V3_GUID \
119 { \
120 0x68e8c853, 0x2ba9, 0x4dd7, { 0x9a, 0xc0, 0x91, 0xe1, 0x61, 0x55, 0xc9, 0x35 } \
121 }
122
123///
124/// Structure describing a MMRAM region and its accessibility attributes.
125///
126typedef struct {
127 ///
128 /// Designates the physical address of the MMRAM in memory. This view of memory is
129 /// the same as seen by I/O-based agents, for example, but it may not be the address seen
130 /// by the processors.
131 ///
133 ///
134 /// Designates the address of the MMRAM, as seen by software executing on the
135 /// processors. This address may or may not match PhysicalStart.
136 ///
138 ///
139 /// Describes the number of bytes in the MMRAM region.
140 ///
142 ///
143 /// Describes the accessibility attributes of the MMRAM. These attributes include the
144 /// hardware state (e.g., Open/Closed/Locked), capability (e.g., cacheable), logical
145 /// allocation (e.g., allocated), and pre-use initialization (e.g., needs testing/ECC
146 /// initialization).
147 ///
150
152
153///
154/// Structure describing a MMRAM region which cannot be used for the MMRAM heap.
155///
157 ///
158 /// Starting address of the reserved MMRAM area, as it appears while MMRAM is open.
159 /// Ignored if MmramReservedSize is 0.
160 ///
162 ///
163 /// Number of bytes occupied by the reserved MMRAM area. A size of zero indicates the
164 /// last MMRAM area.
165 ///
168
169#pragma pack(1)
170
171///
172/// To avoid confusion in interpreting frames, the buffer communicating to MM core through
173/// EFI_MM_COMMUNICATE3 or later should always start with EFI_MM_COMMUNICATE_HEADER_V3.
174///
175typedef struct {
176 ///
177 /// Indicator GUID for MM core that the communication buffer is compliant with this v3 header.
178 /// Must be gEfiMmCommunicateHeaderV3Guid.
179 ///
181 ///
182 /// Describes the size of the entire buffer (in bytes) available for communication, including this communication header.
183 ///
185 ///
186 /// Reserved for future use.
187 ///
189 ///
190 /// Allows for disambiguation of the message format.
191 ///
193 ///
194 /// Describes the size of MessageData (in bytes) and does not include the size of the header.
195 ///
197 ///
198 /// Designates an array of bytes that is MessageSize in size.
199 ///
202
203#pragma pack()
204
207 "sizeof (EFI_MM_COMMUNICATE_HEADER_V3) does not align with the beginning of flexible array MessageData"
208 );
209
218
219typedef struct {
220 ///
221 /// The returned information associated with the requested TokenNumber. If
222 /// TokenNumber is 0, then PcdType is set to EFI_PCD_TYPE_8.
223 ///
225 ///
226 /// The size of the data in bytes associated with the TokenNumber specified. If
227 /// TokenNumber is 0, then PcdSize is set 0.
228 ///
230 ///
231 /// The null-terminated ASCII string associated with a given token. If the
232 /// TokenNumber specified was 0, then this field corresponds to the null-terminated
233 /// ASCII string associated with the token's namespace Guid. If NULL, there is no
234 /// name associated with this request.
235 ///
238
239/**
240 The function prototype for invoking a function on an Application Processor.
241
242 This definition is used by the UEFI MP Serices Protocol, and the
243 PI SMM System Table.
244
245 @param[in,out] Buffer The pointer to private data buffer.
246**/
247typedef
251 );
252
253/**
254 The function prototype for invoking a function on an Application Processor.
255
256 This definition is used by the UEFI MM MP Serices Protocol.
257
258 @param[in] ProcedureArgument The pointer to private data buffer.
259
260 @retval EFI_SUCCESS Excutive the procedure successfully
261
262**/
263typedef
266 IN VOID *ProcedureArgument
267 );
268
char CHAR8
1-byte Character
UINT64 UINTN
Unsigned value of native width.
unsigned long long UINT64
8-byte unsigned value.
#define EFIAPI
unsigned char UINT8
1-byte unsigned value.
#define VOID
Undeclared type.
Definition Base.h:271
#define OFFSET_OF(TYPE, Field)
The macro that returns the byte offset of a field in a data structure.
Definition Base.h:760
Present the boot mode values in PI.
Present the dependency expression values in PI.
The firmware file related definitions in PI.
The firmware volume related definitions in PI.
HOB related definitions in PI.
VOID(EFIAPI * EFI_AP_PROCEDURE)(IN OUT VOID *Buffer)
The function prototype for invoking a function on an Application Processor.
EFI_GUID gEfiMmCommunicateHeaderV3Guid
EFI_MMRAM_DESCRIPTOR EFI_SMRAM_DESCRIPTOR
EFI_STATUS(EFIAPI * EFI_AP_PROCEDURE2)(IN VOID *ProcedureArgument)
The function prototype for invoking a function on an Application Processor.
struct _EFI_MM_RESERVED_MMRAM_REGION EFI_MM_RESERVED_MMRAM_REGION
Structure describing a MMRAM region which cannot be used for the MMRAM heap.
EFI_PCD_TYPE
@ EFI_PCD_TYPE_8
@ EFI_PCD_TYPE_16
@ EFI_PCD_TYPE_64
@ EFI_PCD_TYPE_PTR
@ EFI_PCD_TYPE_BOOL
@ EFI_PCD_TYPE_32
STATIC_ASSERT((sizeof(EFI_MM_COMMUNICATE_HEADER_V3)==OFFSET_OF(EFI_MM_COMMUNICATE_HEADER_V3, MessageData)), "sizeof (EFI_MM_COMMUNICATE_HEADER_V3) does not align with the beginning of flexible array MessageData")
This file contains the boot script definitions that are shared between the Boot Script Executor PPI a...
StatusCode related definitions in PI.
UINT64 EFI_PHYSICAL_ADDRESS
64-bit physical memory address.
RETURN_STATUS EFI_STATUS
Function return status for EFI API.
GUID EFI_GUID
128-bit buffer containing a unique identifier value.
#define FILE_LICENCE(_licence)
Declare a particular licence as applying to a file.
Definition compiler.h:921
#define FILE_SECBOOT(_status)
Declare a file's UEFI Secure Boot permission status.
Definition compiler.h:951
#define IN
Definition mlx_utils.h:28
#define OUT
Definition mlx_utils.h:29
SEGOFF16_t Buffer
Buffer address.
Definition pxe_api.h:8
Structure describing a MMRAM region and its accessibility attributes.
EFI_PHYSICAL_ADDRESS CpuStart
Designates the address of the MMRAM, as seen by software executing on the processors.
UINT64 PhysicalSize
Describes the number of bytes in the MMRAM region.
UINT64 RegionState
Describes the accessibility attributes of the MMRAM.
EFI_PHYSICAL_ADDRESS PhysicalStart
Designates the physical address of the MMRAM in memory.
To avoid confusion in interpreting frames, the buffer communicating to MM core through EFI_MM_COMMUNI...
EFI_GUID MessageGuid
Allows for disambiguation of the message format.
UINT64 Reserved
Reserved for future use.
UINT64 BufferSize
Describes the size of the entire buffer (in bytes) available for communication, including this commun...
EFI_GUID HeaderGuid
Indicator GUID for MM core that the communication buffer is compliant with this v3 header.
UINT8 MessageData[]
Designates an array of bytes that is MessageSize in size.
UINT64 MessageSize
Describes the size of MessageData (in bytes) and does not include the size of the header.
EFI_PCD_TYPE PcdType
The returned information associated with the requested TokenNumber.
UINTN PcdSize
The size of the data in bytes associated with the TokenNumber specified.
CHAR8 * PcdName
The null-terminated ASCII string associated with a given token.
Structure describing a MMRAM region which cannot be used for the MMRAM heap.
EFI_PHYSICAL_ADDRESS MmramReservedStart
Starting address of the reserved MMRAM area, as it appears while MMRAM is open.
UINT64 MmramReservedSize
Number of bytes occupied by the reserved MMRAM area.