#include <Library/DebugLib.h>\r
#include <Library/BaseMemoryLib.h>\r
#include <Library/CpuExceptionHandlerLib.h>\r
+#include <Library/DebugAgentLib.h>\r
#include "CommonHeader.h"\r
\r
-#define EXCEPTION_VECTOR_NUMBER 0x20\r
+#define EXCEPTION_VECTOR_NUMBER 0x22\r
\r
/**\r
The X64 entrypoint is used to process capsule in long mode then\r
// Setup the default CPU exception handlers\r
//\r
SetupCpuExceptionHandlers (); \r
+ \r
+ //\r
+ // Initialize Debug Agent to support source level debug\r
+ //\r
+ InitializeDebugAgent (DEBUG_AGENT_INIT_THUNK_PEI_IA32TOX64, (VOID *) &Ia32Idtr, NULL);\r
\r
//\r
// Call CapsuleDataCoalesce to process capsule.\r
\r
ReturnContext->ReturnStatus = Status;\r
\r
+ //\r
+ // Disable interrupt of Debug timer, since the new IDT table cannot work in long mode\r
+ //\r
+ SaveAndSetDebugTimerInterrupt (FALSE);\r
//\r
// Restore IA32 IDT table\r
//\r