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
This commit is contained in:
Jeff Fan 2015-05-25 02:48:00 +00:00 committed by vanjeff
parent edbb27132d
commit 86d1365287
6 changed files with 19 additions and 14 deletions

View File

@ -2534,7 +2534,7 @@ InterruptProcess (
// //
CurrentDebugTimerInitCount = GetApicTimerInitCount (); CurrentDebugTimerInitCount = GetApicTimerInitCount ();
if (mDebugMpContext.DebugTimerInitCount != CurrentDebugTimerInitCount) { if (mDebugMpContext.DebugTimerInitCount != CurrentDebugTimerInitCount) {
InitializeDebugTimer (NULL); InitializeDebugTimer (NULL, FALSE);
} }
} }

View File

@ -18,12 +18,14 @@
Initialize CPU local APIC timer. Initialize CPU local APIC timer.
@param[out] TimerFrequency Local APIC timer frequency returned. @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. @return 32-bit Local APIC timer init count.
**/ **/
UINT32 UINT32
InitializeDebugTimer ( InitializeDebugTimer (
OUT UINT32 *TimerFrequency OUT UINT32 *TimerFrequency,
IN BOOLEAN DumpFlag
) )
{ {
UINTN ApicTimerDivisor; UINTN ApicTimerDivisor;
@ -45,11 +47,12 @@ InitializeDebugTimer (
InitializeApicTimer (ApicTimerDivisor, InitialCount, TRUE, DEBUG_TIMER_VECTOR); InitializeApicTimer (ApicTimerDivisor, InitialCount, TRUE, DEBUG_TIMER_VECTOR);
DEBUG ((EFI_D_INFO, "Debug Timer: FSB Clock = %d\n", PcdGet32(PcdFSBClock))); if (DumpFlag) {
DEBUG ((EFI_D_INFO, "Debug Timer: Divisor = %d\n", ApicTimerDivisor)); DEBUG ((EFI_D_INFO, "Debug Timer: FSB Clock = %d\n", PcdGet32(PcdFSBClock)));
DEBUG ((EFI_D_INFO, "Debug Timer: Frequency = %d\n", ApicTimerFrequency)); DEBUG ((EFI_D_INFO, "Debug Timer: Divisor = %d\n", ApicTimerDivisor));
DEBUG ((EFI_D_INFO, "Debug Timer: InitialCount = %d\n", InitialCount)); DEBUG ((EFI_D_INFO, "Debug Timer: Frequency = %d\n", ApicTimerFrequency));
DEBUG ((EFI_D_INFO, "Debug Timer: InitialCount = %d\n", InitialCount));
}
if (TimerFrequency != NULL) { if (TimerFrequency != NULL) {
*TimerFrequency = ApicTimerFrequency; *TimerFrequency = ApicTimerFrequency;
} }

View File

@ -19,12 +19,14 @@
Initialize CPU local APIC timer. Initialize CPU local APIC timer.
@param[out] TimerFrequency Local APIC timer frequency returned. @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. @return 32-bit Local APIC timer init count.
**/ **/
UINT32 UINT32
InitializeDebugTimer ( InitializeDebugTimer (
OUT UINT32 *TimerFrequency OUT UINT32 *TimerFrequency,
IN BOOLEAN DumpFlag
); );
/** /**

View File

@ -306,7 +306,7 @@ SetupDebugAgentEnvironment (
// //
// Initialize Debug Timer hardware and save its initial count and frequency // 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); UpdateMailboxContent (mMailboxPointer, DEBUG_MAILBOX_DEBUG_TIMER_FREQUENCY, DebugTimerFrequency);
// //
// Initialize debug communication port // Initialize debug communication port

View File

@ -403,7 +403,7 @@ InitializeDebugAgent (
// //
// Initialize Debug Timer hardware and save its frequency // Initialize Debug Timer hardware and save its frequency
// //
InitializeDebugTimer (&DebugTimerFrequency); InitializeDebugTimer (&DebugTimerFrequency, TRUE);
UpdateMailboxContent (Mailbox, DEBUG_MAILBOX_DEBUG_TIMER_FREQUENCY, DebugTimerFrequency); UpdateMailboxContent (Mailbox, DEBUG_MAILBOX_DEBUG_TIMER_FREQUENCY, DebugTimerFrequency);
Phase2Context.InitFlag = InitFlag; Phase2Context.InitFlag = InitFlag;
@ -535,7 +535,7 @@ InitializeDebugAgent (
// //
// Initialize Debug Timer hardware and save its frequency // Initialize Debug Timer hardware and save its frequency
// //
InitializeDebugTimer (&DebugTimerFrequency); InitializeDebugTimer (&DebugTimerFrequency, TRUE);
UpdateMailboxContent (Mailbox, DEBUG_MAILBOX_DEBUG_TIMER_FREQUENCY, DebugTimerFrequency); UpdateMailboxContent (Mailbox, DEBUG_MAILBOX_DEBUG_TIMER_FREQUENCY, DebugTimerFrequency);
// //
// Update IDT entry to save the location pointer saved mailbox pointer // Update IDT entry to save the location pointer saved mailbox pointer

View File

@ -242,7 +242,7 @@ InitializeDebugAgent (
// //
// Initialize Debug Timer hardware and save its frequency // Initialize Debug Timer hardware and save its frequency
// //
InitializeDebugTimer (&DebugTimerFrequency); InitializeDebugTimer (&DebugTimerFrequency, TRUE);
UpdateMailboxContent (mMailboxPointer, DEBUG_MAILBOX_DEBUG_TIMER_FREQUENCY, DebugTimerFrequency); UpdateMailboxContent (mMailboxPointer, DEBUG_MAILBOX_DEBUG_TIMER_FREQUENCY, DebugTimerFrequency);
DebugPortHandle = (UINT64) (UINTN)DebugPortInitialize ((DEBUG_PORT_HANDLE) (UINTN)Mailbox->DebugPortHandle, NULL); DebugPortHandle = (UINT64) (UINTN)DebugPortInitialize ((DEBUG_PORT_HANDLE) (UINTN)Mailbox->DebugPortHandle, NULL);
@ -283,7 +283,7 @@ InitializeDebugAgent (
GetApicTimerState (NULL, &PeriodicMode, NULL); GetApicTimerState (NULL, &PeriodicMode, NULL);
TimerCycle = GetApicTimerInitCount (); TimerCycle = GetApicTimerInitCount ();
if (PeriodicMode != TRUE || TimerCycle == 0) { if (PeriodicMode != TRUE || TimerCycle == 0) {
InitializeDebugTimer (NULL); InitializeDebugTimer (NULL, FALSE);
DisableApicTimerInterrupt (); DisableApicTimerInterrupt ();
} }
Mailbox = GetMailboxPointer (); Mailbox = GetMailboxPointer ();
@ -348,7 +348,7 @@ InitializeDebugAgent (
// //
// Initialize Debug Timer hardware and save its frequency // Initialize Debug Timer hardware and save its frequency
// //
InitializeDebugTimer (&DebugTimerFrequency); InitializeDebugTimer (&DebugTimerFrequency, TRUE);
UpdateMailboxContent (mMailboxPointer, DEBUG_MAILBOX_DEBUG_TIMER_FREQUENCY, DebugTimerFrequency); UpdateMailboxContent (mMailboxPointer, DEBUG_MAILBOX_DEBUG_TIMER_FREQUENCY, DebugTimerFrequency);
EnableInterrupts (); EnableInterrupts ();