SourceLevelDebugPkg maintainers,

I noticed what looks like a regression in the SecPeiDebugAgentLib. 
InitializeDebugAgent() calls SaveAndSetDebugTimerInterrupt() before a 
normal return, but it is not called when execution continues via 
InitializeDebugAgentPhase2(), as in the DEBUG_AGENT_INIT_PREMEM_SEC 
case.  The result is that debug timer interrupts are not enabled in PEI, 
so it's impossible to stop execution via the debugger.

A fix is to add a call to SaveAndSetDebugTimerInterrupt() in 
InitializeDebugAgentPhase2(), like the one near the end of 
InitializeDebugAgent():

diff --git 
a/SourceLevelDebugPkg/Library/DebugAgent/SecPeiDebugAgent/SecPeiDebugAgentLib.c 
b/SourceLevelDebugPkg/Library/DebugAgent/SecPeiDebugAgent/SecPeiDebugAgentLib.c
index fcc7a4b..ea75742 100644
--- 
a/SourceLevelDebugPkg/Library/DebugAgent/SecPeiDebugAgent/SecPeiDebugAgentLib.c
+++ 
b/SourceLevelDebugPkg/Library/DebugAgent/SecPeiDebugAgent/SecPeiDebugAgentLib.c
@@ -684,6 +684,10 @@ InitializeDebugAgentPhase2 (
        TriggerSoftInterrupt (MEMORY_READY_SIGNATURE);
      }
      //
+    // Enable Debug Timer interrupt
+    //
+    SaveAndSetDebugTimerInterrupt (TRUE);
+    //
      // Enable CPU interrupts so debug timer interrupts can be delivered
      //
      EnableInterrupts ();

I haven't tried this fix with the stock SourceLevelDebugPkg, but it 
works well in a customized version we use internally.

Thanks,
-- 

                                                Brian J. Johnson

--------------------------------------------------------------------

   My statements are my own, are not authorized by SGI, and do not
   necessarily represent SGI’s positions.

------------------------------------------------------------------------------
Don't Limit Your Business. Reach for the Cloud.
GigeNET's Cloud Solutions provide you with the tools and support that
you need to offload your IT needs and focus on growing your business.
Configured For All Businesses. Start Your Cloud Today.
https://www.gigenetcloud.com/
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/edk2-devel

Reply via email to