TianoCore EDK2 master
|
#include <Protocol/Cpu.h>
#include <Protocol/MpService.h>
#include <Library/BaseLib.h>
#include <Library/UefiLib.h>
Go to the source code of this file.
Data Structures | |
struct | CPU_AP_DATA |
struct | CPU_MP_DATA |
Macros | |
#define | AP_STACK_SIZE 0x1000 |
Functions | |
VOID | ApEntryPoint (VOID) |
VOID | ApProcedure (VOID) |
STATIC EFI_STATUS EFIAPI | DispatchCpu (IN UINTN ProcessorIndex) |
STATIC BOOLEAN | IsProcessorBSP (UINTN ProcessorIndex) |
STATIC BOOLEAN | IsCurrentProcessorBSP (VOID) |
STATIC BOOLEAN | IsProcessorEnabled (UINTN ProcessorIndex) |
STATIC VOID | SetApProcedure (IN CPU_AP_DATA *CpuData, IN EFI_AP_PROCEDURE Procedure, IN VOID *ProcedureArgument) |
CPU_STATE | GetApState (IN CPU_AP_DATA *CpuData) |
STATIC EFI_STATUS | GetNextBlockedNumber (OUT UINTN *NextNumber) |
STATIC UINTN | CalculateAndStallInterval (IN UINTN Timeout) |
STATIC VOID | StartupAllAPsPrepareState (IN BOOLEAN SingleThread) |
STATIC EFI_STATUS | StartupAllAPsWithWaitEvent (IN EFI_AP_PROCEDURE Procedure, IN VOID *ProcedureArgument, IN EFI_EVENT WaitEvent, IN UINTN TimeoutInMicroseconds, IN BOOLEAN SingleThread, IN UINTN **FailedCpuList) |
STATIC EFI_STATUS | StartupAllAPsNoWaitEvent (IN EFI_AP_PROCEDURE Procedure, IN VOID *ProcedureArgument, IN UINTN TimeoutInMicroseconds, IN BOOLEAN SingleThread, IN UINTN **FailedCpuList) |
STATIC VOID | AddProcessorToFailedList (UINTN ProcessorIndex, CPU_STATE ApState) |
STATIC VOID | ProcessStartupAllAPsTimeout (VOID) |
STATIC VOID EFIAPI | CheckAllAPsStatus (IN EFI_EVENT Event, IN VOID *Context) |
STATIC VOID EFIAPI | CheckThisAPStatus (IN EFI_EVENT Event, IN VOID *Context) |
STATIC EFI_STATUS | FillInProcessorInformation (IN BOOLEAN BSP, IN UINTN Mpidr, IN UINTN ProcessorIndex) |
STATIC VOID EFIAPI | ReadyToBootSignaled (IN EFI_EVENT Event, IN VOID *Context) |
Copyright (c) 2022, Qualcomm Innovation Center, Inc. All rights reserved.
Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.
Portions copyright (c) 2011, Apple Inc. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file MpServicesInternal.h.
#define AP_STACK_SIZE 0x1000 |
Definition at line 20 of file MpServicesInternal.h.
enum CPU_STATE |
Definition at line 33 of file MpServicesInternal.h.
Adds the specified processor the list of failed processors.
ProcessorIndex | The processor index to add. |
ApState | Processor state. |
Definition at line 985 of file ArmPsciMpServicesDxe.c.
VOID ApEntryPoint | ( | VOID | ) |
Secondary core entry point.
VOID ApProcedure | ( | VOID | ) |
C entry-point for the AP. This function gets called from the assembly function ApEntryPoint.
Definition at line 1531 of file ArmPsciMpServicesDxe.c.
Stalls the BSP for the minimum of gPollInterval and Timeout.
[in] | Timeout | The time limit in microseconds remaining for APs to return from Procedure. |
StallTime | Time of execution stall. |
Stalls the BSP for the minimum of POLL_INTERVAL_US and Timeout.
[in] | Timeout | The time limit in microseconds remaining for APs to return from Procedure. |
StallTime | Time of execution stall. |
Calculated and stalled the interval time by BSP to check whether the APs have finished.
[in] | Timeout | The time limit in microseconds for APs to return from Procedure. |
StallTime | Time of execution stall. |
Definition at line 217 of file ArmPsciMpServicesDxe.c.
If a timeout is specified in StartupAllAps(), a timer is set, which invokes this procedure periodically to check whether all APs have finished.
[in] | Event | The WaitEvent the user supplied. |
[in] | Context | The event context. |
Definition at line 1123 of file ArmPsciMpServicesDxe.c.
Invoked periodically via a timer to check the state of the processor.
Event | The event supplied by the timer expiration. |
Context | The processor context. |
Definition at line 1176 of file ArmPsciMpServicesDxe.c.
STATIC EFI_STATUS EFIAPI DispatchCpu | ( | IN UINTN | ProcessorIndex | ) |
Turns on the specified core using PSCI and executes the user-supplied function that's been configured via a previous call to SetApProcedure.
ProcessorIndex | The index of the core to turn on. |
EFI_SUCCESS | The processor was successfully turned on. |
EFI_DEVICE_ERROR | An error occurred turning the processor on. |
Turns on the specified core using PSCI and executes the user-supplied function that's been configured via a previous call to SetApProcedure.
ProcessorIndex | The index of the core to turn on. |
EFI_SUCCESS | Success. |
EFI_DEVICE_ERROR | The processor could not be turned on. |
Definition at line 83 of file ArmPsciMpServicesDxe.c.
STATIC EFI_STATUS FillInProcessorInformation | ( | IN BOOLEAN | BSP, |
IN UINTN | Mpidr, | ||
IN UINTN | ProcessorIndex | ||
) |
This function is called by all processors (both BSP and AP) once and collects MP related data.
BSP | TRUE if the processor is the BSP. |
Mpidr | The MPIDR for the specified processor. This should be the full MPIDR and not only the affinity bits. |
ProcessorIndex | The index of the processor. |
Definition at line 1231 of file ArmPsciMpServicesDxe.c.
CPU_STATE GetApState | ( | IN CPU_AP_DATA * | CpuData | ) |
Get the Application Processors state.
[in] | CpuData | The pointer to CPU_AP_DATA of specified AP |
Get the Application Processors state.
[in] | CpuData | The pointer to CPU_AP_DATA of specified AP. |
Definition at line 142 of file ArmPsciMpServicesDxe.c.
STATIC EFI_STATUS GetNextBlockedNumber | ( | OUT UINTN * | NextNumber | ) |
Returns the index of the next processor that is blocked.
[out] | NextNumber | The index of the next blocked processor. |
EFI_SUCCESS | Successfully found the next blocked processor. |
EFI_NOT_FOUND | There are no blocked processors. |
Definition at line 182 of file ArmPsciMpServicesDxe.c.
STATIC BOOLEAN IsCurrentProcessorBSP | ( | VOID | ) |
Returns whether the processor executing this function is the BSP.
Definition at line 1575 of file ArmPsciMpServicesDxe.c.
Returns whether the specified processor is the BSP.
[in] | ProcessorIndex | The index the processor to check. |
Definition at line 124 of file ArmPsciMpServicesDxe.c.
Returns whether the specified processor is enabled.
[in] | ProcessorIndex | The index of the processor to check. |
Definition at line 1599 of file ArmPsciMpServicesDxe.c.
STATIC VOID ProcessStartupAllAPsTimeout | ( | VOID | ) |
Handles the StartupAllAPs case where the timeout has occurred.
Definition at line 1022 of file ArmPsciMpServicesDxe.c.
Event notification function called when the EFI_EVENT_GROUP_READY_TO_BOOT is signaled. After this point, non-blocking mode is no longer allowed.
Event | Event whose notification function is being invoked. |
Context | The pointer to the notification function's context, which is implementation-dependent. |
Definition at line 1397 of file ArmPsciMpServicesDxe.c.
STATIC VOID SetApProcedure | ( | IN CPU_AP_DATA * | CpuData, |
IN EFI_AP_PROCEDURE | Procedure, | ||
IN VOID * | ProcedureArgument | ||
) |
Configures the processor context with the user-supplied procedure and argument.
CpuData | The processor context. |
Procedure | The user-supplied procedure. |
ProcedureArgument | The user-supplied procedure argument. |
Definition at line 159 of file ArmPsciMpServicesDxe.c.
STATIC EFI_STATUS StartupAllAPsNoWaitEvent | ( | IN EFI_AP_PROCEDURE | Procedure, |
IN VOID * | ProcedureArgument, | ||
IN UINTN | TimeoutInMicroseconds, | ||
IN BOOLEAN | SingleThread, | ||
IN UINTN ** | FailedCpuList | ||
) |
Handles execution of StartupAllAPs when no wait event has been specified.
Procedure | The user-supplied procedure. |
ProcedureArgument | The user-supplied procedure argument. |
TimeoutInMicroseconds | The timeout for the work to be completed. Zero indicates an infinite timeout. |
SingleThread | Whether the APs will execute sequentially. |
FailedCpuList | User-supplied pointer for list of failed CPUs. |
Definition at line 1765 of file ArmPsciMpServicesDxe.c.
Sets up the state for the StartupAllAPs function.
SingleThread | Whether the APs will execute sequentially. |
Definition at line 1617 of file ArmPsciMpServicesDxe.c.
STATIC EFI_STATUS StartupAllAPsWithWaitEvent | ( | IN EFI_AP_PROCEDURE | Procedure, |
IN VOID * | ProcedureArgument, | ||
IN EFI_EVENT | WaitEvent, | ||
IN UINTN | TimeoutInMicroseconds, | ||
IN BOOLEAN | SingleThread, | ||
IN UINTN ** | FailedCpuList | ||
) |
Handles execution of StartupAllAPs when a WaitEvent has been specified.
Procedure | The user-supplied procedure. |
ProcedureArgument | The user-supplied procedure argument. |
WaitEvent | The wait event to be signaled when the work is complete or a timeout has occurred. |
TimeoutInMicroseconds | The timeout for the work to be completed. Zero indicates an infinite timeout. |
SingleThread | Whether the APs will execute sequentially. |
FailedCpuList | User-supplied pointer for list of failed CPUs. |
Definition at line 1692 of file ArmPsciMpServicesDxe.c.