]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/CapsulePei/X64/X64Entry.c
1. Add debug init flag DEBUG_AGENT_INIT_THUNK_PEI_IA32TOX64 in Debug Agent Library.
[mirror_edk2.git] / MdeModulePkg / Universal / CapsulePei / X64 / X64Entry.c
index fa29e3dbfb561a5187d3a197b1032abe7b69f9c1..56913e6b03b8d420ceeed77e80bc5593c72c0cc0 100644 (file)
@@ -15,9 +15,10 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #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
@@ -58,6 +59,11 @@ _ModuleEntryPoint (
   // 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
@@ -71,6 +77,10 @@ _ModuleEntryPoint (
   \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