+ This service lets the caller get one enabled AP to execute a caller-provided\r
+ function. The caller can request the BSP to either wait for the completion\r
+ of the AP or just proceed with the next task by using the EFI event mechanism.\r
+ See EFI_MP_SERVICES_PROTOCOL.StartupAllAPs() for more details on non-blocking\r
+ execution support. This service may only be called from the BSP.\r
+\r
+ This function is used to dispatch one enabled AP to the function specified by\r
+ Procedure passing in the argument specified by ProcedureArgument. If WaitEvent\r
+ is NULL, execution is in blocking mode. The BSP waits until the AP finishes or\r
+ TimeoutInMicroSecondss expires. Otherwise, execution is in non-blocking mode.\r
+ BSP proceeds to the next task without waiting for the AP. If a non-blocking mode\r
+ is requested after the UEFI Event EFI_EVENT_GROUP_READY_TO_BOOT is signaled,\r
+ then EFI_UNSUPPORTED must be returned.\r
+\r
+ If the timeout specified by TimeoutInMicroseconds expires before the AP returns\r
+ from Procedure, then execution of Procedure by the AP is terminated. The AP is\r
+ available for subsequent calls to EFI_MP_SERVICES_PROTOCOL.StartupAllAPs() and\r
+ EFI_MP_SERVICES_PROTOCOL.StartupThisAP().\r
+\r
+ @param[in] This A pointer to the EFI_MP_SERVICES_PROTOCOL\r
+ instance.\r
+ @param[in] Procedure A pointer to the function to be run on the\r
+ designated AP of the system. See type\r
+ EFI_AP_PROCEDURE.\r
+ @param[in] ProcessorNumber The handle number of the AP. The range is\r
+ from 0 to the total number of logical\r
+ processors minus 1. The total number of\r
+ logical processors can be retrieved by\r
+ EFI_MP_SERVICES_PROTOCOL.GetNumberOfProcessors().\r
+ @param[in] WaitEvent The event created by the caller with CreateEvent()\r
+ service. If it is NULL, then execute in\r
+ blocking mode. BSP waits until this AP finish\r
+ or TimeoutInMicroSeconds expires. If it's\r
+ not NULL, then execute in non-blocking mode.\r
+ BSP requests the function specified by\r
+ Procedure to be started on this AP,\r
+ and go on executing immediately. If this AP\r
+ return from Procedure or TimeoutInMicroSeconds\r
+ expires, this event is signaled. The BSP\r
+ can use the CheckEvent() or WaitForEvent()\r
+ services to check the state of event. Type\r
+ EFI_EVENT is defined in CreateEvent() in\r
+ the Unified Extensible Firmware Interface\r
+ Specification.\r
+ @param[in] TimeoutInMicroseconds Indicates the time limit in microseconds for\r
+ this AP to finish this Procedure, either for\r
+ blocking or non-blocking mode. Zero means\r
+ infinity. If the timeout expires before\r
+ this AP returns from Procedure, then Procedure\r
+ on the AP is terminated. The\r
+ AP is available for next function assigned\r
+ by EFI_MP_SERVICES_PROTOCOL.StartupAllAPs()\r
+ or EFI_MP_SERVICES_PROTOCOL.StartupThisAP().\r
+ If the timeout expires in blocking mode,\r
+ BSP returns EFI_TIMEOUT. If the timeout\r
+ expires in non-blocking mode, WaitEvent\r
+ is signaled with SignalEvent().\r
+ @param[in] ProcedureArgument The parameter passed into Procedure on the\r
+ specified AP.\r
+ @param[out] Finished If NULL, this parameter is ignored. In\r
+ blocking mode, this parameter is ignored.\r
+ In non-blocking mode, if AP returns from\r
+ Procedure before the timeout expires, its\r
+ content is set to TRUE. Otherwise, the\r
+ value is set to FALSE. The caller can\r
+ determine if the AP returned from Procedure\r
+ by evaluating this value.\r
+\r
+ @retval EFI_SUCCESS In blocking mode, specified AP finished before\r
+ the timeout expires.\r
+ @retval EFI_SUCCESS In non-blocking mode, the function has been\r
+ dispatched to specified AP.\r
+ @retval EFI_UNSUPPORTED A non-blocking mode request was made after the\r
+ UEFI event EFI_EVENT_GROUP_READY_TO_BOOT was\r
+ signaled.\r
+ @retval EFI_DEVICE_ERROR The calling processor is an AP.\r
+ @retval EFI_TIMEOUT In blocking mode, the timeout expired before\r
+ the specified AP has finished.\r
+ @retval EFI_NOT_READY The specified AP is busy.\r
+ @retval EFI_NOT_FOUND The processor with the handle specified by\r
+ ProcessorNumber does not exist.\r
+ @retval EFI_INVALID_PARAMETER ProcessorNumber specifies the BSP or disabled AP.\r
+ @retval EFI_INVALID_PARAMETER Procedure is NULL.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+StartupThisAP (\r
+ IN EFI_MP_SERVICES_PROTOCOL *This,\r
+ IN EFI_AP_PROCEDURE Procedure,\r
+ IN UINTN ProcessorNumber,\r
+ IN EFI_EVENT WaitEvent OPTIONAL,\r
+ IN UINTN TimeoutInMicroseconds,\r
+ IN VOID *ProcedureArgument OPTIONAL,\r
+ OUT BOOLEAN *Finished OPTIONAL\r
+ )\r
+{\r
+ return MpInitLibStartupThisAP (\r
+ Procedure,\r
+ ProcessorNumber,\r
+ WaitEvent,\r
+ TimeoutInMicroseconds,\r
+ ProcedureArgument,\r
+ Finished\r
+ );\r
+}\r
+\r
+/**\r
+ This service switches the requested AP to be the BSP from that point onward.\r
+ This service changes the BSP for all purposes. This call can only be performed\r
+ by the current BSP.\r
+\r
+ This service switches the requested AP to be the BSP from that point onward.\r
+ This service changes the BSP for all purposes. The new BSP can take over the\r
+ execution of the old BSP and continue seamlessly from where the old one left\r
+ off. This service may not be supported after the UEFI Event EFI_EVENT_GROUP_READY_TO_BOOT\r
+ is signaled.\r
+\r
+ If the BSP cannot be switched prior to the return from this service, then\r
+ EFI_UNSUPPORTED must be returned.\r
+\r
+ @param[in] This A pointer to the EFI_MP_SERVICES_PROTOCOL instance.\r
+ @param[in] ProcessorNumber The handle number of AP that is to become the new\r
+ BSP. The range is from 0 to the total number of\r
+ logical processors minus 1. The total number of\r
+ logical processors can be retrieved by\r
+ EFI_MP_SERVICES_PROTOCOL.GetNumberOfProcessors().\r
+ @param[in] EnableOldBSP If TRUE, then the old BSP will be listed as an\r
+ enabled AP. Otherwise, it will be disabled.\r
+\r
+ @retval EFI_SUCCESS BSP successfully switched.\r
+ @retval EFI_UNSUPPORTED Switching the BSP cannot be completed prior to\r
+ this service returning.\r
+ @retval EFI_UNSUPPORTED Switching the BSP is not supported.\r
+ @retval EFI_DEVICE_ERROR The calling processor is an AP.\r
+ @retval EFI_NOT_FOUND The processor with the handle specified by\r
+ ProcessorNumber does not exist.\r
+ @retval EFI_INVALID_PARAMETER ProcessorNumber specifies the current BSP or\r
+ a disabled AP.\r
+ @retval EFI_NOT_READY The specified AP is busy.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+SwitchBSP (\r
+ IN EFI_MP_SERVICES_PROTOCOL *This,\r
+ IN UINTN ProcessorNumber,\r
+ IN BOOLEAN EnableOldBSP\r
+ )\r
+{\r
+ return MpInitLibSwitchBSP (ProcessorNumber, EnableOldBSP);\r
+}\r
+\r
+/**\r
+ This service lets the caller enable or disable an AP from this point onward.\r
+ This service may only be called from the BSP.\r
+\r
+ This service allows the caller enable or disable an AP from this point onward.\r
+ The caller can optionally specify the health status of the AP by Health. If\r
+ an AP is being disabled, then the state of the disabled AP is implementation\r
+ dependent. If an AP is enabled, then the implementation must guarantee that a\r
+ complete initialization sequence is performed on the AP, so the AP is in a state\r
+ that is compatible with an MP operating system. This service may not be supported\r
+ after the UEFI Event EFI_EVENT_GROUP_READY_TO_BOOT is signaled.\r
+\r
+ If the enable or disable AP operation cannot be completed prior to the return\r
+ from this service, then EFI_UNSUPPORTED must be returned.\r
+\r
+ @param[in] This A pointer to the EFI_MP_SERVICES_PROTOCOL instance.\r
+ @param[in] ProcessorNumber The handle number of AP.\r
+ The range is from 0 to the total number of\r
+ logical processors minus 1. The total number of\r
+ logical processors can be retrieved by\r
+ EFI_MP_SERVICES_PROTOCOL.GetNumberOfProcessors().\r
+ @param[in] EnableAP Specifies the new state for the processor for\r
+ enabled, FALSE for disabled.\r
+ @param[in] HealthFlag If not NULL, a pointer to a value that specifies\r
+ the new health status of the AP. This flag\r
+ corresponds to StatusFlag defined in\r
+ EFI_MP_SERVICES_PROTOCOL.GetProcessorInfo(). Only\r
+ the PROCESSOR_HEALTH_STATUS_BIT is used. All other\r
+ bits are ignored. If it is NULL, this parameter\r
+ is ignored.\r
+\r
+ @retval EFI_SUCCESS The specified AP was enabled or disabled successfully.\r
+ @retval EFI_UNSUPPORTED Enabling or disabling an AP cannot be completed\r
+ prior to this service returning.\r
+ @retval EFI_UNSUPPORTED Enabling or disabling an AP is not supported.\r
+ @retval EFI_DEVICE_ERROR The calling processor is an AP.\r
+ @retval EFI_NOT_FOUND Processor with the handle specified by ProcessorNumber\r
+ does not exist.\r
+ @retval EFI_INVALID_PARAMETER ProcessorNumber specifies the BSP.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+EnableDisableAP (\r
+ IN EFI_MP_SERVICES_PROTOCOL *This,\r
+ IN UINTN ProcessorNumber,\r
+ IN BOOLEAN EnableAP,\r
+ IN UINT32 *HealthFlag OPTIONAL\r
+ )\r
+{\r
+ return MpInitLibEnableDisableAP (ProcessorNumber, EnableAP, HealthFlag);\r
+}\r
+\r
+/**\r
+ This return the handle number for the calling processor. This service may be\r
+ called from the BSP and APs.\r
+\r
+ This service returns the processor handle number for the calling processor.\r
+ The returned value is in the range from 0 to the total number of logical\r
+ processors minus 1. The total number of logical processors can be retrieved\r
+ with EFI_MP_SERVICES_PROTOCOL.GetNumberOfProcessors(). This service may be\r
+ called from the BSP and APs. If ProcessorNumber is NULL, then EFI_INVALID_PARAMETER\r
+ is returned. Otherwise, the current processors handle number is returned in\r
+ ProcessorNumber, and EFI_SUCCESS is returned.\r
+\r
+ @param[in] This A pointer to the EFI_MP_SERVICES_PROTOCOL instance.\r
+ @param[out] ProcessorNumber Pointer to the handle number of AP.\r
+ The range is from 0 to the total number of\r
+ logical processors minus 1. The total number of\r
+ logical processors can be retrieved by\r
+ EFI_MP_SERVICES_PROTOCOL.GetNumberOfProcessors().\r
+\r
+ @retval EFI_SUCCESS The current processor handle number was returned\r
+ in ProcessorNumber.\r
+ @retval EFI_INVALID_PARAMETER ProcessorNumber is NULL.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+WhoAmI (\r
+ IN EFI_MP_SERVICES_PROTOCOL *This,\r
+ OUT UINTN *ProcessorNumber\r
+ )\r
+{\r
+ return MpInitLibWhoAmI (ProcessorNumber);;\r
+}\r
+\r
+/**\r
+ Collects BIST data from HOB.\r
+\r
+ This function collects BIST data from HOB built from Sec Platform Information\r
+ PPI or SEC Platform Information2 PPI.\r