]> git.proxmox.com Git - mirror_edk2.git/blame - UefiCpuPkg/Include/Ppi/MpServices2.h
ArmPkg: only attempt buildin MmCommunicationDxe for AArch64
[mirror_edk2.git] / UefiCpuPkg / Include / Ppi / MpServices2.h
CommitLineData
ebfbb701
ED
1/** @file\r
2 This file declares EDKII Multi-processor service PPI.\r
3\r
4 Copyright (c) 2019, Intel Corporation. All rights reserved.<BR>\r
5 SPDX-License-Identifier: BSD-2-Clause-Patent\r
6\r
7**/\r
8\r
9#ifndef __EDKII_PEI_MP_SERVICES2_PPI_H__\r
10#define __EDKII_PEI_MP_SERVICES2_PPI_H__\r
11\r
12#include <Ppi/MpServices.h>\r
13\r
14#define EDKII_PEI_MP_SERVICES2_PPI_GUID \\r
15 { \\r
16 0x5cb9cb3d, 0x31a4, 0x480c, { 0x94, 0x98, 0x29, 0xd2, 0x69, 0xba, 0xcf, 0xba} \\r
17 }\r
18\r
19typedef struct _EDKII_PEI_MP_SERVICES2_PPI EDKII_PEI_MP_SERVICES2_PPI;\r
20\r
21/**\r
22 Get the number of CPU's.\r
23\r
24 @param[in] This Pointer to this instance of the PPI.\r
25 @param[out] NumberOfProcessors Pointer to the total number of logical processors in\r
26 the system, including the BSP and disabled APs.\r
27 @param[out] NumberOfEnabledProcessors\r
28 Number of processors in the system that are enabled.\r
29\r
30 @retval EFI_SUCCESS The number of logical processors and enabled\r
31 logical processors was retrieved.\r
32 @retval EFI_DEVICE_ERROR The calling processor is an AP.\r
33 @retval EFI_INVALID_PARAMETER NumberOfProcessors is NULL.\r
34 NumberOfEnabledProcessors is NULL.\r
35**/\r
36typedef\r
37EFI_STATUS\r
38(EFIAPI *EDKII_PEI_MP_SERVICES_GET_NUMBER_OF_PROCESSORS) (\r
39 IN EDKII_PEI_MP_SERVICES2_PPI *This,\r
40 OUT UINTN *NumberOfProcessors,\r
41 OUT UINTN *NumberOfEnabledProcessors\r
42 );\r
43\r
44/**\r
45 Get information on a specific CPU.\r
46\r
47 @param[in] This Pointer to this instance of the PPI.\r
48 @param[in] ProcessorNumber Pointer to the total number of logical processors in\r
49 the system, including the BSP and disabled APs.\r
50 @param[out] ProcessorInfoBuffer Number of processors in the system that are enabled.\r
51\r
52 @retval EFI_SUCCESS Processor information was returned.\r
53 @retval EFI_DEVICE_ERROR The calling processor is an AP.\r
54 @retval EFI_INVALID_PARAMETER ProcessorInfoBuffer is NULL.\r
55 @retval EFI_NOT_FOUND The processor with the handle specified by\r
56 ProcessorNumber does not exist in the platform.\r
57**/\r
58typedef\r
59EFI_STATUS\r
60(EFIAPI *EDKII_PEI_MP_SERVICES_GET_PROCESSOR_INFO) (\r
61 IN EDKII_PEI_MP_SERVICES2_PPI *This,\r
62 IN UINTN ProcessorNumber,\r
63 OUT EFI_PROCESSOR_INFORMATION *ProcessorInfoBuffer\r
64 );\r
65\r
66/**\r
67 Activate all of the application proessors.\r
68\r
69 @param[in] This A pointer to the EFI_PEI_MP_SERVICES_PPI instance.\r
70 @param[in] Procedure A pointer to the function to be run on enabled APs of\r
71 the system.\r
72 @param[in] SingleThread If TRUE, then all the enabled APs execute the function\r
73 specified by Procedure one by one, in ascending order\r
74 of processor handle number. If FALSE, then all the\r
75 enabled APs execute the function specified by Procedure\r
76 simultaneously.\r
77 @param[in] TimeoutInMicroSeconds\r
78 Indicates the time limit in microseconds for APs to\r
79 return from Procedure, for blocking mode only. Zero\r
80 means infinity. If the timeout expires before all APs\r
81 return from Procedure, then Procedure on the failed APs\r
82 is terminated. All enabled APs are available for next\r
83 function assigned by EFI_PEI_MP_SERVICES_PPI.StartupAllAPs()\r
84 or EFI_PEI_MP_SERVICES_PPI.StartupThisAP(). If the\r
85 timeout expires in blocking mode, BSP returns\r
86 EFI_TIMEOUT.\r
87 @param[in] ProcedureArgument The parameter passed into Procedure for all APs.\r
88\r
89 @retval EFI_SUCCESS In blocking mode, all APs have finished before the\r
90 timeout expired.\r
91 @retval EFI_DEVICE_ERROR Caller processor is AP.\r
92 @retval EFI_NOT_STARTED No enabled APs exist in the system.\r
93 @retval EFI_NOT_READY Any enabled APs are busy.\r
94 @retval EFI_TIMEOUT In blocking mode, the timeout expired before all\r
95 enabled APs have finished.\r
96 @retval EFI_INVALID_PARAMETER Procedure is NULL.\r
97**/\r
98typedef\r
99EFI_STATUS\r
100(EFIAPI *EDKII_PEI_MP_SERVICES_STARTUP_ALL_APS) (\r
101 IN EDKII_PEI_MP_SERVICES2_PPI *This,\r
102 IN EFI_AP_PROCEDURE Procedure,\r
103 IN BOOLEAN SingleThread,\r
104 IN UINTN TimeoutInMicroSeconds,\r
105 IN VOID *ProcedureArgument OPTIONAL\r
106 );\r
107\r
108/**\r
109 Activate a specific application processor.\r
110\r
111 @param[in] This A pointer to the EFI_PEI_MP_SERVICES_PPI instance.\r
112 @param[in] Procedure A pointer to the function to be run on enabled APs of\r
113 the system.\r
114 @param[in] ProcessorNumber The handle number of the AP. The range is from 0 to the\r
115 total number of logical processors minus 1. The total\r
116 number of logical processors can be retrieved by\r
117 EFI_PEI_MP_SERVICES_PPI.GetNumberOfProcessors().\r
118 @param[in] TimeoutInMicroSeconds\r
119 Indicates the time limit in microseconds for APs to\r
120 return from Procedure, for blocking mode only. Zero\r
121 means infinity. If the timeout expires before all APs\r
122 return from Procedure, then Procedure on the failed APs\r
123 is terminated. All enabled APs are available for next\r
124 function assigned by EFI_PEI_MP_SERVICES_PPI.StartupAllAPs()\r
125 or EFI_PEI_MP_SERVICES_PPI.StartupThisAP(). If the\r
126 timeout expires in blocking mode, BSP returns\r
127 EFI_TIMEOUT.\r
128 @param[in] ProcedureArgument The parameter passed into Procedure for all APs.\r
129\r
130 @retval EFI_SUCCESS In blocking mode, specified AP finished before the\r
131 timeout expires.\r
132 @retval EFI_DEVICE_ERROR The calling processor is an AP.\r
133 @retval EFI_TIMEOUT In blocking mode, the timeout expired before the\r
134 specified AP has finished.\r
135 @retval EFI_NOT_FOUND The processor with the handle specified by\r
136 ProcessorNumber does not exist.\r
137 @retval EFI_INVALID_PARAMETER ProcessorNumber specifies the BSP or disabled AP.\r
138 @retval EFI_INVALID_PARAMETER Procedure is NULL.\r
139**/\r
140typedef\r
141EFI_STATUS\r
142(EFIAPI *EDKII_PEI_MP_SERVICES_STARTUP_THIS_AP) (\r
143 IN EDKII_PEI_MP_SERVICES2_PPI *This,\r
144 IN EFI_AP_PROCEDURE Procedure,\r
145 IN UINTN ProcessorNumber,\r
146 IN UINTN TimeoutInMicroseconds,\r
147 IN VOID *ProcedureArgument OPTIONAL\r
148 );\r
149\r
150/**\r
151 Switch the boot strap processor.\r
152\r
153 @param[in] This A pointer to the EFI_PEI_MP_SERVICES_PPI instance.\r
154 @param[in] ProcessorNumber The handle number of the AP. The range is from 0 to the\r
155 total number of logical processors minus 1. The total\r
156 number of logical processors can be retrieved by\r
157 EFI_PEI_MP_SERVICES_PPI.GetNumberOfProcessors().\r
158 @param[in] EnableOldBSP If TRUE, then the old BSP will be listed as an enabled\r
159 AP. Otherwise, it will be disabled.\r
160\r
161 @retval EFI_SUCCESS BSP successfully switched.\r
162 @retval EFI_UNSUPPORTED Switching the BSP cannot be completed prior to this\r
163 service returning.\r
164 @retval EFI_UNSUPPORTED Switching the BSP is not supported.\r
165 @retval EFI_DEVICE_ERROR The calling processor is an AP.\r
166 @retval EFI_NOT_FOUND The processor with the handle specified by\r
167 ProcessorNumber does not exist.\r
168 @retval EFI_INVALID_PARAMETER ProcessorNumber specifies the current BSP or a disabled\r
169 AP.\r
170 @retval EFI_NOT_READY The specified AP is busy.\r
171**/\r
172typedef\r
173EFI_STATUS\r
174(EFIAPI *EDKII_PEI_MP_SERVICES_SWITCH_BSP) (\r
175 IN EDKII_PEI_MP_SERVICES2_PPI *This,\r
176 IN UINTN ProcessorNumber,\r
177 IN BOOLEAN EnableOldBSP\r
178 );\r
179\r
180/**\r
181 Enable or disable an application processor.\r
182\r
183 @param[in] This A pointer to the EFI_PEI_MP_SERVICES_PPI instance.\r
184 @param[in] ProcessorNumber The handle number of the AP. The range is from 0 to the\r
185 total number of logical processors minus 1. The total\r
186 number of logical processors can be retrieved by\r
187 EFI_PEI_MP_SERVICES_PPI.GetNumberOfProcessors().\r
188 @param[in] EnableAP Specifies the new state for the processor for enabled,\r
189 FALSE for disabled.\r
190 @param[in] HealthFlag If not NULL, a pointer to a value that specifies the\r
191 new health status of the AP. This flag corresponds to\r
192 StatusFlag defined in EFI_PEI_MP_SERVICES_PPI.GetProcessorInfo().\r
193 Only the PROCESSOR_HEALTH_STATUS_BIT is used. All other\r
194 bits are ignored. If it is NULL, this parameter is\r
195 ignored.\r
196\r
197 @retval EFI_SUCCESS The specified AP was enabled or disabled successfully.\r
198 @retval EFI_UNSUPPORTED Enabling or disabling an AP cannot be completed prior\r
199 to this service returning.\r
200 @retval EFI_UNSUPPORTED Enabling or disabling an AP is not supported.\r
201 @retval EFI_DEVICE_ERROR The calling processor is an AP.\r
202 @retval EFI_NOT_FOUND Processor with the handle specified by ProcessorNumber\r
203 does not exist.\r
204 @retval EFI_INVALID_PARAMETER ProcessorNumber specifies the BSP.\r
205**/\r
206typedef\r
207EFI_STATUS\r
208(EFIAPI *EDKII_PEI_MP_SERVICES_ENABLEDISABLEAP) (\r
209 IN EDKII_PEI_MP_SERVICES2_PPI *This,\r
210 IN UINTN ProcessorNumber,\r
211 IN BOOLEAN EnableAP,\r
212 IN UINT32 *HealthFlag OPTIONAL\r
213 );\r
214\r
215/**\r
216 Identify the currently executing processor.\r
217\r
218 @param[in] This A pointer to the EFI_PEI_MP_SERVICES_PPI instance.\r
219 @param[out] ProcessorNumber The handle number of the AP. The range is from 0 to the\r
220 total number of logical processors minus 1. The total\r
221 number of logical processors can be retrieved by\r
222 EFI_PEI_MP_SERVICES_PPI.GetNumberOfProcessors().\r
223\r
224 @retval EFI_SUCCESS The current processor handle number was returned in\r
225 ProcessorNumber.\r
226 @retval EFI_INVALID_PARAMETER ProcessorNumber is NULL.\r
227**/\r
228typedef\r
229EFI_STATUS\r
230(EFIAPI *EDKII_PEI_MP_SERVICES_WHOAMI) (\r
231 IN EDKII_PEI_MP_SERVICES2_PPI *This,\r
232 OUT UINTN *ProcessorNumber\r
233 );\r
234\r
235\r
236/**\r
237 Activate all of the application proessors.\r
238\r
239 @param[in] This A pointer to the EDKII_PEI_MP_SERVICES2_PPI instance.\r
240 @param[in] Procedure A pointer to the function to be run on enabled APs of\r
241 the system.\r
242 @param[in] TimeoutInMicroSeconds\r
243 Indicates the time limit in microseconds for APs to\r
244 return from Procedure, for blocking mode only. Zero\r
245 means infinity. If the timeout expires in blocking\r
246 mode, BSP returns EFI_TIMEOUT.\r
247 @param[in] ProcedureArgument The parameter passed into Procedure for all CPUs.\r
248\r
249 @retval EFI_SUCCESS In blocking mode, all APs have finished before the\r
250 timeout expired.\r
251 @retval EFI_DEVICE_ERROR Caller processor is AP.\r
252 @retval EFI_NOT_READY Any enabled APs are busy.\r
253 @retval EFI_TIMEOUT In blocking mode, the timeout expired before all\r
254 enabled APs have finished.\r
255 @retval EFI_INVALID_PARAMETER Procedure is NULL.\r
256**/\r
257typedef\r
258EFI_STATUS\r
259(EFIAPI *EDKII_PEI_MP_SERVICES_STARTUP_ALL_CPUS) (\r
260 IN EDKII_PEI_MP_SERVICES2_PPI *This,\r
261 IN EFI_AP_PROCEDURE Procedure,\r
262 IN UINTN TimeoutInMicroSeconds,\r
263 IN VOID *ProcedureArgument OPTIONAL\r
264 );\r
265\r
266struct _EDKII_PEI_MP_SERVICES2_PPI {\r
267 EDKII_PEI_MP_SERVICES_GET_NUMBER_OF_PROCESSORS GetNumberOfProcessors;\r
268 EDKII_PEI_MP_SERVICES_GET_PROCESSOR_INFO GetProcessorInfo;\r
269 EDKII_PEI_MP_SERVICES_STARTUP_ALL_APS StartupAllAPs;\r
270 EDKII_PEI_MP_SERVICES_STARTUP_THIS_AP StartupThisAP;\r
271 EDKII_PEI_MP_SERVICES_SWITCH_BSP SwitchBSP;\r
272 EDKII_PEI_MP_SERVICES_ENABLEDISABLEAP EnableDisableAP;\r
273 EDKII_PEI_MP_SERVICES_WHOAMI WhoAmI;\r
274 EDKII_PEI_MP_SERVICES_STARTUP_ALL_CPUS StartupAllCPUs;\r
275};\r
276\r
277extern EFI_GUID gEdkiiPeiMpServices2PpiGuid;\r
278\r
279#endif\r