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