From 2befbc82ccd6ebbba35bafe21f6ab929ef2cff31 Mon Sep 17 00:00:00 2001 From: Jeff Fan Date: Mon, 8 Jun 2015 06:36:41 +0000 Subject: SourceLevelDebugPkg/DebugAgent: Disable Debug Timer as early InitializeApicTimer() will enable Local APIC timer interrupt. Even though we disable CPU interrupt at the beginning and enable CPU Interrupt after debug agent initialized completely, some Boot Service may invoke RestoreTpl () which may enable CPU interrupt. We should disable Local APIC timer in InitializeDebugTimer () to avoid Debug Timer interrupt happens during debug port and debug agent initialization phase. And enable Debug Timer interrupt after debug agent is initialized. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jeff Fan Reviewed-by: Ruiyu Ni git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17572 6f19259b-4bc3-4df7-8a09-765794883524 --- .../Library/DebugAgent/DxeDebugAgent/DxeDebugAgentLib.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'SourceLevelDebugPkg/Library/DebugAgent/DxeDebugAgent') diff --git a/SourceLevelDebugPkg/Library/DebugAgent/DxeDebugAgent/DxeDebugAgentLib.c b/SourceLevelDebugPkg/Library/DebugAgent/DxeDebugAgent/DxeDebugAgentLib.c index aaf342e0ba..56a5e1a170 100644 --- a/SourceLevelDebugPkg/Library/DebugAgent/DxeDebugAgent/DxeDebugAgentLib.c +++ b/SourceLevelDebugPkg/Library/DebugAgent/DxeDebugAgent/DxeDebugAgentLib.c @@ -428,6 +428,10 @@ InitializeDebugAgent ( // InternalConstructorWorker (); // + // Enable Debug Timer interrupt + // + SaveAndSetDebugTimerInterrupt (TRUE); + // // Enable interrupt to receive Debug Timer interrupt // EnableInterrupts (); @@ -482,6 +486,10 @@ InitializeDebugAgent ( // SetupDebugAgentEnvironment (Mailbox); // + // Enable Debug Timer interrupt + // + SaveAndSetDebugTimerInterrupt (TRUE); + // // Enable interrupt to receive Debug Timer interrupt // EnableInterrupts (); -- cgit v1.2.3