]> git.proxmox.com Git - mirror_edk2.git/blame - IntelFrameworkPkg/Include/Protocol/FrameworkMpService.h
clean up non-English characters.
[mirror_edk2.git] / IntelFrameworkPkg / Include / Protocol / FrameworkMpService.h
CommitLineData
b6d47a83 1/** @file\r
2 When installed, the Framework MP Services Protocol produces a collection of \r
3 services that are needed for MP management, such as initialization and management \r
4 of application processors. \r
5 \r
6 @par Note: \r
7 This protocol has been deprecated and has been replaced by the MP Services \r
8 Protocol from the UEFI Platform Initialization Specification 1.2, Volume 2:\r
9 Driver Execution Environment Core Interface.\r
10\r
11 The MP Services Protocol provides a generalized way of performing following tasks:\r
12 - Retrieving information of multi-processor environment and MP-related status of\r
13 specific processors.\r
14 - Dispatching user-provided function to APs.\r
15 - Maintain MP-related processor status.\r
16\r
17 The MP Services Protocol must be produced on any system with more than one logical\r
18 processor.\r
19\r
20 The Protocol is available only during boot time.\r
21\r
22 MP Services Protocol is hardware-independent. Most of the logic of this protocol\r
23 is architecturally neutral. It abstracts the multi-processor environment and \r
24 status of processors, and provides interfaces to retrieve information, maintain, \r
25 and dispatch.\r
26\r
27 MP Services Protocol may be consumed by ACPI module. The ACPI module may use this \r
28 protocol to retrieve data that are needed for an MP platform and report them to OS.\r
29 MP Services Protocol may also be used to program and configure processors, such \r
30 as MTRR synchronization for memory space attributes setting in DXE Services.\r
31 MP Services Protocol may be used by non-CPU DXE drivers to speed up platform boot \r
32 by taking advantage of the processing capabilities of the APs, for example, using \r
33 APs to help test system memory in parallel with other device initialization.\r
34 Diagnostics applications may also use this protocol for multi-processor.\r
35\r
36 Copyright (c) 1999 - 2002, 2009, Intel Corporation.<BR>\r
37 All rights reserved. This program and the accompanying materials\r
38 are licensed and made available under the terms and conditions of the BSD License\r
39 which accompanies this distribution. The full text of the license may be found at<BR>\r
40 http://opensource.org/licenses/bsd-license.php\r
41\r
42 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
43 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
44\r
45--*/\r
46\r
47#ifndef _FRAMEWORK_MP_SERVICE_PROTOCOL_H_\r
48#define _FRAMEWORK_MP_SERVICE_PROTOCOL_H_\r
49\r
50///\r
51/// Global ID for the FRAMEWORK_EFI_MP_SERVICES_PROTOCOL\r
52///\r
53#define FRAMEWORK_EFI_MP_SERVICES_PROTOCOL_GUID \\r
54 { \\r
55 0xf33261e7, 0x23cb, 0x11d5, {0xbd, 0x5c, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81} \\r
56 }\r
57\r
58///\r
59/// Forward declaration for the EFI_MP_SERVICES_PROTOCOL\r
60///\r
61typedef struct _FRAMEWORK_EFI_MP_SERVICES_PROTOCOL FRAMEWORK_EFI_MP_SERVICES_PROTOCOL;\r
62\r
63///\r
64/// Fixed delivery mode that may be used as the DeliveryMode parameter in SendIpi() \r
65///\r
66#define DELIVERY_MODE_FIXED 0x0\r
67\r
68///\r
69/// Lowest priority delivery mode that may be used as the DeliveryMode parameter in SendIpi() \r
70///\r
71#define DELIVERY_MODE_LOWEST_PRIORITY 0x1\r
72\r
73///\r
74/// SMI delivery mode that may be used as the DeliveryMode parameter in SendIpi() \r
75///\r
76#define DELIVERY_MODE_SMI 0x2\r
77\r
78///\r
79/// Remote read delivery mode that may be used as the DeliveryMode parameter in SendIpi() \r
80///\r
81#define DELIVERY_MODE_REMOTE_READ 0x3\r
82\r
83///\r
84/// NMI delivery mode that may be used as the DeliveryMode parameter in SendIpi() \r
85///\r
86#define DELIVERY_MODE_NMI 0x4\r
87\r
88///\r
89/// INIT delivery mode that may be used as the DeliveryMode parameter in SendIpi() \r
90///\r
91#define DELIVERY_MODE_INIT 0x5\r
92\r
93///\r
94/// Startup IPI delivery mode that may be used as the DeliveryMode parameter in SendIpi() \r
95///\r
96#define DELIVERY_MODE_SIPI 0x6\r
97\r
98///\r
99/// The DeliveryMode parameter in SendIpi() bust be less than this maximum value\r
100///\r
101#define DELIVERY_MODE_MAX 0x7\r
102\r
103///\r
104/// IPF specific value for the state field of the Self Test State Parameter\r
105///\r
106#define EFI_MP_HEALTH_FLAGS_STATUS_HEALTHY 0x0\r
107\r
108///\r
109/// IPF specific value for the state field of the Self Test State Parameter\r
110///\r
111#define EFI_MP_HEALTH_FLAGS_STATUS_PERFORMANCE_RESTRICTED 0x1\r
112\r
113///\r
114/// IPF specific value for the state field of the Self Test State Parameter\r
115///\r
116#define EFI_MP_HEALTH_FLAGS_STATUS_FUNCTIONALLY_RESTRICTED 0x2\r
117\r
118typedef union {\r
119 ///\r
120 /// Bitfield structure for the IPF Self Test State Parameter \r
121 ///\r
122 struct {\r
123 UINT32 Status:2;\r
124 UINT32 Tested:1;\r
125 UINT32 Reserved1:13;\r
126 UINT32 VirtualMemoryUnavailable:1;\r
127 UINT32 Ia32ExecutionUnavailable:1;\r
128 UINT32 FloatingPointUnavailable:1;\r
129 UINT32 MiscFeaturesUnavailable:1;\r
130 UINT32 Reserved2:12;\r
131 } Bits;\r
132 ///\r
133 /// IA32 and X64 BIST data of the processor\r
134 ///\r
135 UINT32 Uint32;\r
136} EFI_MP_HEALTH_FLAGS;\r
137\r
138typedef struct {\r
139 ///\r
140 /// @par IA32, X64:\r
141 /// BIST (built-in self test) data of the processor.\r
142 ///\r
143 /// @par IPF:\r
144 /// Lower 32 bits of self test state parameter. For definition of self test \r
145 /// state parameter, please refer to Intel(R) Itanium(R) Architecture Software \r
1910fbaf 146 /// Developer's Manual, Volume 2: System Architecture.\r
b6d47a83 147 ///\r
148 EFI_MP_HEALTH_FLAGS Flags;\r
149 ///\r
150 /// @par IA32, X64:\r
151 /// Not used.\r
152 ///\r
153 /// @par IPF:\r
154 /// Higher 32 bits of self test state parameter.\r
155 ///\r
156 UINT32 TestStatus;\r
157} EFI_MP_HEALTH;\r
158\r
159typedef enum {\r
160 EfiCpuAP = 0, ///< The CPU is an AP (Application Processor)\r
161 EfiCpuBSP, ///< The CPU is the BSP (Boot-Strap Processor)\r
162 EfiCpuDesignationMaximum\r
163} EFI_CPU_DESIGNATION;\r
164\r
165typedef struct {\r
166 ///\r
167 /// @par IA32, X64:\r
168 /// The lower 8 bits contains local APIC ID, and higher bits are reserved.\r
169 ///\r
170 /// @par IPF:\r
171 /// The lower 16 bits contains id/eid as physical address of local SAPIC \r
172 /// unit, and higher bits are reserved.\r
173 ///\r
174 UINT32 ApicID;\r
175 ///\r
176 /// This field indicates whether the processor is enabled. If the value is \r
177 /// TRUE, then the processor is enabled. Otherwise, it is disabled.\r
178 ///\r
179 BOOLEAN Enabled;\r
180 ///\r
181 /// This field indicates whether the processor is playing the role of BSP.\r
182 /// If the value is EfiCpuAP, then the processor is AP. If the value is \r
183 /// EfiCpuBSP, then the processor is BSP.\r
184 ///\r
185 EFI_CPU_DESIGNATION Designation;\r
186 ///\r
187 /// @par IA32, X64:\r
188 /// The Flags field of this EFI_MP_HEALTH data structure holds BIST (built-in \r
189 /// self test) data of the processor. The TestStatus field is not used, and \r
190 /// the value is always zero.\r
191 ///\r
192 /// @par IPF:\r
193 /// Bit format of this field is the same as the definition of self-test state \r
689b2d72 194 /// parameter, in Intel?Itanium?Architecture Software Developer's Manual, \r
b6d47a83 195 /// Volume 2: System Architecture.\r
196 ///\r
197 EFI_MP_HEALTH Health;\r
198 ///\r
199 /// Zero-based physical package number that identifies the cartridge of the \r
200 /// processor.\r
201 ///\r
202 UINTN PackageNumber;\r
203 ///\r
204 /// Zero-based physical core number within package of the processor.\r
205 ///\r
206 UINTN NumberOfCores;\r
207 ///\r
208 /// Zero-based logical thread number within core of the processor.\r
209 ///\r
210 UINTN NumberOfThreads;\r
211 ///\r
212 /// This field is reserved.\r
213 ///\r
214 UINT64 ProcessorPALCompatibilityFlags;\r
215 ///\r
216 /// @par IA32, X64:\r
217 /// This field is not used, and the value is always zero.\r
218 ///\r
219 /// @par IPF:\r
220 /// This field is a mask number that is handed off by the PAL about which \r
221 /// processor tests are performed and which are masked.\r
222 ///\r
223 UINT64 ProcessorTestMask;\r
224} EFI_MP_PROC_CONTEXT;\r
225\r
226/**\r
227 This service retrieves general information of multiprocessors in the system.\r
228\r
229 This function is used to get the following information:\r
230 - Number of logical processors in system\r
231 - Maximal number of logical processors supported by system\r
232 - Number of enabled logical processors.\r
233 - Rendezvous interrupt number (IPF-specific)\r
234 - Length of the rendezvous procedure.\r
235\r
236 @param[in] This Pointer to the FRAMEWORK_EFI_MP_SERVICES_PROTOCOL\r
237 instance.\r
238 @param[out] NumberOfCPUs Pointer to the total number of logical processors \r
239 in the system, including the BSP and disabled \r
240 APs. If NULL, this parameter is ignored.\r
241 @param[out] MaximumNumberOfCPUs Pointer to the maximum number of processors \r
242 supported by the system. If NULL, this \r
243 parameter is ignored.\r
244 @param[out] NumberOfEnabledCPUs Pointer to the number of enabled logical \r
245 processors that exist in system, including \r
246 the BSP. If NULL, this parameter is ignored.\r
247 @param[out] RendezvousIntNumber This parameter is only meaningful for IPF.\r
248 - IA32, X64: The returned value is zero. \r
249 If NULL, this parameter is ignored.\r
250 - IPF: Pointer to the rendezvous interrupt \r
251 number that is used for AP wake-up.\r
252 @param[out] RendezvousProcLength Pointer to the length of rendezvous procedure. \r
253 - IA32, X64: The returned value is 0x1000. \r
254 If NULL, this parameter is ignored.\r
255 - IPF: The returned value is zero.\r
256\r
257 @retval EFI_SUCCESS Multiprocessor general information successfully retrieved.\r
258\r
259**/\r
260typedef\r
261EFI_STATUS\r
108854b2 262(EFIAPI *EFI_MP_SERVICES_GET_GENERAL_MP_INFO)(\r
b6d47a83 263 IN FRAMEWORK_EFI_MP_SERVICES_PROTOCOL *This,\r
264 OUT UINTN *NumberOfCPUs OPTIONAL,\r
265 OUT UINTN *MaximumNumberOfCPUs OPTIONAL,\r
266 OUT UINTN *NumberOfEnabledCPUs OPTIONAL,\r
267 OUT UINTN *RendezvousIntNumber OPTIONAL,\r
268 OUT UINTN *RendezvousProcLength OPTIONAL\r
269 );\r
270\r
271/**\r
272 This service gets detailed MP-related information of the requested processor.\r
273\r
274 This service gets detailed MP-related information of the requested processor \r
275 at the instant this call is made. Note the following:\r
276 - The processor information may change during the course of a boot session. \r
277 - The data of information presented here is entirely MP related. \r
278 Information regarding the number of caches and their sizes, frequency of operation,\r
279 slot numbers is all considered platform-related information and will not be \r
280 presented here. \r
281\r
282 @param[in] This Pointer to the FRAMEWORK_EFI_MP_SERVICES_PROTOCOL\r
283 instance.\r
284 @param[in] ProcessorNumber The handle number of the processor. The range\r
285 is from 0 to the total number of logical \r
286 processors minus 1. The total number of \r
287 logical processors can be retrieved by \r
288 GetGeneralMPInfo().\r
289 @param[in,out] BufferLength On input, pointer to the size in bytes of \r
290 ProcessorContextBuffer. On output, if the \r
291 size of ProcessorContextBuffer is not large \r
292 enough, the value pointed by this parameter \r
293 is updated to size in bytes that is needed. \r
294 If the size of ProcessorContextBuffer is \r
295 sufficient, the value is not changed from \r
296 input.\r
297 @param[out] ProcessorContextBuffer Pointer to the buffer where the data of \r
298 requested processor will be deposited. \r
299 The buffer is allocated by caller. \r
300\r
301 @retval EFI_SUCCESS Processor information successfully returned.\r
302 @retval EFI_BUFFER_TOO_SMALL The size of ProcessorContextBuffer is too small. \r
303 Value pointed by BufferLength has been updated \r
304 to size in bytes that is needed.\r
305 @retval EFI_INVALID_PARAMETER IA32, X64:BufferLength is NULL.\r
306 @retval EFI_INVALID_PARAMETER IA32, X64:ProcessorContextBuffer is NULL.\r
307 @retval EFI_INVALID_PARAMETER IA32, X64:Processor with the handle specified by \r
308 ProcessorNumber does not exist\r
309 @retval EFI_NOT_FOUND IPF: Processor with the handle specified by \r
310 ProcessorNumber does not exist\r
311\r
312**/\r
313typedef\r
314EFI_STATUS\r
108854b2 315(EFIAPI *EFI_MP_SERVICES_GET_PROCESSOR_CONTEXT)(\r
b6d47a83 316 IN FRAMEWORK_EFI_MP_SERVICES_PROTOCOL *This,\r
317 IN UINTN ProcessorNumber,\r
318 IN OUT UINTN *BufferLength,\r
319 OUT EFI_MP_PROC_CONTEXT *ProcessorContextBuffer\r
320 );\r
321\r
322/**\r
323 This function is used to dispatch all enabled APs to the function specified \r
324 by Procedure. APs can run either simultaneously or one by one. The caller can \r
325 also configure the BSP to either wait for APs or just proceed with the next \r
326 task. It is the responsibility of the caller of the StartupAllAPs() to make \r
327 sure that the nature of the code that will be run on the BSP and the dispatched \r
328 APs is well controlled. The MP Services Protocol does not guarantee that the \r
329 function that either processor is executing is MP-safe. Hence, the tasks that \r
330 can be run in parallel are limited to certain independent tasks and well-\r
331 controlled exclusive code. EFI services and protocols may not be called by APs \r
332 unless otherwise specified.\r
333\r
334 @param[in] This Pointer to the FRAMEWORK_EFI_MP_SERVICES_PROTOCOL\r
335 instance.\r
336 @param[in] Procedure A pointer to the function to be run on enabled \r
337 APs of the system. \r
338 @param[in] SingleThread Flag that requests APs to execute one at a \r
339 time or simultaneously.\r
340 - IA32, X64:\r
341 If TRUE, then all the enabled APs execute \r
342 the function specified by Procedure one by \r
343 one, in ascending order of processor handle \r
344 number. If FALSE, then all the enabled APs \r
345 execute the function specified by Procedure \r
346 simultaneously.\r
347 - IPF:\r
348 If TRUE, then all the enabled APs execute \r
349 the function specified by Procedure simultaneously.\r
350 If FALSE, then all the enabled APs execute the \r
351 function specified by Procedure one by one, in \r
352 ascending order of processor handle number. The \r
353 time interval of AP dispatching is determined \r
354 by WaitEvent and TimeoutInMicrosecs.\r
355 @param[in] WaitEvent Event to signal when APs have finished.\r
356 - IA32, X64:\r
357 If not NULL, when all APs finish after timeout \r
358 expires, the event will be signaled. If NULL, \r
359 the parameter is ignored.\r
360 - IPF:\r
361 If SingleThread is TRUE, this parameter \r
362 is ignored. If SingleThread is FALSE (i.e. \r
363 dispatch APs one by one), this parameter \r
364 determines whether the BSP waits after each \r
365 AP is dispatched. If it is NULL, the BSP \r
366 does not wait after each AP is dispatched. \r
367 If it is not NULL, the BSP waits after each \r
368 AP is dispatched, and the time interval is \r
369 determined by TimeoutInMicrosecs. Type \r
370 EFI_EVENT is defined in CreateEvent() in \r
371 the Unified Extensible Firmware Interface \r
372 Specification.\r
373 @param[in] TimeoutInMicrosecsond Time to wait for APs to finish.\r
374 - IA32, X64:\r
375 If the value is zero, it means no timeout \r
376 limit. The BSP waits until all APs finish. \r
377 If the value is not zero, the BSP waits \r
378 until all APs finish or timeout expires. \r
379 If timeout expires, EFI_TIMEOUT is returned,\r
108854b2 380 and the BSP will then check APs?status \r
b6d47a83 381 periodically, with time interval of 16 \r
382 microseconds.\r
383 - IPF:\r
384 If SingleThread is TRUE and FailedCPUList \r
385 is NULL, this parameter is ignored. If \r
386 SingleThread is TRUE and FailedCPUList is \r
387 not NULL, this parameter determines whether \r
388 the BSP waits until all APs finish their \r
389 procedure. If it is zero, the BSP does not \r
390 wait for APs. If it is non-zero, it waits \r
391 until all APs finish. If SingleThread is \r
392 FALSE and WaitEvent is NULL, this parameter \r
393 is ignored. If SingleThread is FALSE and \r
394 WaitEvent is not NULL, the BSP waits after \r
395 each AP is dispatched and this value \r
396 determines time interval. If the value is \r
397 zero, the length of time interval is 10ms. \r
398 If the value is non-zero, the BSP waits \r
399 until dispatched AP finishes and then \r
400 dispatch the next.\r
401 @param[in] ProcedureArgument Pointer to the optional parameter of the \r
402 function specified by Procedure.\r
403 @param[out] FailedCPUList List of APs that did not finish.\r
404 - IA32, X64:\r
405 If not NULL, it records handle numbers of \r
406 all logical processors that fail to accept \r
407 caller-provided function (busy or disabled).\r
408 If NULL, this parameter is ignored.\r
409 - IPF:\r
410 If not NULL, it records status of all \r
411 logical processors, with processor handle \r
412 number as index. If a logical processor \r
413 fails to accept caller-provided function \r
414 because it is busy, the status is EFI_NOT_READY. \r
415 If it fails to accept function due to other \r
416 reasons, the status is EFI_NOT_AVAILABLE_YET. \r
417 If timeout expires, the status is EFI_TIMEOUT.\r
418 Otherwise, the value is EFI_SUCCESS. If NULL, \r
419 this parameter is ignored.\r
420\r
421 @retval EFI_SUCCESS IA32, X64: All dispatched APs have finished \r
422 before the timeout expires.\r
423 @retval EFI_SUCCESS IA32, X64: Only 1 logical processor exists \r
424 in system.\r
425 @retval EFI_INVALID_PARAMETER IA32, X64: Procedure is NULL.\r
426 @retval EFI_TIMEOUT IA32, X64: The timeout expires before all \r
427 dispatched APs have finished.\r
428 @retval EFI_SUCCESS IPF: This function always returns EFI_SUCCESS.\r
429\r
430**/\r
431typedef\r
432EFI_STATUS\r
433(EFIAPI *FRAMEWORK_EFI_MP_SERVICES_STARTUP_ALL_APS)(\r
434 IN FRAMEWORK_EFI_MP_SERVICES_PROTOCOL *This,\r
435 IN FRAMEWORK_EFI_AP_PROCEDURE Procedure,\r
436 IN BOOLEAN SingleThread,\r
437 IN EFI_EVENT WaitEvent OPTIONAL,\r
438 IN UINTN TimeoutInMicroSecs, \r
439 IN VOID *ProcArguments OPTIONAL,\r
440 OUT UINTN *FailedCPUList OPTIONAL\r
441 );\r
442\r
443/**\r
444 This function is used to dispatch one enabled AP to the function provided by \r
445 the caller. The caller can request the BSP to either wait for the AP or just \r
446 proceed with the next task.\r
447\r
448 @param[in] This Pointer to the FRAMEWORK_EFI_MP_SERVICES_PROTOCOL\r
449 instance.\r
450 @param[in] Procedure A pointer to the function to be run on the \r
451 designated AP. \r
452 @param[in] ProcessorNumber The handle number of AP. The range is from \r
453 0 to the total number of logical processors \r
454 minus 1. The total number of logical \r
455 processors can be retrieved by GetGeneralMPInfo().\r
456 @param[in] WaitEvent Event to signal when APs have finished.\r
457 - IA32, X64:\r
458 If not NULL, when the AP finishes after timeout \r
459 expires, the event will be signaled. If NULL, \r
460 the parameter is ignored.\r
461 - IPF:\r
462 This parameter determines whether the BSP \r
463 waits after the AP is dispatched. If it is \r
464 NULL, the BSP does not wait after the AP \r
465 is dispatched. If it is not NULL, the BSP \r
466 waits after the AP is dispatched, and the \r
467 time interval is determined by TimeoutInMicrosecs.\r
468 Type EFI_EVENT is defined in CreateEvent() \r
469 in the Unified Extensible Firmware Interface \r
470 Specification.\r
471 @param[in] TimeoutInMicrosecsond Time to wait for APs to finish.\r
472 - IA32, X64:\r
473 If the value is zero, it means no timeout \r
474 limit. The BSP waits until the AP finishes. \r
475 If the value is not zero, the BSP waits until \r
476 the AP finishes or timeout expires. If timeout \r
477 expires, EFI_TIMEOUT is returned, and the \r
689b2d72 478 BSP will then check the AP's status periodically, \r
b6d47a83 479 with time interval of 16 microseconds.\r
480 - IPF:\r
481 If WaitEvent is NULL, this parameter is ignored.\r
482 If WaitEvent is not NULL, the BSP waits after \r
483 the AP is dispatched and this value determines \r
484 time interval. If the value is zero, the length \r
485 of time interval is 10ms. If the value is \r
486 non-zero, the BSP waits until the AP finishes.\r
487 @param[in] ProcedureArgument Pointer to the optional parameter of the \r
488 function specified by Procedure.\r
489\r
490 @retval EFI_SUCCESS Specified AP has finished before the timeout \r
491 expires.\r
492 @retval EFI_TIMEOUT The timeout expires before specified AP has \r
493 finished.\r
494 @retval EFI_INVALID_PARAMETER IA32, X64: Processor with the handle specified \r
495 by ProcessorNumber does not exist.\r
496 @retval EFI_INVALID_PARAMETER IA32, X64: Specified AP is busy or disabled.\r
497 @retval EFI_INVALID_PARAMETER IA32, X64: Procedure is NULL.\r
498 @retval EFI_INVALID_PARAMETER IA32, X64: ProcessorNumber specifies the BSP\r
499 @retval EFI_NOT_READY IPF: Specified AP is busy\r
500 @retval EFI_NOT_AVAILABLE_YET IPF: ProcessorNumber specifies the BSP\r
501 @retval EFI_NOT_AVAILABLE_YET IPF: Specified AP is disabled.\r
502 @retval EFI_NOT_AVAILABLE_YET IPF: Specified AP is unhealthy or untested.\r
503\r
504**/\r
505typedef\r
506EFI_STATUS\r
507(EFIAPI *FRAMEWORK_EFI_MP_SERVICES_STARTUP_THIS_AP)(\r
508 IN FRAMEWORK_EFI_MP_SERVICES_PROTOCOL *This,\r
509 IN FRAMEWORK_EFI_AP_PROCEDURE Procedure,\r
510 IN UINTN ProcessorNumber,\r
511 IN EFI_EVENT WaitEvent OPTIONAL,\r
512 IN UINTN TimeoutInMicroSecs,\r
513 IN OUT VOID *ProcArguments OPTIONAL\r
514 );\r
515\r
516/**\r
517 This service switches the requested AP to be the BSP from that point onward. \r
518 The new BSP can take over the execution of the old BSP and continue seamlessly \r
519 from where the old one left off. This call can only be performed by the \r
520 current BSP.\r
521\r
522 @param[in] This Pointer to the FRAMEWORK_EFI_MP_SERVICES_PROTOCOL\r
523 instance.\r
524 @param[in] ProcessorNumber The handle number of AP. The range is from 0 to \r
525 the total number of logical processors minus 1. \r
526 The total number of logical processors can be \r
527 retrieved by GetGeneralMPInfo().\r
528 @param[in] EnableOldBSP If TRUE, then the old BSP will be listed as an \r
529 enabled AP. Otherwise, it will be disabled.\r
530\r
531 @retval EFI_SUCCESS BSP successfully switched.\r
532 @retval EFI_INVALID_PARAMETER Processor with the handle specified by \r
533 ProcessorNumber does not exist.\r
534 @retval EFI_INVALID_PARAMETER ProcessorNumber specifies the BSP.\r
535 @retval EFI_NOT_READY IA32, X64: Specified AP is busy or disabled.\r
536 @retval EFI_INVALID_PARAMETER IPF: Specified AP is disabled.\r
537 @retval EFI_INVALID_PARAMETER IPF: Specified AP is unhealthy or untested.\r
538 @retval EFI_NOT_READY IPF: Specified AP is busy.\r
539\r
540**/\r
541typedef\r
542EFI_STATUS\r
543(EFIAPI *FRAMEWORK_EFI_MP_SERVICES_SWITCH_BSP)(\r
544 IN FRAMEWORK_EFI_MP_SERVICES_PROTOCOL *This,\r
545 IN UINTN ProcessorNumber,\r
546 IN BOOLEAN EnableOldBSP\r
547 );\r
548\r
549/**\r
550 This service sends an IPI to a specified AP. Caller can specify vector number \r
551 and delivery mode of the interrupt.\r
552\r
553 @param[in] This Pointer to the FRAMEWORK_EFI_MP_SERVICES_PROTOCOL\r
554 instance.\r
555 @param[in] ProcessorNumber The handle number of AP. The range is from 0 to \r
556 the total number of logical processors minus 1. \r
557 The total number of logical processors can be \r
558 retrieved by GetGeneralMPInfo().\r
559 @param[in] VectorNumber Vector number of the interrupt.\r
560 @param[in] DeliveryMode Delivery mode of the interrupt.\r
561\r
562 @retval EFI_SUCCESS IPI is successfully sent.\r
563 @retval EFI_INVALID_PARAMETER ProcessorNumber specifies the BSP.\r
564 @retval EFI_INVALID_PARAMETER IA32, X64: Processor with the handle specified \r
565 by ProcessorNumber does not exist.\r
566 @retval EFI_INVALID_PARAMETER IA32, X64: VectorNumber is greater than 255.\r
567 @retval EFI_INVALID_PARAMETER IA32, X64: DeliveryMode is greater than or equal \r
568 to DELIVERY_MODE_MAX.\r
569 @retval EFI_NOT_READY IA32, X64: IPI is not accepted by the target \r
570 processor within 10 microseconds.\r
571 @retval EFI_INVALID_PARAMETER IPF: Specified AP is disabled.\r
572 @retval EFI_INVALID_PARAMETER IPF: Specified AP is unhealthy or untested.\r
573 @retval EFI_NOT_READY IPF: Specified AP is busy.\r
574\r
575**/\r
576typedef\r
577EFI_STATUS\r
108854b2 578(EFIAPI *EFI_MP_SERVICES_SEND_IPI)(\r
b6d47a83 579 IN FRAMEWORK_EFI_MP_SERVICES_PROTOCOL *This,\r
580 IN UINTN ProcessorNumber,\r
581 IN UINTN VectorNumber,\r
582 IN UINTN DeliveryMode\r
583 );\r
584\r
585/**\r
586 This service lets the caller enable or disable an AP. The caller can optionally \r
587 specify the health status of the AP by Health. It is usually used to update the \r
588 health status of the processor after some processor test.\r
589\r
590 @param[in] This Pointer to the FRAMEWORK_EFI_MP_SERVICES_PROTOCOL\r
591 instance.\r
592 @param[in] ProcessorNumber The handle number of AP. The range is from 0 to \r
593 the total number of logical processors minus 1. \r
594 The total number of logical processors can be \r
595 retrieved by GetGeneralMPInfo().\r
596 @param[in] NewAPState Indicates whether the new, desired state of the \r
597 AP is enabled or disabled. TRUE for enabling, \r
598 FALSE otherwise.\r
599 @param[in] HealthState If not NULL, it points to the value that specifies \r
600 the new health status of the AP. If it is NULL, \r
601 this parameter is ignored. \r
602\r
603 @retval EFI_SUCCESS AP successfully enabled or disabled.\r
604 @retval EFI_INVALID_PARAMETER ProcessorNumber specifies the BSP.\r
605 @retval EFI_INVALID_PARAMETER IA32, X64: Processor with the handle specified \r
606 by ProcessorNumber does not exist.\r
607 @retval EFI_INVALID_PARAMETER IPF: If an unhealthy or untested AP is to be \r
608 enabled.\r
609\r
610**/\r
611typedef\r
612EFI_STATUS\r
613(EFIAPI *FRAMEWORK_EFI_MP_SERVICES_ENABLEDISABLEAP)(\r
614 IN FRAMEWORK_EFI_MP_SERVICES_PROTOCOL *This,\r
615 IN UINTN ProcessorNumber,\r
616 IN BOOLEAN NewAPState,\r
617 IN EFI_MP_HEALTH *HealthState OPTIONAL\r
618 );\r
619\r
620/**\r
621 This service lets the caller processor get its handle number, with which any \r
622 processor in the system can be uniquely identified. The range is from 0 to the \r
623 total number of logical processors minus 1. The total number of logical \r
624 processors can be retrieved by GetGeneralMPInfo(). This service may be called \r
625 from the BSP and APs.\r
626\r
627 @param[in] This Pointer to the FRAMEWORK_EFI_MP_SERVICES_PROTOCOL\r
628 instance.\r
629 @param[out] ProcessorNumber A pointer to the handle number of AP. The range is \r
630 from 0 to the total number of logical processors \r
631 minus 1. The total number of logical processors \r
632 can be retrieved by GetGeneralMPInfo().\r
633\r
634@retval EFI_SUCCESS This function always returns EFI_SUCCESS.\r
635\r
636**/\r
637typedef\r
638EFI_STATUS\r
639(EFIAPI *FRAMEWORK_EFI_MP_SERVICES_WHOAMI)(\r
640 IN FRAMEWORK_EFI_MP_SERVICES_PROTOCOL *This,\r
641 OUT UINTN *ProcessorNumber\r
642 );\r
643\r
644///\r
645/// Framework MP Services Protocol structure\r
646///\r
647typedef struct _FRAMEWORK_EFI_MP_SERVICES_PROTOCOL {\r
108854b2
LG
648 EFI_MP_SERVICES_GET_GENERAL_MP_INFO GetGeneralMPInfo;\r
649 EFI_MP_SERVICES_GET_PROCESSOR_CONTEXT GetProcessorContext;\r
b6d47a83 650 FRAMEWORK_EFI_MP_SERVICES_STARTUP_ALL_APS StartupAllAPs;\r
651 FRAMEWORK_EFI_MP_SERVICES_STARTUP_THIS_AP StartupThisAP;\r
652 FRAMEWORK_EFI_MP_SERVICES_SWITCH_BSP SwitchBSP;\r
108854b2 653 EFI_MP_SERVICES_SEND_IPI SendIPI;\r
b6d47a83 654 FRAMEWORK_EFI_MP_SERVICES_ENABLEDISABLEAP EnableDisableAP;\r
655 FRAMEWORK_EFI_MP_SERVICES_WHOAMI WhoAmI;\r
656};\r
657\r
658extern EFI_GUID gFrameworkEfiMpServiceProtocolGuid;\r
659\r
660#endif\r