TianoCore EDK2 master
Loading...
Searching...
No Matches
DebugMp.h File Reference

Go to the source code of this file.

Data Structures

struct  DEBUG_CPU_DATA
 
struct  DEBUG_MP_CONTEXT
 

Macros

#define DEBUG_CPU_MAX_COUNT   256
 

Functions

VOID HaltOtherProcessors (IN UINT32 CurrentProcessorIndex)
 
UINT32 GetProcessorIndex (VOID)
 
VOID AcquireMpSpinLock (IN OUT SPIN_LOCK *MpSpinLock)
 
VOID ReleaseMpSpinLock (IN OUT SPIN_LOCK *MpSpinLock)
 
BOOLEAN DebugAgentIsBsp (IN UINT32 ProcessorIndex)
 
VOID SetCpuStopFlagByIndex (IN UINT32 ProcessorIndex, IN BOOLEAN StopFlag)
 
VOID SetCpuBreakFlagByIndex (IN UINT32 ProcessorIndex, IN BOOLEAN BreakFlag)
 
BOOLEAN IsCpuStopped (IN UINT32 ProcessorIndex)
 
VOID SetCpuRunningFlag (IN BOOLEAN RunningFlag)
 
VOID SetDebugViewPoint (IN UINT32 ProcessorIndex)
 
VOID SetIpiSentByApFlag (IN BOOLEAN IpiSentByApFlag)
 
UINT32 FindNextPendingBreakCpu (VOID)
 
BOOLEAN IsAllCpuRunning (VOID)
 
BOOLEAN IsFirstBreakProcessor (IN UINT32 ProcessorIndex)
 

Variables

DEBUG_MP_CONTEXT volatile mDebugMpContext
 
DEBUG_CPU_DATA volatile mDebugCpuData
 

Detailed Description

Header file for Multi-Processor support.

Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent

Definition in file DebugMp.h.

Macro Definition Documentation

◆ DEBUG_CPU_MAX_COUNT

#define DEBUG_CPU_MAX_COUNT   256

Definition at line 12 of file DebugMp.h.

Function Documentation

◆ AcquireMpSpinLock()

VOID AcquireMpSpinLock ( IN OUT SPIN_LOCK MpSpinLock)

Acquire a spin lock when Multi-processor supported.

It will block in the function if cannot get the access control. If Multi-processor is not supported, return directly.

Parameters
[in,out]MpSpinLockA pointer to the spin lock.

Definition at line 25 of file DebugMp.c.

◆ DebugAgentIsBsp()

BOOLEAN DebugAgentIsBsp ( IN UINT32  ProcessorIndex)

Check if the specified processor is BSP or not.

Parameters
[in]ProcessorIndexProcessor index value.
Return values
TRUEIt is BSP.
FALSEIt isn't BSP.

Definition at line 134 of file DebugMp.c.

◆ FindNextPendingBreakCpu()

UINT32 FindNextPendingBreakCpu ( VOID  )

Check the next pending breaking CPU.

Return values
othersThere is at least one processor broken, the minimum index number of Processor returned.
-1No any processor broken.

Definition at line 311 of file DebugMp.c.

◆ GetProcessorIndex()

UINT32 GetProcessorIndex ( VOID  )

Get the current processor's index.

Returns
Processor index value.

Definition at line 97 of file DebugMp.c.

◆ HaltOtherProcessors()

VOID HaltOtherProcessors ( IN UINT32  CurrentProcessorIndex)

Break the other processor by send IPI.

Parameters
[in]CurrentProcessorIndexCurrent processor index value.

Definition at line 68 of file DebugMp.c.

◆ IsAllCpuRunning()

BOOLEAN IsAllCpuRunning ( VOID  )

Check if all processors are in running status.

Return values
TRUEAll processors run.
FALSEAt least one processor does not run.

Definition at line 334 of file DebugMp.c.

◆ IsCpuStopped()

BOOLEAN IsCpuStopped ( IN UINT32  ProcessorIndex)

Check if processor is stopped already.

Parameters
[in]ProcessorIndexProcessor index value.
Return values
TRUEProcessor is stopped already.
FALSEProcessor isn't stopped.

Check if processor is stopped already.

Parameters
[in]ProcessorIndexProcessor index value.
Return values
TRUEProcessor is stopped already.
TRUEProcessor isn't stopped.

Definition at line 237 of file DebugMp.c.

◆ IsFirstBreakProcessor()

BOOLEAN IsFirstBreakProcessor ( IN UINT32  ProcessorIndex)

Check if the current processor is the first breaking processor.

If yes, halt other processors.

Parameters
[in]ProcessorIndexProcessor index value.
Returns
TRUE This processor is the first breaking processor.
FALSE This processor is not the first breaking processor.

Definition at line 361 of file DebugMp.c.

◆ ReleaseMpSpinLock()

VOID ReleaseMpSpinLock ( IN OUT SPIN_LOCK MpSpinLock)

Release a spin lock when Multi-processor supported.

Parameters
[in,out]MpSpinLockA pointer to the spin lock.

Definition at line 50 of file DebugMp.c.

◆ SetCpuBreakFlagByIndex()

VOID SetCpuBreakFlagByIndex ( IN UINT32  ProcessorIndex,
IN BOOLEAN  BreakFlag 
)

Set processor break flag bitmask in MP context.

Parameters
[in]ProcessorIndexProcessor index value.
[in]BreakFlagTRUE means set break flag. FALSE means clean break flag.

Definition at line 204 of file DebugMp.c.

◆ SetCpuRunningFlag()

VOID SetCpuRunningFlag ( IN BOOLEAN  RunningFlag)

Set the run command flag.

Parameters
[in]RunningFlagTRUE means run command flag is set. FALSE means run command flag is cleared.

Definition at line 260 of file DebugMp.c.

◆ SetCpuStopFlagByIndex()

VOID SetCpuStopFlagByIndex ( IN UINT32  ProcessorIndex,
IN BOOLEAN  StopFlag 
)

Set processor stop flag bitmask in MP context.

Parameters
[in]ProcessorIndexProcessor index value.
[in]StopFlagTRUE means set stop flag. FALSE means clean break flag.

Definition at line 172 of file DebugMp.c.

◆ SetDebugViewPoint()

VOID SetDebugViewPoint ( IN UINT32  ProcessorIndex)

Set the current view point to be debugged.

Parameters
[in]ProcessorIndexProcessor index value.

Definition at line 276 of file DebugMp.c.

◆ SetIpiSentByApFlag()

VOID SetIpiSentByApFlag ( IN BOOLEAN  IpiSentByApFlag)

Set the IPI send by BPS/AP flag.

Parameters
[in]IpiSentByApFlagTRUE means this IPI is sent by AP. FALSE means this IPI is sent by BSP.

Definition at line 293 of file DebugMp.c.

Variable Documentation

◆ mDebugCpuData

DEBUG_CPU_DATA volatile mDebugCpuData
extern

Definition at line 13 of file DebugMp.c.

◆ mDebugMpContext

DEBUG_MP_CONTEXT volatile mDebugMpContext
extern

Definition at line 11 of file DebugMp.c.