blob: 04624d461498031b76052080eac39c550aa8fe82 [file] [log] [blame]
Subrata Banik20fe24b2021-12-09 02:46:38 +05301/** @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.2.
9
10**/
11
12#ifndef __PI_MULTIPHASE_H__
13#define __PI_MULTIPHASE_H__
14
15#include <Pi/PiFirmwareVolume.h>
16#include <Pi/PiFirmwareFile.h>
17#include <Pi/PiBootMode.h>
18#include <Pi/PiHob.h>
19#include <Pi/PiDependency.h>
20#include <Pi/PiStatusCode.h>
21#include <Pi/PiS3BootScript.h>
22
23/**
24 Produces an error code in the range reserved for use by the Platform Initialization
25 Architecture Specification.
26
27 The supported 32-bit range is 0xA0000000-0xBFFFFFFF
28 The supported 64-bit range is 0xA000000000000000-0xBFFFFFFFFFFFFFFF
29
30 @param StatusCode The status code value to convert into a warning code.
31 StatusCode must be in the range 0x00000000..0x1FFFFFFF.
32
33 @return The value specified by StatusCode in the PI reserved range.
34
35**/
36#define DXE_ERROR(StatusCode) (MAX_BIT | (MAX_BIT >> 2) | StatusCode)
37
38///
39/// If this value is returned by an EFI image, then the image should be unloaded.
40///
41#define EFI_REQUEST_UNLOAD_IMAGE DXE_ERROR (1)
42
43///
44/// If this value is returned by an API, it means the capability is not yet
45/// installed/available/ready to use.
46///
47#define EFI_NOT_AVAILABLE_YET DXE_ERROR (2)
48
49///
50/// Success and warning codes reserved for use by PI.
51/// Supported 32-bit range is 0x20000000-0x3fffffff.
52/// Supported 64-bit range is 0x2000000000000000-0x3fffffffffffffff.
53///
54#define PI_ENCODE_WARNING(a) ((MAX_BIT >> 2) | (a))
55
56///
57/// Error codes reserved for use by PI.
58/// Supported 32-bit range is 0xa0000000-0xbfffffff.
59/// Supported 64-bit range is 0xa000000000000000-0xbfffffffffffffff.
60///
61#define PI_ENCODE_ERROR(a) (MAX_BIT | (MAX_BIT >> 2) | (a))
62
63///
64/// Return status codes defined in SMM CIS.
65///
66#define EFI_INTERRUPT_PENDING PI_ENCODE_ERROR (0)
67
68#define EFI_WARN_INTERRUPT_SOURCE_PENDING PI_ENCODE_WARNING (0)
69#define EFI_WARN_INTERRUPT_SOURCE_QUIESCED PI_ENCODE_WARNING (1)
70
71///
72/// Bitmask of values for Authentication Status.
73/// Authentication Status is returned from EFI_GUIDED_SECTION_EXTRACTION_PROTOCOL
74/// and the EFI_PEI_GUIDED_SECTION_EXTRACTION_PPI
75///
76/// xx00 Image was not signed.
77/// xxx1 Platform security policy override. Assumes the same meaning as 0010 (the image was signed, the
78/// signature was tested, and the signature passed authentication test).
79/// 0010 Image was signed, the signature was tested, and the signature passed authentication test.
80/// 0110 Image was signed and the signature was not tested.
81/// 1010 Image was signed, the signature was tested, and the signature failed the authentication test.
82///
83///@{
84#define EFI_AUTH_STATUS_PLATFORM_OVERRIDE 0x01
85#define EFI_AUTH_STATUS_IMAGE_SIGNED 0x02
86#define EFI_AUTH_STATUS_NOT_TESTED 0x04
87#define EFI_AUTH_STATUS_TEST_FAILED 0x08
88#define EFI_AUTH_STATUS_ALL 0x0f
89///@}
90
91///
92/// MMRAM states and capabilities
93///
94#define EFI_MMRAM_OPEN 0x00000001
95#define EFI_MMRAM_CLOSED 0x00000002
96#define EFI_MMRAM_LOCKED 0x00000004
97#define EFI_CACHEABLE 0x00000008
98#define EFI_ALLOCATED 0x00000010
99#define EFI_NEEDS_TESTING 0x00000020
100#define EFI_NEEDS_ECC_INITIALIZATION 0x00000040
101
102#define EFI_SMRAM_OPEN EFI_MMRAM_OPEN
103#define EFI_SMRAM_CLOSED EFI_MMRAM_CLOSED
104#define EFI_SMRAM_LOCKED EFI_MMRAM_LOCKED
105
106///
107/// Structure describing a MMRAM region and its accessibility attributes.
108///
109typedef struct {
110 ///
111 /// Designates the physical address of the MMRAM in memory. This view of memory is
112 /// the same as seen by I/O-based agents, for example, but it may not be the address seen
113 /// by the processors.
114 ///
115 EFI_PHYSICAL_ADDRESS PhysicalStart;
116 ///
117 /// Designates the address of the MMRAM, as seen by software executing on the
118 /// processors. This address may or may not match PhysicalStart.
119 ///
120 EFI_PHYSICAL_ADDRESS CpuStart;
121 ///
122 /// Describes the number of bytes in the MMRAM region.
123 ///
124 UINT64 PhysicalSize;
125 ///
126 /// Describes the accessibility attributes of the MMRAM. These attributes include the
127 /// hardware state (e.g., Open/Closed/Locked), capability (e.g., cacheable), logical
128 /// allocation (e.g., allocated), and pre-use initialization (e.g., needs testing/ECC
129 /// initialization).
130 ///
131 UINT64 RegionState;
132} EFI_MMRAM_DESCRIPTOR;
133
134typedef EFI_MMRAM_DESCRIPTOR EFI_SMRAM_DESCRIPTOR;
135
136///
137/// Structure describing a MMRAM region which cannot be used for the MMRAM heap.
138///
139typedef struct _EFI_MM_RESERVED_MMRAM_REGION {
140 ///
141 /// Starting address of the reserved MMRAM area, as it appears while MMRAM is open.
142 /// Ignored if MmramReservedSize is 0.
143 ///
144 EFI_PHYSICAL_ADDRESS MmramReservedStart;
145 ///
146 /// Number of bytes occupied by the reserved MMRAM area. A size of zero indicates the
147 /// last MMRAM area.
148 ///
149 UINT64 MmramReservedSize;
150} EFI_MM_RESERVED_MMRAM_REGION;
151
152typedef enum {
153 EFI_PCD_TYPE_8,
154 EFI_PCD_TYPE_16,
155 EFI_PCD_TYPE_32,
156 EFI_PCD_TYPE_64,
157 EFI_PCD_TYPE_BOOL,
158 EFI_PCD_TYPE_PTR
159} EFI_PCD_TYPE;
160
161typedef struct {
162 ///
163 /// The returned information associated with the requested TokenNumber. If
164 /// TokenNumber is 0, then PcdType is set to EFI_PCD_TYPE_8.
165 ///
166 EFI_PCD_TYPE PcdType;
167 ///
168 /// The size of the data in bytes associated with the TokenNumber specified. If
169 /// TokenNumber is 0, then PcdSize is set 0.
170 ///
171 UINTN PcdSize;
172 ///
173 /// The null-terminated ASCII string associated with a given token. If the
174 /// TokenNumber specified was 0, then this field corresponds to the null-terminated
175 /// ASCII string associated with the token's namespace Guid. If NULL, there is no
176 /// name associated with this request.
177 ///
178 CHAR8 *PcdName;
179} EFI_PCD_INFO;
180
181/**
182 The function prototype for invoking a function on an Application Processor.
183
184 This definition is used by the UEFI MP Serices Protocol, and the
185 PI SMM System Table.
186
187 @param[in,out] Buffer The pointer to private data buffer.
188**/
189typedef
190VOID
191(EFIAPI *EFI_AP_PROCEDURE)(
192 IN OUT VOID *Buffer
193 );
194
195/**
196 The function prototype for invoking a function on an Application Processor.
197
198 This definition is used by the UEFI MM MP Serices Protocol.
199
200 @param[in] ProcedureArgument The pointer to private data buffer.
201
202 @retval EFI_SUCCESS Excutive the procedure successfully
203
204**/
205typedef
206EFI_STATUS
207(EFIAPI *EFI_AP_PROCEDURE2)(
208 IN VOID *ProcedureArgument
209);
210
211#endif