--- /dev/null
+/** @file\r
+ This file declares UEFI PI Multi-processor PPI.\r
+ This PPI is installed by some platform or chipset-specific PEIM that abstracts\r
+ handling multiprocessor support.\r
+\r
+ Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>\r
+ This program and the accompanying materials\r
+ are licensed and made available under the terms and conditions of the BSD License\r
+ which accompanies this distribution. The full text of the license may be found at\r
+ http://opensource.org/licenses/bsd-license.php\r
+\r
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+ @par Revision Reference:\r
+ This PPI is introduced in PI Version 1.4.\r
+\r
+**/\r
+\r
+#ifndef __PEI_MP_SERVICES_PPI_H__\r
+#define __PEI_MP_SERVICES_PPI_H__\r
+\r
+#include <Protocol/MpService.h>\r
+\r
+#define EFI_PEI_MP_SERVICES_PPI_GUID \\r
+ { \\r
+ 0xee16160a, 0xe8be, 0x47a6, { 0x82, 0xa, 0xc6, 0x90, 0xd, 0xb0, 0x25, 0xa } \\r
+ }\r
+\r
+typedef struct _EFI_PEI_MP_SERVICES_PPI EFI_PEI_MP_SERVICES_PPI ;\r
+\r
+/**\r
+ Get the number of CPU's.\r
+\r
+ @param[in] PeiServices An indirect pointer to the PEI Services Table\r
+ published by the PEI Foundation.\r
+ @param[in] This Pointer to this instance of the PPI.\r
+ @param[out] NumberOfProcessors Pointer to the total number of logical processors in\r
+ the system, including the BSP and disabled APs.\r
+ @param[out] NumberOfEnabledProcessors\r
+ Number of processors in the system that are enabled.\r
+\r
+ @retval EFI_SUCCESS The number of logical processors and enabled\r
+ logical processors was retrieved.\r
+ @retval EFI_DEVICE_ERROR The calling processor is an AP.\r
+ @retval EFI_INVALID_PARAMETER NumberOfProcessors is NULL.\r
+ NumberOfEnabledProcessors is NULL.\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_PEI_MP_SERVICES_GET_NUMBER_OF_PROCESSORS) (\r
+ IN CONST EFI_PEI_SERVICES **PeiServices,\r
+ IN EFI_PEI_MP_SERVICES_PPI *This,\r
+ OUT UINTN *NumberOfProcessors,\r
+ OUT UINTN *NumberOfEnabledProcessors\r
+ );\r
+\r
+/**\r
+ Get information on a specific CPU.\r
+\r
+ @param[in] PeiServices An indirect pointer to the PEI Services Table\r
+ published by the PEI Foundation.\r
+ @param[in] This Pointer to this instance of the PPI.\r
+ @param[in] ProcessorNumber Pointer to the total number of logical processors in\r
+ the system, including the BSP and disabled APs.\r
+ @param[out] ProcessorInfoBuffer Number of processors in the system that are enabled.\r
+\r
+ @retval EFI_SUCCESS Processor information was returned.\r
+ @retval EFI_DEVICE_ERROR The calling processor is an AP.\r
+ @retval EFI_INVALID_PARAMETER ProcessorInfoBuffer is NULL.\r
+ @retval EFI_NOT_FOUND The processor with the handle specified by\r
+ ProcessorNumber does not exist in the platform.\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_PEI_MP_SERVICES_GET_PROCESSOR_INFO) (\r
+ IN CONST EFI_PEI_SERVICES **PeiServices,\r
+ IN EFI_PEI_MP_SERVICES_PPI *This,\r
+ IN UINTN ProcessorNumber,\r
+ OUT EFI_PROCESSOR_INFORMATION *ProcessorInfoBuffer\r
+ );\r
+\r
+/**\r
+ Activate all of the application proessors.\r
+\r
+ @param[in] PeiServices An indirect pointer to the PEI Services Table\r
+ published by the PEI Foundation.\r
+ @param[in] This A pointer to the EFI_PEI_MP_SERVICES_PPI instance.\r
+ @param[in] Procedure A pointer to the function to be run on enabled APs of\r
+ the system.\r
+ @param[in] SingleThread If TRUE, then all the enabled APs execute the function\r
+ specified by Procedure one by one, in ascending order\r
+ of processor handle number. If FALSE, then all the\r
+ enabled APs execute the function specified by Procedure\r
+ simultaneously.\r
+ @param[in] TimeoutInMicroSeconds\r
+ Indicates the time limit in microseconds for APs to\r
+ return from Procedure, for blocking mode only. Zero\r
+ means infinity. If the timeout expires before all APs\r
+ return from Procedure, then Procedure on the failed APs\r
+ is terminated. All enabled APs are available for next\r
+ function assigned by EFI_PEI_MP_SERVICES_PPI.StartupAllAPs()\r
+ or EFI_PEI_MP_SERVICES_PPI.StartupThisAP(). If the\r
+ timeout expires in blocking mode, BSP returns\r
+ EFI_TIMEOUT.\r
+ @param[in] ProcedureArgument The parameter passed into Procedure for all APs.\r
+\r
+ @retval EFI_SUCCESS In blocking mode, all APs have finished before the\r
+ timeout expired.\r
+ @retval EFI_DEVICE_ERROR Caller processor is AP.\r
+ @retval EFI_NOT_STARTED No enabled APs exist in the system.\r
+ @retval EFI_NOT_READY Any enabled APs are busy.\r
+ @retval EFI_TIMEOUT In blocking mode, the timeout expired before all\r
+ enabled APs have finished.\r
+ @retval EFI_INVALID_PARAMETER Procedure is NULL.\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_PEI_MP_SERVICES_STARTUP_ALL_APS) (\r
+ IN CONST EFI_PEI_SERVICES **PeiServices,\r
+ IN EFI_PEI_MP_SERVICES_PPI *This,\r
+ IN EFI_AP_PROCEDURE Procedure,\r
+ IN BOOLEAN SingleThread,\r
+ IN UINTN TimeoutInMicroSeconds,\r
+ IN VOID *ProcedureArgument OPTIONAL\r
+ );\r
+\r
+/**\r
+ Activate a specific application processor.\r
+\r
+ @param[in] PeiServices An indirect pointer to the PEI Services Table\r
+ published by the PEI Foundation.\r
+ @param[in] This A pointer to the EFI_PEI_MP_SERVICES_PPI instance.\r
+ @param[in] Procedure A pointer to the function to be run on enabled APs of\r
+ the system.\r
+ @param[in] ProcessorNumber The handle number of the AP. The range is from 0 to the\r
+ total number of logical processors minus 1. The total\r
+ number of logical processors can be retrieved by\r
+ EFI_PEI_MP_SERVICES_PPI.GetNumberOfProcessors().\r
+ @param[in] TimeoutInMicroSeconds\r
+ Indicates the time limit in microseconds for APs to\r
+ return from Procedure, for blocking mode only. Zero\r
+ means infinity. If the timeout expires before all APs\r
+ return from Procedure, then Procedure on the failed APs\r
+ is terminated. All enabled APs are available for next\r
+ function assigned by EFI_PEI_MP_SERVICES_PPI.StartupAllAPs()\r
+ or EFI_PEI_MP_SERVICES_PPI.StartupThisAP(). If the\r
+ timeout expires in blocking mode, BSP returns\r
+ EFI_TIMEOUT.\r
+ @param[in] ProcedureArgument The parameter passed into Procedure for all APs.\r
+\r
+ @retval EFI_SUCCESS In blocking mode, specified AP finished before the\r
+ timeout expires.\r
+ @retval EFI_DEVICE_ERROR The calling processor is an AP.\r
+ @retval EFI_TIMEOUT In blocking mode, the timeout expired before the\r
+ specified AP has finished.\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
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_PEI_MP_SERVICES_STARTUP_THIS_AP) (\r
+ IN CONST EFI_PEI_SERVICES **PeiServices,\r
+ IN EFI_PEI_MP_SERVICES_PPI *This,\r
+ IN EFI_AP_PROCEDURE Procedure,\r
+ IN UINTN ProcessorNumber,\r
+ IN UINTN TimeoutInMicroseconds,\r
+ IN VOID *ProcedureArgument OPTIONAL\r
+ );\r
+\r
+/**\r
+ Switch the boot strap processor.\r
+\r
+ @param[in] PeiServices An indirect pointer to the PEI Services Table\r
+ published by the PEI Foundation.\r
+ @param[in] This A pointer to the EFI_PEI_MP_SERVICES_PPI instance.\r
+ @param[in] ProcessorNumber The handle number of the AP. The range is from 0 to the\r
+ total number of logical processors minus 1. The total\r
+ number of logical processors can be retrieved by\r
+ EFI_PEI_MP_SERVICES_PPI.GetNumberOfProcessors().\r
+ @param[in] EnableOldBSP If TRUE, then the old BSP will be listed as an enabled\r
+ 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 this\r
+ service returning.\r
+ @retval EFI_UNSUPPORTED Switching the BSP is not supported.\r
+ @retval EFI_SUCCESS 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 a disabled\r
+ AP.\r
+ @retval EFI_NOT_READY The specified AP is busy.\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_PEI_MP_SERVICES_SWITCH_BSP) (\r
+ IN CONST EFI_PEI_SERVICES **PeiServices,\r
+ IN EFI_PEI_MP_SERVICES_PPI *This,\r
+ IN UINTN ProcessorNumber,\r
+ IN BOOLEAN EnableOldBSP\r
+ );\r
+\r
+/**\r
+ Enable or disable an application processor.\r
+\r
+ @param[in] PeiServices An indirect pointer to the PEI Services Table\r
+ published by the PEI Foundation.\r
+ @param[in] This A pointer to the EFI_PEI_MP_SERVICES_PPI instance.\r
+ @param[in] ProcessorNumber The handle number of the AP. The range is from 0 to the\r
+ total number of logical processors minus 1. The total\r
+ number of logical processors can be retrieved by\r
+ EFI_PEI_MP_SERVICES_PPI.GetNumberOfProcessors().\r
+ @param[in] EnableAP Specifies the new state for the processor for enabled,\r
+ FALSE for disabled.\r
+ @param[in] HealthFlag If not NULL, a pointer to a value that specifies the\r
+ new health status of the AP. This flag corresponds to\r
+ StatusFlag defined in EFI_PEI_MP_SERVICES_PPI.GetProcessorInfo().\r
+ Only the PROCESSOR_HEALTH_STATUS_BIT is used. All other\r
+ bits are ignored. If it is NULL, this parameter is\r
+ 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 prior\r
+ 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
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_PEI_MP_SERVICES_ENABLEDISABLEAP) (\r
+ IN CONST EFI_PEI_SERVICES **PeiServices,\r
+ IN EFI_PEI_MP_SERVICES_PPI *This,\r
+ IN UINTN ProcessorNumber,\r
+ IN BOOLEAN EnableAP,\r
+ IN UINT32 *HealthFlag OPTIONAL\r
+ );\r
+\r
+/**\r
+ Enable or disable an application processor.\r
+\r
+ @param[in] PeiServices An indirect pointer to the PEI Services Table\r
+ published by the PEI Foundation.\r
+ @param[in] This A pointer to the EFI_PEI_MP_SERVICES_PPI instance.\r
+ @param[out] ProcessorNumber The handle number of the AP. The range is from 0 to the\r
+ total number of logical processors minus 1. The total\r
+ number of logical processors can be retrieved by\r
+ EFI_PEI_MP_SERVICES_PPI.GetNumberOfProcessors().\r
+\r
+ @retval EFI_SUCCESS The current processor handle number was returned in\r
+ ProcessorNumber.\r
+ @retval EFI_INVALID_PARAMETER ProcessorNumber is NULL.\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_PEI_MP_SERVICES_WHOAMI) (\r
+ IN CONST EFI_PEI_SERVICES **PeiServices,\r
+ IN EFI_PEI_MP_SERVICES_PPI *This,\r
+ OUT UINTN *ProcessorNumber\r
+ );\r
+\r
+///\r
+/// This PPI is installed by some platform or chipset-specific PEIM that abstracts\r
+/// handling multiprocessor support.\r
+///\r
+struct _EFI_PEI_MP_SERVICES_PPI {\r
+ EFI_PEI_MP_SERVICES_GET_NUMBER_OF_PROCESSORS GetNumberOfProcessors;\r
+ EFI_PEI_MP_SERVICES_GET_PROCESSOR_INFO GetProcessorInfo;\r
+ EFI_PEI_MP_SERVICES_STARTUP_ALL_APS StartupAllAPs;\r
+ EFI_PEI_MP_SERVICES_STARTUP_THIS_AP StartupThisAP;\r
+ EFI_PEI_MP_SERVICES_SWITCH_BSP SwitchBSP;\r
+ EFI_PEI_MP_SERVICES_ENABLEDISABLEAP EnableDisableAP;\r
+ EFI_PEI_MP_SERVICES_WHOAMI WhoAmI;\r
+};\r
+\r
+extern EFI_GUID gEfiPeiMpServicesPpiGuid;\r
+\r
+#endif\r