summaryrefslogtreecommitdiffstats
path: root/SourceLevelDebugPkg/Library/DebugAgent/DebugAgentCommon/DebugMp.c
diff options
context:
space:
mode:
authorMichael Kubacki <michael.kubacki@microsoft.com>2021-12-05 14:54:15 -0800
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2021-12-07 17:24:28 +0000
commitc1e126b1196de75e0a4cda21e4551ea9bb05e059 (patch)
treeda0e06602097dc7bb7e5a97a270d1834b6cf76e7 /SourceLevelDebugPkg/Library/DebugAgent/DebugAgentCommon/DebugMp.c
parentb87864896714cf3062a7bc6d577d8fbd62d105e5 (diff)
downloadedk2-c1e126b1196de75e0a4cda21e4551ea9bb05e059.tar.gz
edk2-c1e126b1196de75e0a4cda21e4551ea9bb05e059.tar.bz2
edk2-c1e126b1196de75e0a4cda21e4551ea9bb05e059.zip
SourceLevelDebugPkg: Apply uncrustify changes
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3737 Apply uncrustify changes to .c/.h files in the SourceLevelDebugPkg package Cc: Andrew Fish <afish@apple.com> Cc: Leif Lindholm <leif@nuviainc.com> Cc: Michael D Kinney <michael.d.kinney@intel.com> Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com> Reviewed-by: Hao A Wu <hao.a.wu@intel.com> Reviewed-by: Ray Ni <ray.ni@intel.com>
Diffstat (limited to 'SourceLevelDebugPkg/Library/DebugAgent/DebugAgentCommon/DebugMp.c')
-rw-r--r--SourceLevelDebugPkg/Library/DebugAgent/DebugAgentCommon/DebugMp.c79
1 files changed, 42 insertions, 37 deletions
diff --git a/SourceLevelDebugPkg/Library/DebugAgent/DebugAgentCommon/DebugMp.c b/SourceLevelDebugPkg/Library/DebugAgent/DebugAgentCommon/DebugMp.c
index 16c4595b82..89f922aba0 100644
--- a/SourceLevelDebugPkg/Library/DebugAgent/DebugAgentCommon/DebugMp.c
+++ b/SourceLevelDebugPkg/Library/DebugAgent/DebugAgentCommon/DebugMp.c
@@ -8,9 +8,9 @@
#include "DebugAgent.h"
-GLOBAL_REMOVE_IF_UNREFERENCED DEBUG_MP_CONTEXT volatile mDebugMpContext = {0,0,0,{0},{0},0,0,0,0,FALSE,FALSE};
+GLOBAL_REMOVE_IF_UNREFERENCED DEBUG_MP_CONTEXT volatile mDebugMpContext = { 0, 0, 0, { 0 }, { 0 }, 0, 0, 0, 0, FALSE, FALSE };
-GLOBAL_REMOVE_IF_UNREFERENCED DEBUG_CPU_DATA volatile mDebugCpuData = {0};
+GLOBAL_REMOVE_IF_UNREFERENCED DEBUG_CPU_DATA volatile mDebugCpuData = { 0 };
/**
Acquire a spin lock when Multi-processor supported.
@@ -23,10 +23,10 @@ GLOBAL_REMOVE_IF_UNREFERENCED DEBUG_CPU_DATA volatile mDebugCpuData = {0};
**/
VOID
AcquireMpSpinLock (
- IN OUT SPIN_LOCK *MpSpinLock
+ IN OUT SPIN_LOCK *MpSpinLock
)
{
- if (!MultiProcessorDebugSupport()) {
+ if (!MultiProcessorDebugSupport ()) {
return;
}
@@ -34,6 +34,7 @@ AcquireMpSpinLock (
if (AcquireSpinLockOrFail (MpSpinLock)) {
break;
}
+
CpuPause ();
continue;
}
@@ -47,10 +48,10 @@ AcquireMpSpinLock (
**/
VOID
ReleaseMpSpinLock (
- IN OUT SPIN_LOCK *MpSpinLock
+ IN OUT SPIN_LOCK *MpSpinLock
)
{
- if (!MultiProcessorDebugSupport()) {
+ if (!MultiProcessorDebugSupport ()) {
return;
}
@@ -65,12 +66,12 @@ ReleaseMpSpinLock (
**/
VOID
HaltOtherProcessors (
- IN UINT32 CurrentProcessorIndex
+ IN UINT32 CurrentProcessorIndex
)
{
DebugAgentMsgPrint (DEBUG_AGENT_INFO, "processor[%x]:Try to halt other processors.\n", CurrentProcessorIndex);
if (!DebugAgentIsBsp (CurrentProcessorIndex)) {
- SetIpiSentByApFlag (TRUE);;
+ SetIpiSentByApFlag (TRUE);
}
mDebugMpContext.BreakAtCpuIndex = CurrentProcessorIndex;
@@ -84,7 +85,6 @@ HaltOtherProcessors (
// Send fixed IPI to other processors.
//
SendFixedIpiAllExcludingSelf (DEBUG_TIMER_VECTOR);
-
}
/**
@@ -98,14 +98,14 @@ GetProcessorIndex (
VOID
)
{
- UINT32 Index;
- UINT16 LocalApicID;
+ UINT32 Index;
+ UINT16 LocalApicID;
- LocalApicID = (UINT16) GetApicId ();
+ LocalApicID = (UINT16)GetApicId ();
AcquireMpSpinLock (&mDebugMpContext.MpContextSpinLock);
- for (Index = 0; Index < mDebugCpuData.CpuCount; Index ++) {
+ for (Index = 0; Index < mDebugCpuData.CpuCount; Index++) {
if (mDebugCpuData.ApicID[Index] == LocalApicID) {
break;
}
@@ -113,7 +113,7 @@ GetProcessorIndex (
if (Index == mDebugCpuData.CpuCount) {
mDebugCpuData.ApicID[Index] = LocalApicID;
- mDebugCpuData.CpuCount ++ ;
+ mDebugCpuData.CpuCount++;
}
ReleaseMpSpinLock (&mDebugMpContext.MpContextSpinLock);
@@ -153,6 +153,7 @@ DebugAgentIsBsp (
mDebugMpContext.BspIndex = ProcessorIndex;
ReleaseMpSpinLock (&mDebugMpContext.MpContextSpinLock);
}
+
return TRUE;
} else {
return FALSE;
@@ -169,12 +170,12 @@ DebugAgentIsBsp (
**/
VOID
SetCpuStopFlagByIndex (
- IN UINT32 ProcessorIndex,
- IN BOOLEAN StopFlag
+ IN UINT32 ProcessorIndex,
+ IN BOOLEAN StopFlag
)
{
- UINT8 Value;
- UINTN Index;
+ UINT8 Value;
+ UINTN Index;
AcquireMpSpinLock (&mDebugMpContext.MpContextSpinLock);
@@ -185,6 +186,7 @@ SetCpuStopFlagByIndex (
} else {
Value = BitFieldWrite8 (Value, Index, Index, 0);
}
+
mDebugMpContext.CpuStopStatusMask[ProcessorIndex / 8] = Value;
ReleaseMpSpinLock (&mDebugMpContext.MpContextSpinLock);
@@ -200,12 +202,12 @@ SetCpuStopFlagByIndex (
**/
VOID
SetCpuBreakFlagByIndex (
- IN UINT32 ProcessorIndex,
- IN BOOLEAN BreakFlag
+ IN UINT32 ProcessorIndex,
+ IN BOOLEAN BreakFlag
)
{
- UINT8 Value;
- UINTN Index;
+ UINT8 Value;
+ UINTN Index;
AcquireMpSpinLock (&mDebugMpContext.MpContextSpinLock);
@@ -216,6 +218,7 @@ SetCpuBreakFlagByIndex (
} else {
Value = BitFieldWrite8 (Value, Index, Index, 0);
}
+
mDebugMpContext.CpuBreakMask[ProcessorIndex / 8] = Value;
ReleaseMpSpinLock (&mDebugMpContext.MpContextSpinLock);
@@ -232,12 +235,12 @@ SetCpuBreakFlagByIndex (
**/
BOOLEAN
IsCpuStopped (
- IN UINT32 ProcessorIndex
+ IN UINT32 ProcessorIndex
)
{
- UINT8 CpuMask;
+ UINT8 CpuMask;
- CpuMask = (UINT8) (1 << (ProcessorIndex % 8));
+ CpuMask = (UINT8)(1 << (ProcessorIndex % 8));
if ((mDebugMpContext.CpuStopStatusMask[ProcessorIndex / 8] & CpuMask) != 0) {
return TRUE;
@@ -255,7 +258,7 @@ IsCpuStopped (
**/
VOID
SetCpuRunningFlag (
- IN BOOLEAN RunningFlag
+ IN BOOLEAN RunningFlag
)
{
AcquireMpSpinLock (&mDebugMpContext.MpContextSpinLock);
@@ -271,7 +274,7 @@ SetCpuRunningFlag (
**/
VOID
SetDebugViewPoint (
- IN UINT32 ProcessorIndex
+ IN UINT32 ProcessorIndex
)
{
AcquireMpSpinLock (&mDebugMpContext.MpContextSpinLock);
@@ -288,7 +291,7 @@ SetDebugViewPoint (
**/
VOID
SetIpiSentByApFlag (
- IN BOOLEAN IpiSentByApFlag
+ IN BOOLEAN IpiSentByApFlag
)
{
AcquireMpSpinLock (&mDebugMpContext.MpContextSpinLock);
@@ -309,13 +312,14 @@ FindNextPendingBreakCpu (
VOID
)
{
- UINT32 Index;
+ UINT32 Index;
- for (Index = 0; Index < DEBUG_CPU_MAX_COUNT / 8; Index ++) {
+ for (Index = 0; Index < DEBUG_CPU_MAX_COUNT / 8; Index++) {
if (mDebugMpContext.CpuBreakMask[Index] != 0) {
- return (UINT32) LowBitSet32 (mDebugMpContext.CpuBreakMask[Index]) + Index * 8;
+ return (UINT32)LowBitSet32 (mDebugMpContext.CpuBreakMask[Index]) + Index * 8;
}
}
+
return (UINT32)-1;
}
@@ -331,13 +335,14 @@ IsAllCpuRunning (
VOID
)
{
- UINTN Index;
+ UINTN Index;
- for (Index = 0; Index < DEBUG_CPU_MAX_COUNT / 8; Index ++) {
+ for (Index = 0; Index < DEBUG_CPU_MAX_COUNT / 8; Index++) {
if (mDebugMpContext.CpuStopStatusMask[Index] != 0) {
return FALSE;
}
}
+
return TRUE;
}
@@ -354,11 +359,11 @@ IsAllCpuRunning (
**/
BOOLEAN
IsFirstBreakProcessor (
- IN UINT32 ProcessorIndex
+ IN UINT32 ProcessorIndex
)
{
- if (MultiProcessorDebugSupport()) {
- if (mDebugMpContext.BreakAtCpuIndex != (UINT32) -1) {
+ if (MultiProcessorDebugSupport ()) {
+ if (mDebugMpContext.BreakAtCpuIndex != (UINT32)-1) {
//
// The current processor is not the first breaking one.
//
@@ -372,6 +377,6 @@ IsFirstBreakProcessor (
return TRUE;
}
}
+
return TRUE;
}
-