Revision: 17500
http://sourceforge.net/p/edk2/code/17500
Author: vanjeff
Date: 2015-05-25 02:46:11 +0000 (Mon, 25 May 2015)
Log Message:
-----------
SourceLevelDebugPkg/SmmDebugAgent: Initialize Local APIC Timer
Now Debug Agent library uses Local APIC Timer to implement time-out mechanism.
In SMM, SMM BSP maybe not be the one in DXE phase, its local APIC timer may not
work. This fix is to initialize Local APIC timer if it doesn't work as expected
at SMM entry.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jeff Fan <[email protected]>
Reviewed-by: Ruiyu Ni <[email protected]>
Modified Paths:
--------------
trunk/edk2/SourceLevelDebugPkg/Library/DebugAgent/SmmDebugAgent/SmmDebugAgentLib.c
Modified:
trunk/edk2/SourceLevelDebugPkg/Library/DebugAgent/SmmDebugAgent/SmmDebugAgentLib.c
===================================================================
---
trunk/edk2/SourceLevelDebugPkg/Library/DebugAgent/SmmDebugAgent/SmmDebugAgentLib.c
2015-05-25 02:01:09 UTC (rev 17499)
+++
trunk/edk2/SourceLevelDebugPkg/Library/DebugAgent/SmmDebugAgent/SmmDebugAgentLib.c
2015-05-25 02:46:11 UTC (rev 17500)
@@ -190,6 +190,8 @@
DEBUG_AGENT_MAILBOX *Mailbox;
UINT64 *MailboxLocation;
UINT32 DebugTimerFrequency;
+ BOOLEAN PeriodicMode;
+ UINTN TimerCycle;
switch (InitFlag) {
case DEBUG_AGENT_INIT_SMM:
@@ -275,7 +277,15 @@
case DEBUG_AGENT_INIT_ENTER_SMI:
SaveDebugRegister ();
InitializeDebugIdt ();
-
+ //
+ // Check if CPU APIC Timer is working, otherwise initialize it.
+ //
+ GetApicTimerState (NULL, &PeriodicMode, NULL);
+ TimerCycle = GetApicTimerInitCount ();
+ if (PeriodicMode != TRUE || TimerCycle == 0) {
+ InitializeDebugTimer (NULL);
+ DisableApicTimerInterrupt ();
+ }
Mailbox = GetMailboxPointer ();
if (GetDebugFlag (DEBUG_AGENT_FLAG_AGENT_IN_PROGRESS) == 1) {
//
------------------------------------------------------------------------------
One dashboard for servers and applications across Physical-Virtual-Cloud
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
_______________________________________________
edk2-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-commits