diff options
author | Michael Kinney <michael.d.kinney@intel.com> | 2015-10-30 17:53:53 +0000 |
---|---|---|
committer | Jeff Fan <jeff.fan@intel.com> | 2016-05-25 14:33:36 +0800 |
commit | 2a7b8dc3701a01afc9bd90e136f5b3e4ad55d164 (patch) | |
tree | f4484218dd44c7ba7912336560f17c1248e24daa | |
parent | dd3eba8e1c438d47fcd7b004a1571a0fb25c813b (diff) | |
download | edk2-platforms-2a7b8dc3701a01afc9bd90e136f5b3e4ad55d164.tar.xz |
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
(cherry picked from commit df60fb4cc2ca896fcea9e37b06c276d569f1a6b8)
3 files changed, 3 insertions, 0 deletions
diff --git a/SourceLevelDebugPkg/Library/DebugAgent/DebugAgentCommon/DebugTimer.c b/SourceLevelDebugPkg/Library/DebugAgent/DebugAgentCommon/DebugTimer.c index e287c4cbbe..d01d1ae484 100644 --- a/SourceLevelDebugPkg/Library/DebugAgent/DebugAgentCommon/DebugTimer.c +++ b/SourceLevelDebugPkg/Library/DebugAgent/DebugAgentCommon/DebugTimer.c @@ -32,6 +32,7 @@ InitializeDebugTimer ( UINT32 InitialCount;
UINT32 ApicTimerFrequency;
+ InitializeLocalApicSoftwareEnable (TRUE);
GetApicTimerState (&ApicTimerDivisor, NULL, NULL);
ApicTimerFrequency = PcdGet32(PcdFSBClock) / (UINT32)ApicTimerDivisor;
//
diff --git a/SourceLevelDebugPkg/Library/DebugAgent/DxeDebugAgent/DxeDebugAgentLib.c b/SourceLevelDebugPkg/Library/DebugAgent/DxeDebugAgent/DxeDebugAgentLib.c index 35fb5e6450..a63932c6a7 100644 --- a/SourceLevelDebugPkg/Library/DebugAgent/DxeDebugAgent/DxeDebugAgentLib.c +++ b/SourceLevelDebugPkg/Library/DebugAgent/DxeDebugAgent/DxeDebugAgentLib.c @@ -372,6 +372,7 @@ InitializeDebugAgent ( //
// Check if CPU APIC Timer is working, otherwise initialize it.
//
+ InitializeLocalApicSoftwareEnable (TRUE);
GetApicTimerState (NULL, &PeriodicMode, NULL);
TimerCycle = GetApicTimerInitCount ();
if (!PeriodicMode || TimerCycle == 0) {
diff --git a/SourceLevelDebugPkg/Library/DebugAgent/SmmDebugAgent/SmmDebugAgentLib.c b/SourceLevelDebugPkg/Library/DebugAgent/SmmDebugAgent/SmmDebugAgentLib.c index 3a759f900d..32b1ae6c8f 100644 --- a/SourceLevelDebugPkg/Library/DebugAgent/SmmDebugAgent/SmmDebugAgentLib.c +++ b/SourceLevelDebugPkg/Library/DebugAgent/SmmDebugAgent/SmmDebugAgentLib.c @@ -280,6 +280,7 @@ InitializeDebugAgent ( //
// Check if CPU APIC Timer is working, otherwise initialize it.
//
+ InitializeLocalApicSoftwareEnable (TRUE);
GetApicTimerState (NULL, &PeriodicMode, NULL);
TimerCycle = GetApicTimerInitCount ();
if (!PeriodicMode || TimerCycle == 0) {
|