summaryrefslogtreecommitdiffstats
path: root/SourceLevelDebugPkg/Library/DebugAgent
diff options
context:
space:
mode:
authorJeff Fan <jeff.fan@intel.com>2015-05-25 02:48:00 +0000
committervanjeff <vanjeff@Edk2>2015-05-25 02:48:00 +0000
commit86d1365287e606e8ce23c6168d69f470dfd0ebc8 (patch)
treee0fc0e06edcd9484777c8e150ed1e399dc35b789 /SourceLevelDebugPkg/Library/DebugAgent
parentedbb27132d4737be1fa54ea9f6e7657daa2bb72a (diff)
downloadedk2-86d1365287e606e8ce23c6168d69f470dfd0ebc8.tar.gz
edk2-86d1365287e606e8ce23c6168d69f470dfd0ebc8.tar.bz2
edk2-86d1365287e606e8ce23c6168d69f470dfd0ebc8.zip
SourceLevelDebugPkg/DebugTimer: Dump Debug Timer parameter
Add one parameter DumpFlag to indicate if need to dump Local APIC time's parameter. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jeff Fan <jeff.fan@intel.com> Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17501 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'SourceLevelDebugPkg/Library/DebugAgent')
-rw-r--r--SourceLevelDebugPkg/Library/DebugAgent/DebugAgentCommon/DebugAgent.c2
-rw-r--r--SourceLevelDebugPkg/Library/DebugAgent/DebugAgentCommon/DebugTimer.c15
-rw-r--r--SourceLevelDebugPkg/Library/DebugAgent/DebugAgentCommon/DebugTimer.h4
-rw-r--r--SourceLevelDebugPkg/Library/DebugAgent/DxeDebugAgent/DxeDebugAgentLib.c2
-rw-r--r--SourceLevelDebugPkg/Library/DebugAgent/SecPeiDebugAgent/SecPeiDebugAgentLib.c4
-rw-r--r--SourceLevelDebugPkg/Library/DebugAgent/SmmDebugAgent/SmmDebugAgentLib.c6
6 files changed, 19 insertions, 14 deletions
diff --git a/SourceLevelDebugPkg/Library/DebugAgent/DebugAgentCommon/DebugAgent.c b/SourceLevelDebugPkg/Library/DebugAgent/DebugAgentCommon/DebugAgent.c
index 10dd302694..3eca30497f 100644
--- a/SourceLevelDebugPkg/Library/DebugAgent/DebugAgentCommon/DebugAgent.c
+++ b/SourceLevelDebugPkg/Library/DebugAgent/DebugAgentCommon/DebugAgent.c
@@ -2534,7 +2534,7 @@ InterruptProcess (
//
CurrentDebugTimerInitCount = GetApicTimerInitCount ();
if (mDebugMpContext.DebugTimerInitCount != CurrentDebugTimerInitCount) {
- InitializeDebugTimer (NULL);
+ InitializeDebugTimer (NULL, FALSE);
}
}
diff --git a/SourceLevelDebugPkg/Library/DebugAgent/DebugAgentCommon/DebugTimer.c b/SourceLevelDebugPkg/Library/DebugAgent/DebugAgentCommon/DebugTimer.c
index 0a60e7d857..25d6468588 100644
--- a/SourceLevelDebugPkg/Library/DebugAgent/DebugAgentCommon/DebugTimer.c
+++ b/SourceLevelDebugPkg/Library/DebugAgent/DebugAgentCommon/DebugTimer.c
@@ -18,12 +18,14 @@
Initialize CPU local APIC timer.
@param[out] TimerFrequency Local APIC timer frequency returned.
+ @param[in] DumpFlag If TRUE, dump Local APIC timer's parameter.
@return 32-bit Local APIC timer init count.
**/
UINT32
InitializeDebugTimer (
- OUT UINT32 *TimerFrequency
+ OUT UINT32 *TimerFrequency,
+ IN BOOLEAN DumpFlag
)
{
UINTN ApicTimerDivisor;
@@ -45,11 +47,12 @@ InitializeDebugTimer (
InitializeApicTimer (ApicTimerDivisor, InitialCount, TRUE, DEBUG_TIMER_VECTOR);
- DEBUG ((EFI_D_INFO, "Debug Timer: FSB Clock = %d\n", PcdGet32(PcdFSBClock)));
- DEBUG ((EFI_D_INFO, "Debug Timer: Divisor = %d\n", ApicTimerDivisor));
- DEBUG ((EFI_D_INFO, "Debug Timer: Frequency = %d\n", ApicTimerFrequency));
- DEBUG ((EFI_D_INFO, "Debug Timer: InitialCount = %d\n", InitialCount));
-
+ if (DumpFlag) {
+ DEBUG ((EFI_D_INFO, "Debug Timer: FSB Clock = %d\n", PcdGet32(PcdFSBClock)));
+ DEBUG ((EFI_D_INFO, "Debug Timer: Divisor = %d\n", ApicTimerDivisor));
+ DEBUG ((EFI_D_INFO, "Debug Timer: Frequency = %d\n", ApicTimerFrequency));
+ DEBUG ((EFI_D_INFO, "Debug Timer: InitialCount = %d\n", InitialCount));
+ }
if (TimerFrequency != NULL) {
*TimerFrequency = ApicTimerFrequency;
}
diff --git a/SourceLevelDebugPkg/Library/DebugAgent/DebugAgentCommon/DebugTimer.h b/SourceLevelDebugPkg/Library/DebugAgent/DebugAgentCommon/DebugTimer.h
index 021d67e11a..60550d42cf 100644
--- a/SourceLevelDebugPkg/Library/DebugAgent/DebugAgentCommon/DebugTimer.h
+++ b/SourceLevelDebugPkg/Library/DebugAgent/DebugAgentCommon/DebugTimer.h
@@ -19,12 +19,14 @@
Initialize CPU local APIC timer.
@param[out] TimerFrequency Local APIC timer frequency returned.
+ @param[in] DumpFlag If TRUE, dump Local APIC timer's parameter.
@return 32-bit Local APIC timer init count.
**/
UINT32
InitializeDebugTimer (
- OUT UINT32 *TimerFrequency
+ OUT UINT32 *TimerFrequency,
+ IN BOOLEAN DumpFlag
);
/**
diff --git a/SourceLevelDebugPkg/Library/DebugAgent/DxeDebugAgent/DxeDebugAgentLib.c b/SourceLevelDebugPkg/Library/DebugAgent/DxeDebugAgent/DxeDebugAgentLib.c
index 8fa0f5c545..aaf342e0ba 100644
--- a/SourceLevelDebugPkg/Library/DebugAgent/DxeDebugAgent/DxeDebugAgentLib.c
+++ b/SourceLevelDebugPkg/Library/DebugAgent/DxeDebugAgent/DxeDebugAgentLib.c
@@ -306,7 +306,7 @@ SetupDebugAgentEnvironment (
//
// Initialize Debug Timer hardware and save its initial count and frequency
//
- mDebugMpContext.DebugTimerInitCount = InitializeDebugTimer (&DebugTimerFrequency);
+ mDebugMpContext.DebugTimerInitCount = InitializeDebugTimer (&DebugTimerFrequency, TRUE);
UpdateMailboxContent (mMailboxPointer, DEBUG_MAILBOX_DEBUG_TIMER_FREQUENCY, DebugTimerFrequency);
//
// Initialize debug communication port
diff --git a/SourceLevelDebugPkg/Library/DebugAgent/SecPeiDebugAgent/SecPeiDebugAgentLib.c b/SourceLevelDebugPkg/Library/DebugAgent/SecPeiDebugAgent/SecPeiDebugAgentLib.c
index f71ddadb1a..fba41eecb7 100644
--- a/SourceLevelDebugPkg/Library/DebugAgent/SecPeiDebugAgent/SecPeiDebugAgentLib.c
+++ b/SourceLevelDebugPkg/Library/DebugAgent/SecPeiDebugAgent/SecPeiDebugAgentLib.c
@@ -403,7 +403,7 @@ InitializeDebugAgent (
//
// Initialize Debug Timer hardware and save its frequency
//
- InitializeDebugTimer (&DebugTimerFrequency);
+ InitializeDebugTimer (&DebugTimerFrequency, TRUE);
UpdateMailboxContent (Mailbox, DEBUG_MAILBOX_DEBUG_TIMER_FREQUENCY, DebugTimerFrequency);
Phase2Context.InitFlag = InitFlag;
@@ -535,7 +535,7 @@ InitializeDebugAgent (
//
// Initialize Debug Timer hardware and save its frequency
//
- InitializeDebugTimer (&DebugTimerFrequency);
+ InitializeDebugTimer (&DebugTimerFrequency, TRUE);
UpdateMailboxContent (Mailbox, DEBUG_MAILBOX_DEBUG_TIMER_FREQUENCY, DebugTimerFrequency);
//
// Update IDT entry to save the location pointer saved mailbox pointer
diff --git a/SourceLevelDebugPkg/Library/DebugAgent/SmmDebugAgent/SmmDebugAgentLib.c b/SourceLevelDebugPkg/Library/DebugAgent/SmmDebugAgent/SmmDebugAgentLib.c
index 544067b4d6..72db534844 100644
--- a/SourceLevelDebugPkg/Library/DebugAgent/SmmDebugAgent/SmmDebugAgentLib.c
+++ b/SourceLevelDebugPkg/Library/DebugAgent/SmmDebugAgent/SmmDebugAgentLib.c
@@ -242,7 +242,7 @@ InitializeDebugAgent (
//
// Initialize Debug Timer hardware and save its frequency
//
- InitializeDebugTimer (&DebugTimerFrequency);
+ InitializeDebugTimer (&DebugTimerFrequency, TRUE);
UpdateMailboxContent (mMailboxPointer, DEBUG_MAILBOX_DEBUG_TIMER_FREQUENCY, DebugTimerFrequency);
DebugPortHandle = (UINT64) (UINTN)DebugPortInitialize ((DEBUG_PORT_HANDLE) (UINTN)Mailbox->DebugPortHandle, NULL);
@@ -283,7 +283,7 @@ InitializeDebugAgent (
GetApicTimerState (NULL, &PeriodicMode, NULL);
TimerCycle = GetApicTimerInitCount ();
if (PeriodicMode != TRUE || TimerCycle == 0) {
- InitializeDebugTimer (NULL);
+ InitializeDebugTimer (NULL, FALSE);
DisableApicTimerInterrupt ();
}
Mailbox = GetMailboxPointer ();
@@ -348,7 +348,7 @@ InitializeDebugAgent (
//
// Initialize Debug Timer hardware and save its frequency
//
- InitializeDebugTimer (&DebugTimerFrequency);
+ InitializeDebugTimer (&DebugTimerFrequency, TRUE);
UpdateMailboxContent (mMailboxPointer, DEBUG_MAILBOX_DEBUG_TIMER_FREQUENCY, DebugTimerFrequency);
EnableInterrupts ();