From df60fb4cc2ca896fcea9e37b06c276d569f1a6b8 Mon Sep 17 00:00:00 2001 From: Michael Kinney Date: Fri, 30 Oct 2015 17:53:53 +0000 Subject: [PATCH] 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 Reviewed-by: Hao Wu Reviewed-by: Jeff Fan git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18712 6f19259b-4bc3-4df7-8a09-765794883524 --- .../Library/DebugAgent/DebugAgentCommon/DebugTimer.c | 1 + .../Library/DebugAgent/DxeDebugAgent/DxeDebugAgentLib.c | 1 + .../Library/DebugAgent/SmmDebugAgent/SmmDebugAgentLib.c | 1 + 3 files changed, 3 insertions(+) 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) { -- 2.39.2