OpenCore
1.0.4
OpenCore Bootloader
|
Go to the source code of this file.
Data Structures | |
union | EFI_MP_HEALTH_FLAGS |
struct | EFI_MP_HEALTH |
struct | EFI_MP_PROC_CONTEXT |
struct | _FRAMEWORK_EFI_MP_SERVICES_PROTOCOL |
Macros | |
#define | FRAMEWORK_EFI_MP_SERVICES_PROTOCOL_GUID |
#define | DELIVERY_MODE_FIXED 0x0 |
#define | DELIVERY_MODE_LOWEST_PRIORITY 0x1 |
#define | DELIVERY_MODE_SMI 0x2 |
#define | DELIVERY_MODE_REMOTE_READ 0x3 |
#define | DELIVERY_MODE_NMI 0x4 |
#define | DELIVERY_MODE_INIT 0x5 |
#define | DELIVERY_MODE_SIPI 0x6 |
#define | DELIVERY_MODE_MAX 0x7 |
#define | EFI_MP_HEALTH_FLAGS_STATUS_HEALTHY 0x0 |
#define | EFI_MP_HEALTH_FLAGS_STATUS_PERFORMANCE_RESTRICTED 0x1 |
#define | EFI_MP_HEALTH_FLAGS_STATUS_FUNCTIONALLY_RESTRICTED 0x2 |
Typedefs | |
typedef struct _FRAMEWORK_EFI_MP_SERVICES_PROTOCOL | FRAMEWORK_EFI_MP_SERVICES_PROTOCOL |
typedef VOID(EFIAPI * | EFI_AP_PROCEDURE) (IN OUT VOID *Buffer) |
typedef VOID(EFIAPI * | FRAMEWORK_EFI_AP_PROCEDURE) (IN VOID *Buffer) |
typedef EFI_STATUS(EFIAPI * | FRAMEWORK_EFI_MP_SERVICES_GET_GENERAL_MP_INFO) (IN FRAMEWORK_EFI_MP_SERVICES_PROTOCOL *This, OUT UINTN *NumberOfCPUs OPTIONAL, OUT UINTN *MaximumNumberOfCPUs OPTIONAL, OUT UINTN *NumberOfEnabledCPUs OPTIONAL, OUT UINTN *RendezvousIntNumber OPTIONAL, OUT UINTN *RendezvousProcLength OPTIONAL) |
typedef EFI_STATUS(EFIAPI * | FRAMEWORK_EFI_MP_SERVICES_GET_PROCESSOR_CONTEXT) (IN FRAMEWORK_EFI_MP_SERVICES_PROTOCOL *This, IN UINTN ProcessorNumber, IN OUT UINTN *BufferLength, OUT EFI_MP_PROC_CONTEXT *ProcessorContextBuffer) |
typedef EFI_STATUS(EFIAPI * | FRAMEWORK_EFI_MP_SERVICES_STARTUP_ALL_APS) (IN FRAMEWORK_EFI_MP_SERVICES_PROTOCOL *This, IN FRAMEWORK_EFI_AP_PROCEDURE Procedure, IN BOOLEAN SingleThread, IN EFI_EVENT WaitEvent OPTIONAL, IN UINTN TimeoutInMicroSecs, IN VOID *ProcArguments OPTIONAL, OUT UINTN *FailedCPUList OPTIONAL) |
typedef EFI_STATUS(EFIAPI * | FRAMEWORK_EFI_MP_SERVICES_STARTUP_THIS_AP) (IN FRAMEWORK_EFI_MP_SERVICES_PROTOCOL *This, IN FRAMEWORK_EFI_AP_PROCEDURE Procedure, IN UINTN ProcessorNumber, IN EFI_EVENT WaitEvent OPTIONAL, IN UINTN TimeoutInMicroSecs, IN OUT VOID *ProcArguments OPTIONAL) |
typedef EFI_STATUS(EFIAPI * | FRAMEWORK_EFI_MP_SERVICES_SWITCH_BSP) (IN FRAMEWORK_EFI_MP_SERVICES_PROTOCOL *This, IN UINTN ProcessorNumber, IN BOOLEAN EnableOldBSP) |
typedef EFI_STATUS(EFIAPI * | FRAMEWORK_EFI_MP_SERVICES_SEND_IPI) (IN FRAMEWORK_EFI_MP_SERVICES_PROTOCOL *This, IN UINTN ProcessorNumber, IN UINTN VectorNumber, IN UINTN DeliveryMode) |
typedef EFI_STATUS(EFIAPI * | FRAMEWORK_EFI_MP_SERVICES_ENABLEDISABLEAP) (IN FRAMEWORK_EFI_MP_SERVICES_PROTOCOL *This, IN UINTN ProcessorNumber, IN BOOLEAN NewAPState, IN EFI_MP_HEALTH *HealthState OPTIONAL) |
typedef EFI_STATUS(EFIAPI * | FRAMEWORK_EFI_MP_SERVICES_WHOAMI) (IN FRAMEWORK_EFI_MP_SERVICES_PROTOCOL *This, OUT UINTN *ProcessorNumber) |
Enumerations | |
enum | EFI_CPU_DESIGNATION { EfiCpuAP = 0 , EfiCpuBSP , EfiCpuDesignationMaximum } |
Variables | |
EFI_GUID | gFrameworkEfiMpServiceProtocolGuid |
When installed, the Framework MP Services Protocol produces a collection of services that are needed for MP management, such as initialization and management of application processors.
The MP Services Protocol provides a generalized way of performing following tasks:
The MP Services Protocol must be produced on any system with more than one logical processor.
The Protocol is available only during boot time.
MP Services Protocol is hardware-independent. Most of the logic of this protocol is architecturally neutral. It abstracts the multi-processor environment and status of processors, and provides interfaces to retrieve information, maintain, and dispatch.
MP Services Protocol may be consumed by ACPI module. The ACPI module may use this protocol to retrieve data that are needed for an MP platform and report them to OS. MP Services Protocol may also be used to program and configure processors, such as MTRR synchronization for memory space attributes setting in DXE Services. MP Services Protocol may be used by non-CPU DXE drivers to speed up platform boot by taking advantage of the processing capabilities of the APs, for example, using APs to help test system memory in parallel with other device initialization. Diagnostics applications may also use this protocol for multi-processor.
Copyright (c) 1999 - 2010, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License that accompanies this distribution. The full text of the license may be found at http://opensource.org/licenses/bsd-license.php.
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Definition in file FrameworkMpService.h.
#define DELIVERY_MODE_FIXED 0x0 |
Fixed delivery mode that may be used as the DeliveryMode parameter in SendIpi().
Definition at line 66 of file FrameworkMpService.h.
#define DELIVERY_MODE_INIT 0x5 |
INIT delivery mode that may be used as the DeliveryMode parameter in SendIpi().
Definition at line 91 of file FrameworkMpService.h.
#define DELIVERY_MODE_LOWEST_PRIORITY 0x1 |
Lowest priority delivery mode that may be used as the DeliveryMode parameter in SendIpi().
Definition at line 71 of file FrameworkMpService.h.
#define DELIVERY_MODE_MAX 0x7 |
The DeliveryMode parameter in SendIpi() must be less than this maximum value.
Definition at line 101 of file FrameworkMpService.h.
#define DELIVERY_MODE_NMI 0x4 |
NMI delivery mode that may be used as the DeliveryMode parameter in SendIpi().
Definition at line 86 of file FrameworkMpService.h.
#define DELIVERY_MODE_REMOTE_READ 0x3 |
Remote read delivery mode that may be used as the DeliveryMode parameter in SendIpi().
Definition at line 81 of file FrameworkMpService.h.
#define DELIVERY_MODE_SIPI 0x6 |
Startup IPI delivery mode that may be used as the DeliveryMode parameter in SendIpi().
Definition at line 96 of file FrameworkMpService.h.
#define DELIVERY_MODE_SMI 0x2 |
SMI delivery mode that may be used as the DeliveryMode parameter in SendIpi().
Definition at line 76 of file FrameworkMpService.h.
#define EFI_MP_HEALTH_FLAGS_STATUS_FUNCTIONALLY_RESTRICTED 0x2 |
IPF specific value for the state field of the Self Test State Parameter.
Definition at line 116 of file FrameworkMpService.h.
#define EFI_MP_HEALTH_FLAGS_STATUS_HEALTHY 0x0 |
IPF specific value for the state field of the Self Test State Parameter.
Definition at line 106 of file FrameworkMpService.h.
#define EFI_MP_HEALTH_FLAGS_STATUS_PERFORMANCE_RESTRICTED 0x1 |
IPF specific value for the state field of the Self Test State Parameter.
Definition at line 111 of file FrameworkMpService.h.
#define FRAMEWORK_EFI_MP_SERVICES_PROTOCOL_GUID |
Global ID for the FRAMEWORK_EFI_MP_SERVICES_PROTOCOL.
Definition at line 53 of file FrameworkMpService.h.
typedef VOID(EFIAPI * EFI_AP_PROCEDURE) (IN OUT VOID *Buffer) |
The function prototype for invoking a function on an Application Processor.
This definition is used by the UEFI MP Serices Protocol, and the PI SMM System Table.
[in,out] | Buffer | The pointer to private data buffer. |
Definition at line 235 of file FrameworkMpService.h.
typedef VOID(EFIAPI * FRAMEWORK_EFI_AP_PROCEDURE) (IN VOID *Buffer) |
Functions of this type are used with the Framework MP Services Protocol and the SMM Services Table to execute a procedure on enabled APs. The context the AP should use durng execution is specified by Buffer.
[in] | Buffer | The pointer to the procedure's argument. |
Definition at line 248 of file FrameworkMpService.h.
typedef EFI_STATUS(EFIAPI * FRAMEWORK_EFI_MP_SERVICES_ENABLEDISABLEAP) (IN FRAMEWORK_EFI_MP_SERVICES_PROTOCOL *This, IN UINTN ProcessorNumber, IN BOOLEAN NewAPState, IN EFI_MP_HEALTH *HealthState OPTIONAL) |
This service lets the caller enable or disable an AP. The caller can optionally specify the health status of the AP by Health. It is usually used to update the health status of the processor after some processor test.
[in] | This | The pointer to the FRAMEWORK_EFI_MP_SERVICES_PROTOCOL instance. |
[in] | ProcessorNumber | The handle number of AP. The range is from 0 to the total number of logical processors minus 1. The total number of logical processors can be retrieved by GetGeneralMPInfo(). |
[in] | NewAPState | Indicates whether the new, desired state of the AP is enabled or disabled. TRUE for enabling, FALSE otherwise. |
[in] | HealthState | If not NULL, it points to the value that specifies the new health status of the AP. If it is NULL, this parameter is ignored. |
EFI_SUCCESS | AP successfully enabled or disabled. |
EFI_INVALID_PARAMETER | ProcessorNumber specifies the BSP. |
EFI_INVALID_PARAMETER | IA32, X64: Processor with the handle specified by ProcessorNumber does not exist. |
EFI_INVALID_PARAMETER | IPF: If an unhealthy or untested AP is to be enabled. |
Definition at line 639 of file FrameworkMpService.h.
typedef EFI_STATUS(EFIAPI * FRAMEWORK_EFI_MP_SERVICES_GET_GENERAL_MP_INFO) (IN FRAMEWORK_EFI_MP_SERVICES_PROTOCOL *This, OUT UINTN *NumberOfCPUs OPTIONAL, OUT UINTN *MaximumNumberOfCPUs OPTIONAL, OUT UINTN *NumberOfEnabledCPUs OPTIONAL, OUT UINTN *RendezvousIntNumber OPTIONAL, OUT UINTN *RendezvousProcLength OPTIONAL) |
This service retrieves general information of multiprocessors in the system.
This function is used to get the following information:
[in] | This | The pointer to the FRAMEWORK_EFI_MP_SERVICES_PROTOCOL instance. |
[out] | NumberOfCPUs | The pointer to the total number of logical processors in the system, including the BSP and disabled APs. If NULL, this parameter is ignored. |
[out] | MaximumNumberOfCPUs | Pointer to the maximum number of processors supported by the system. If NULL, this parameter is ignored. |
[out] | NumberOfEnabledCPUs | The pointer to the number of enabled logical processors that exist in system, including the BSP. If NULL, this parameter is ignored. |
[out] | RendezvousIntNumber | This parameter is only meaningful for IPF.
|
[out] | RendezvousProcLength | The pointer to the length of rendezvous procedure.
|
EFI_SUCCESS | Multiprocessor general information was successfully retrieved. |
Definition at line 288 of file FrameworkMpService.h.
typedef EFI_STATUS(EFIAPI * FRAMEWORK_EFI_MP_SERVICES_GET_PROCESSOR_CONTEXT) (IN FRAMEWORK_EFI_MP_SERVICES_PROTOCOL *This, IN UINTN ProcessorNumber, IN OUT UINTN *BufferLength, OUT EFI_MP_PROC_CONTEXT *ProcessorContextBuffer) |
This service gets detailed MP-related information of the requested processor.
This service gets detailed MP-related information of the requested processor at the instant this call is made. Note the following:
[in] | This | The pointer to the FRAMEWORK_EFI_MP_SERVICES_PROTOCOL instance. |
[in] | ProcessorNumber | The handle number of the processor. The range is from 0 to the total number of logical processors minus 1. The total number of logical processors can be retrieved by GetGeneralMPInfo(). |
[in,out] | BufferLength | On input, pointer to the size in bytes of ProcessorContextBuffer. On output, if the size of ProcessorContextBuffer is not large enough, the value pointed by this parameter is updated to size in bytes that is needed. If the size of ProcessorContextBuffer is sufficient, the value is not changed from input. |
[out] | ProcessorContextBuffer | The pointer to the buffer where the data of requested processor will be deposited. The buffer is allocated by caller. |
EFI_SUCCESS | Processor information was successfully returned. |
EFI_BUFFER_TOO_SMALL | The size of ProcessorContextBuffer is too small. The value pointed by BufferLength has been updated to size in bytes that is needed. |
EFI_INVALID_PARAMETER | IA32, X64:BufferLength is NULL. |
EFI_INVALID_PARAMETER | IA32, X64:ProcessorContextBuffer is NULL. |
EFI_INVALID_PARAMETER | IA32, X64:Processor with the handle specified by ProcessorNumber does not exist. |
EFI_NOT_FOUND | IPF: Processor with the handle specified by ProcessorNumber does not exist. |
Definition at line 341 of file FrameworkMpService.h.
Forward declaration for the EFI_MP_SERVICES_PROTOCOL.
Definition at line 61 of file FrameworkMpService.h.
typedef EFI_STATUS(EFIAPI * FRAMEWORK_EFI_MP_SERVICES_SEND_IPI) (IN FRAMEWORK_EFI_MP_SERVICES_PROTOCOL *This, IN UINTN ProcessorNumber, IN UINTN VectorNumber, IN UINTN DeliveryMode) |
This service sends an IPI to a specified AP. Caller can specify vector number and delivery mode of the interrupt.
[in] | This | The pointer to the FRAMEWORK_EFI_MP_SERVICES_PROTOCOL instance. |
[in] | ProcessorNumber | The handle number of AP. The range is from 0 to the total number of logical processors minus 1. The total number of logical processors can be retrieved by GetGeneralMPInfo(). |
[in] | VectorNumber | The vector number of the interrupt. |
[in] | DeliveryMode | The delivery mode of the interrupt. |
EFI_SUCCESS | IPI was successfully sent. |
EFI_INVALID_PARAMETER | ProcessorNumber specifies the BSP. |
EFI_INVALID_PARAMETER | IA32, X64: Processor with the handle specified by ProcessorNumber does not exist. |
EFI_INVALID_PARAMETER | IA32, X64: VectorNumber is greater than 255. |
EFI_INVALID_PARAMETER | IA32, X64: DeliveryMode is greater than or equal to DELIVERY_MODE_MAX. |
EFI_NOT_READY | IA32, X64: IPI is not accepted by the target processor within 10 microseconds. |
EFI_INVALID_PARAMETER | IPF: Specified AP is disabled. |
EFI_INVALID_PARAMETER | IPF: Specified AP is unhealthy or untested. |
EFI_NOT_READY | IPF: Specified AP is busy. |
Definition at line 604 of file FrameworkMpService.h.
typedef EFI_STATUS(EFIAPI * FRAMEWORK_EFI_MP_SERVICES_STARTUP_ALL_APS) (IN FRAMEWORK_EFI_MP_SERVICES_PROTOCOL *This, IN FRAMEWORK_EFI_AP_PROCEDURE Procedure, IN BOOLEAN SingleThread, IN EFI_EVENT WaitEvent OPTIONAL, IN UINTN TimeoutInMicroSecs, IN VOID *ProcArguments OPTIONAL, OUT UINTN *FailedCPUList OPTIONAL) |
This function is used to dispatch all enabled APs to the function specified by Procedure. APs can run either simultaneously or one by one. The caller can also configure the BSP to either wait for APs or just proceed with the next task. It is the responsibility of the caller of the StartupAllAPs() to make sure that the nature of the code that will be run on the BSP and the dispatched APs is well controlled. The MP Services Protocol does not guarantee that the function that either processor is executing is MP-safe. Hence, the tasks that can be run in parallel are limited to certain independent tasks and well- controlled exclusive code. EFI services and protocols may not be called by APs unless otherwise specified.
[in] | This | The pointer to the FRAMEWORK_EFI_MP_SERVICES_PROTOCOL instance. |
[in] | Procedure | A pointer to the function to be run on enabled APs of the system. |
[in] | SingleThread | Flag that requests APs to execute one at a time or simultaneously.
|
[in] | WaitEvent | Event to signal when APs have finished.
|
[in] | TimeoutInMicroSecs | Time to wait for APs to finish.
|
[in] | ProcArguments | The pointer to the optional parameter of the function specified by Procedure. |
[out] | FailedCPUList | List of APs that did not finish.
|
EFI_SUCCESS | IA32, X64: All dispatched APs have finished before the timeout expires. |
EFI_SUCCESS | IA32, X64: Only 1 logical processor exists in system. |
EFI_INVALID_PARAMETER | IA32, X64: Procedure is NULL. |
EFI_TIMEOUT | IA32, X64: The timeout expires before all dispatched APs have finished. |
EFI_SUCCESS | IPF: This function always returns EFI_SUCCESS. |
Definition at line 459 of file FrameworkMpService.h.
typedef EFI_STATUS(EFIAPI * FRAMEWORK_EFI_MP_SERVICES_STARTUP_THIS_AP) (IN FRAMEWORK_EFI_MP_SERVICES_PROTOCOL *This, IN FRAMEWORK_EFI_AP_PROCEDURE Procedure, IN UINTN ProcessorNumber, IN EFI_EVENT WaitEvent OPTIONAL, IN UINTN TimeoutInMicroSecs, IN OUT VOID *ProcArguments OPTIONAL) |
This function is used to dispatch one enabled AP to the function provided by the caller. The caller can request the BSP to either wait for the AP or just proceed with the next task.
[in] | This | The pointer to the FRAMEWORK_EFI_MP_SERVICES_PROTOCOL instance. |
[in] | Procedure | A pointer to the function to be run on the designated AP. |
[in] | ProcessorNumber | The handle number of AP. The range is from 0 to the total number of logical processors minus 1. The total number of logical processors can be retrieved by GetGeneralMPInfo(). |
[in] | WaitEvent | Event to signal when APs have finished.
|
[in] | TimeoutInMicroSecs | Time to wait for APs to finish.
|
[in] | ProcArguments | The pointer to the optional parameter of the function specified by Procedure. |
EFI_SUCCESS | Specified AP has finished before the timeout expires. |
EFI_TIMEOUT | The timeout expires before specified AP has finished. |
EFI_INVALID_PARAMETER | IA32, X64: Processor with the handle specified by ProcessorNumber does not exist. |
EFI_INVALID_PARAMETER | IA32, X64: Specified AP is busy or disabled. |
EFI_INVALID_PARAMETER | IA32, X64: Procedure is NULL. |
EFI_INVALID_PARAMETER | IA32, X64: ProcessorNumber specifies the BSP |
EFI_NOT_READY | IPF: Specified AP is busy |
EFI_NOT_AVAILABLE_YET | IPF: ProcessorNumber specifies the BSP |
EFI_NOT_AVAILABLE_YET | IPF: Specified AP is disabled. |
EFI_NOT_AVAILABLE_YET | IPF: Specified AP is unhealthy or untested. |
Definition at line 533 of file FrameworkMpService.h.
typedef EFI_STATUS(EFIAPI * FRAMEWORK_EFI_MP_SERVICES_SWITCH_BSP) (IN FRAMEWORK_EFI_MP_SERVICES_PROTOCOL *This, IN UINTN ProcessorNumber, IN BOOLEAN EnableOldBSP) |
This service switches the requested AP to be the BSP from that point onward. The new BSP can take over the execution of the old BSP and continue seamlessly from where the old one left off. This call can only be performed by the current BSP.
[in] | This | The pointer to the FRAMEWORK_EFI_MP_SERVICES_PROTOCOL instance. |
[in] | ProcessorNumber | The handle number of AP. The range is from 0 to the total number of logical processors minus 1. The total number of logical processors can be retrieved by GetGeneralMPInfo(). |
[in] | EnableOldBSP | If TRUE, then the old BSP will be listed as an enabled AP. Otherwise, it will be disabled. |
EFI_SUCCESS | BSP successfully switched. |
EFI_INVALID_PARAMETER | The processor with the handle specified by ProcessorNumber does not exist. |
EFI_INVALID_PARAMETER | ProcessorNumber specifies the BSP. |
EFI_NOT_READY | IA32, X64: Specified AP is busy or disabled. |
EFI_INVALID_PARAMETER | IPF: Specified AP is disabled. |
EFI_INVALID_PARAMETER | IPF: Specified AP is unhealthy or untested. |
EFI_NOT_READY | IPF: Specified AP is busy. |
Definition at line 569 of file FrameworkMpService.h.
typedef EFI_STATUS(EFIAPI * FRAMEWORK_EFI_MP_SERVICES_WHOAMI) (IN FRAMEWORK_EFI_MP_SERVICES_PROTOCOL *This, OUT UINTN *ProcessorNumber) |
This service lets the caller processor get its handle number, with which any processor in the system can be uniquely identified. The range is from 0 to the total number of logical processors minus 1. The total number of logical processors can be retrieved by GetGeneralMPInfo(). This service may be called from the BSP and APs.
[in] | This | The pointer to the FRAMEWORK_EFI_MP_SERVICES_PROTOCOL instance. |
[out] | ProcessorNumber | A pointer to the handle number of AP. The range is from 0 to the total number of logical processors minus 1. The total number of logical processors can be retrieved by GetGeneralMPInfo(). |
EFI_SUCCESS | This function always returns EFI_SUCCESS. |
Definition at line 665 of file FrameworkMpService.h.
enum EFI_CPU_DESIGNATION |
Enumerator | |
---|---|
EfiCpuAP | The CPU is an AP (Application Processor). |
EfiCpuBSP | The CPU is the BSP (Boot-Strap Processor). |
EfiCpuDesignationMaximum |
Definition at line 159 of file FrameworkMpService.h.
|
extern |
Definition at line 139 of file UserGlobalVar.c.