SourceLevelDebugPkg: DebugAgent: Set Local APIC SoftwareEnable

Update DebugAgent to make sure the Local APIC SoftwareEnable bit is set
before using the Local APIC Timer.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Michael Kinney <michael.d.kinney@intel.com>
Reviewed-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18712 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
Michael Kinney 2015-10-30 17:53:53 +00:00 committed by mdkinney
parent 14e4ca25c6
commit df60fb4cc2
3 changed files with 3 additions and 0 deletions

View File

@ -32,6 +32,7 @@ InitializeDebugTimer (
UINT32 InitialCount; UINT32 InitialCount;
UINT32 ApicTimerFrequency; UINT32 ApicTimerFrequency;
InitializeLocalApicSoftwareEnable (TRUE);
GetApicTimerState (&ApicTimerDivisor, NULL, NULL); GetApicTimerState (&ApicTimerDivisor, NULL, NULL);
ApicTimerFrequency = PcdGet32(PcdFSBClock) / (UINT32)ApicTimerDivisor; ApicTimerFrequency = PcdGet32(PcdFSBClock) / (UINT32)ApicTimerDivisor;
// //

View File

@ -372,6 +372,7 @@ InitializeDebugAgent (
// //
// Check if CPU APIC Timer is working, otherwise initialize it. // Check if CPU APIC Timer is working, otherwise initialize it.
// //
InitializeLocalApicSoftwareEnable (TRUE);
GetApicTimerState (NULL, &PeriodicMode, NULL); GetApicTimerState (NULL, &PeriodicMode, NULL);
TimerCycle = GetApicTimerInitCount (); TimerCycle = GetApicTimerInitCount ();
if (!PeriodicMode || TimerCycle == 0) { if (!PeriodicMode || TimerCycle == 0) {

View File

@ -280,6 +280,7 @@ InitializeDebugAgent (
// //
// Check if CPU APIC Timer is working, otherwise initialize it. // Check if CPU APIC Timer is working, otherwise initialize it.
// //
InitializeLocalApicSoftwareEnable (TRUE);
GetApicTimerState (NULL, &PeriodicMode, NULL); GetApicTimerState (NULL, &PeriodicMode, NULL);
TimerCycle = GetApicTimerInitCount (); TimerCycle = GetApicTimerInitCount ();
if (!PeriodicMode || TimerCycle == 0) { if (!PeriodicMode || TimerCycle == 0) {