2 This file declares EDKII Multi-processor service PPI.
4 Copyright (c) 2019, Intel Corporation. All rights reserved.<BR>
5 SPDX-License-Identifier: BSD-2-Clause-Patent
9 #ifndef __EDKII_PEI_MP_SERVICES2_PPI_H__
10 #define __EDKII_PEI_MP_SERVICES2_PPI_H__
12 #include <Ppi/MpServices.h>
14 #define EDKII_PEI_MP_SERVICES2_PPI_GUID \
16 0x5cb9cb3d, 0x31a4, 0x480c, { 0x94, 0x98, 0x29, 0xd2, 0x69, 0xba, 0xcf, 0xba} \
19 typedef struct _EDKII_PEI_MP_SERVICES2_PPI EDKII_PEI_MP_SERVICES2_PPI
;
22 Get the number of CPU's.
24 @param[in] This Pointer to this instance of the PPI.
25 @param[out] NumberOfProcessors Pointer to the total number of logical processors in
26 the system, including the BSP and disabled APs.
27 @param[out] NumberOfEnabledProcessors
28 Number of processors in the system that are enabled.
30 @retval EFI_SUCCESS The number of logical processors and enabled
31 logical processors was retrieved.
32 @retval EFI_DEVICE_ERROR The calling processor is an AP.
33 @retval EFI_INVALID_PARAMETER NumberOfProcessors is NULL.
34 NumberOfEnabledProcessors is NULL.
38 (EFIAPI
*EDKII_PEI_MP_SERVICES_GET_NUMBER_OF_PROCESSORS
) (
39 IN EDKII_PEI_MP_SERVICES2_PPI
*This
,
40 OUT UINTN
*NumberOfProcessors
,
41 OUT UINTN
*NumberOfEnabledProcessors
45 Get information on a specific CPU.
47 @param[in] This Pointer to this instance of the PPI.
48 @param[in] ProcessorNumber Pointer to the total number of logical processors in
49 the system, including the BSP and disabled APs.
50 @param[out] ProcessorInfoBuffer Number of processors in the system that are enabled.
52 @retval EFI_SUCCESS Processor information was returned.
53 @retval EFI_DEVICE_ERROR The calling processor is an AP.
54 @retval EFI_INVALID_PARAMETER ProcessorInfoBuffer is NULL.
55 @retval EFI_NOT_FOUND The processor with the handle specified by
56 ProcessorNumber does not exist in the platform.
60 (EFIAPI
*EDKII_PEI_MP_SERVICES_GET_PROCESSOR_INFO
) (
61 IN EDKII_PEI_MP_SERVICES2_PPI
*This
,
62 IN UINTN ProcessorNumber
,
63 OUT EFI_PROCESSOR_INFORMATION
*ProcessorInfoBuffer
67 Activate all of the application proessors.
69 @param[in] This A pointer to the EFI_PEI_MP_SERVICES_PPI instance.
70 @param[in] Procedure A pointer to the function to be run on enabled APs of
72 @param[in] SingleThread If TRUE, then all the enabled APs execute the function
73 specified by Procedure one by one, in ascending order
74 of processor handle number. If FALSE, then all the
75 enabled APs execute the function specified by Procedure
77 @param[in] TimeoutInMicroSeconds
78 Indicates the time limit in microseconds for APs to
79 return from Procedure, for blocking mode only. Zero
80 means infinity. If the timeout expires before all APs
81 return from Procedure, then Procedure on the failed APs
82 is terminated. All enabled APs are available for next
83 function assigned by EFI_PEI_MP_SERVICES_PPI.StartupAllAPs()
84 or EFI_PEI_MP_SERVICES_PPI.StartupThisAP(). If the
85 timeout expires in blocking mode, BSP returns
87 @param[in] ProcedureArgument The parameter passed into Procedure for all APs.
89 @retval EFI_SUCCESS In blocking mode, all APs have finished before the
91 @retval EFI_DEVICE_ERROR Caller processor is AP.
92 @retval EFI_NOT_STARTED No enabled APs exist in the system.
93 @retval EFI_NOT_READY Any enabled APs are busy.
94 @retval EFI_TIMEOUT In blocking mode, the timeout expired before all
95 enabled APs have finished.
96 @retval EFI_INVALID_PARAMETER Procedure is NULL.
100 (EFIAPI
*EDKII_PEI_MP_SERVICES_STARTUP_ALL_APS
) (
101 IN EDKII_PEI_MP_SERVICES2_PPI
*This
,
102 IN EFI_AP_PROCEDURE Procedure
,
103 IN BOOLEAN SingleThread
,
104 IN UINTN TimeoutInMicroSeconds
,
105 IN VOID
*ProcedureArgument OPTIONAL
109 Activate a specific application processor.
111 @param[in] This A pointer to the EFI_PEI_MP_SERVICES_PPI instance.
112 @param[in] Procedure A pointer to the function to be run on enabled APs of
114 @param[in] ProcessorNumber The handle number of the AP. The range is from 0 to the
115 total number of logical processors minus 1. The total
116 number of logical processors can be retrieved by
117 EFI_PEI_MP_SERVICES_PPI.GetNumberOfProcessors().
118 @param[in] TimeoutInMicroSeconds
119 Indicates the time limit in microseconds for APs to
120 return from Procedure, for blocking mode only. Zero
121 means infinity. If the timeout expires before all APs
122 return from Procedure, then Procedure on the failed APs
123 is terminated. All enabled APs are available for next
124 function assigned by EFI_PEI_MP_SERVICES_PPI.StartupAllAPs()
125 or EFI_PEI_MP_SERVICES_PPI.StartupThisAP(). If the
126 timeout expires in blocking mode, BSP returns
128 @param[in] ProcedureArgument The parameter passed into Procedure for all APs.
130 @retval EFI_SUCCESS In blocking mode, specified AP finished before the
132 @retval EFI_DEVICE_ERROR The calling processor is an AP.
133 @retval EFI_TIMEOUT In blocking mode, the timeout expired before the
134 specified AP has finished.
135 @retval EFI_NOT_FOUND The processor with the handle specified by
136 ProcessorNumber does not exist.
137 @retval EFI_INVALID_PARAMETER ProcessorNumber specifies the BSP or disabled AP.
138 @retval EFI_INVALID_PARAMETER Procedure is NULL.
142 (EFIAPI
*EDKII_PEI_MP_SERVICES_STARTUP_THIS_AP
) (
143 IN EDKII_PEI_MP_SERVICES2_PPI
*This
,
144 IN EFI_AP_PROCEDURE Procedure
,
145 IN UINTN ProcessorNumber
,
146 IN UINTN TimeoutInMicroseconds
,
147 IN VOID
*ProcedureArgument OPTIONAL
151 Switch the boot strap processor.
153 @param[in] This A pointer to the EFI_PEI_MP_SERVICES_PPI instance.
154 @param[in] ProcessorNumber The handle number of the AP. The range is from 0 to the
155 total number of logical processors minus 1. The total
156 number of logical processors can be retrieved by
157 EFI_PEI_MP_SERVICES_PPI.GetNumberOfProcessors().
158 @param[in] EnableOldBSP If TRUE, then the old BSP will be listed as an enabled
159 AP. Otherwise, it will be disabled.
161 @retval EFI_SUCCESS BSP successfully switched.
162 @retval EFI_UNSUPPORTED Switching the BSP cannot be completed prior to this
164 @retval EFI_UNSUPPORTED Switching the BSP is not supported.
165 @retval EFI_DEVICE_ERROR The calling processor is an AP.
166 @retval EFI_NOT_FOUND The processor with the handle specified by
167 ProcessorNumber does not exist.
168 @retval EFI_INVALID_PARAMETER ProcessorNumber specifies the current BSP or a disabled
170 @retval EFI_NOT_READY The specified AP is busy.
174 (EFIAPI
*EDKII_PEI_MP_SERVICES_SWITCH_BSP
) (
175 IN EDKII_PEI_MP_SERVICES2_PPI
*This
,
176 IN UINTN ProcessorNumber
,
177 IN BOOLEAN EnableOldBSP
181 Enable or disable an application processor.
183 @param[in] This A pointer to the EFI_PEI_MP_SERVICES_PPI instance.
184 @param[in] ProcessorNumber The handle number of the AP. The range is from 0 to the
185 total number of logical processors minus 1. The total
186 number of logical processors can be retrieved by
187 EFI_PEI_MP_SERVICES_PPI.GetNumberOfProcessors().
188 @param[in] EnableAP Specifies the new state for the processor for enabled,
190 @param[in] HealthFlag If not NULL, a pointer to a value that specifies the
191 new health status of the AP. This flag corresponds to
192 StatusFlag defined in EFI_PEI_MP_SERVICES_PPI.GetProcessorInfo().
193 Only the PROCESSOR_HEALTH_STATUS_BIT is used. All other
194 bits are ignored. If it is NULL, this parameter is
197 @retval EFI_SUCCESS The specified AP was enabled or disabled successfully.
198 @retval EFI_UNSUPPORTED Enabling or disabling an AP cannot be completed prior
199 to this service returning.
200 @retval EFI_UNSUPPORTED Enabling or disabling an AP is not supported.
201 @retval EFI_DEVICE_ERROR The calling processor is an AP.
202 @retval EFI_NOT_FOUND Processor with the handle specified by ProcessorNumber
204 @retval EFI_INVALID_PARAMETER ProcessorNumber specifies the BSP.
208 (EFIAPI
*EDKII_PEI_MP_SERVICES_ENABLEDISABLEAP
) (
209 IN EDKII_PEI_MP_SERVICES2_PPI
*This
,
210 IN UINTN ProcessorNumber
,
212 IN UINT32
*HealthFlag OPTIONAL
216 Identify the currently executing processor.
218 @param[in] This A pointer to the EFI_PEI_MP_SERVICES_PPI instance.
219 @param[out] ProcessorNumber The handle number of the AP. The range is from 0 to the
220 total number of logical processors minus 1. The total
221 number of logical processors can be retrieved by
222 EFI_PEI_MP_SERVICES_PPI.GetNumberOfProcessors().
224 @retval EFI_SUCCESS The current processor handle number was returned in
226 @retval EFI_INVALID_PARAMETER ProcessorNumber is NULL.
230 (EFIAPI
*EDKII_PEI_MP_SERVICES_WHOAMI
) (
231 IN EDKII_PEI_MP_SERVICES2_PPI
*This
,
232 OUT UINTN
*ProcessorNumber
237 Activate all of the application proessors.
239 @param[in] This A pointer to the EDKII_PEI_MP_SERVICES2_PPI instance.
240 @param[in] Procedure A pointer to the function to be run on enabled APs of
242 @param[in] TimeoutInMicroSeconds
243 Indicates the time limit in microseconds for APs to
244 return from Procedure, for blocking mode only. Zero
245 means infinity. If the timeout expires in blocking
246 mode, BSP returns EFI_TIMEOUT.
247 @param[in] ProcedureArgument The parameter passed into Procedure for all CPUs.
249 @retval EFI_SUCCESS In blocking mode, all APs have finished before the
251 @retval EFI_DEVICE_ERROR Caller processor is AP.
252 @retval EFI_NOT_READY Any enabled APs are busy.
253 @retval EFI_TIMEOUT In blocking mode, the timeout expired before all
254 enabled APs have finished.
255 @retval EFI_INVALID_PARAMETER Procedure is NULL.
259 (EFIAPI
*EDKII_PEI_MP_SERVICES_STARTUP_ALL_CPUS
) (
260 IN EDKII_PEI_MP_SERVICES2_PPI
*This
,
261 IN EFI_AP_PROCEDURE Procedure
,
262 IN UINTN TimeoutInMicroSeconds
,
263 IN VOID
*ProcedureArgument OPTIONAL
266 struct _EDKII_PEI_MP_SERVICES2_PPI
{
267 EDKII_PEI_MP_SERVICES_GET_NUMBER_OF_PROCESSORS GetNumberOfProcessors
;
268 EDKII_PEI_MP_SERVICES_GET_PROCESSOR_INFO GetProcessorInfo
;
269 EDKII_PEI_MP_SERVICES_STARTUP_ALL_APS StartupAllAPs
;
270 EDKII_PEI_MP_SERVICES_STARTUP_THIS_AP StartupThisAP
;
271 EDKII_PEI_MP_SERVICES_SWITCH_BSP SwitchBSP
;
272 EDKII_PEI_MP_SERVICES_ENABLEDISABLEAP EnableDisableAP
;
273 EDKII_PEI_MP_SERVICES_WHOAMI WhoAmI
;
274 EDKII_PEI_MP_SERVICES_STARTUP_ALL_CPUS StartupAllCPUs
;
277 extern EFI_GUID gEdkiiPeiMpServices2PpiGuid
;