#ifndef __DEBUG_AGENT_LIB_H__\r
#define __DEBUG_AGENT_LIB_H__\r
\r
-#define DEBUG_AGENT_INIT_PREMEM_SEC 1\r
-#define DEBUG_AGENT_INIT_POSTMEM_SEC 2\r
-#define DEBUG_AGENT_INIT_DXE_CORE 3\r
-#define DEBUG_AGENT_INIT_SMM 4\r
-#define DEBUG_AGENT_INIT_ENTER_SMI 5\r
-#define DEBUG_AGENT_INIT_EXIT_SMI 6\r
-#define DEBUG_AGENT_INIT_S3 7\r
-#define DEBUG_AGENT_INIT_DXE_AP 8\r
-#define DEBUG_AGENT_INIT_PEI 9\r
-#define DEBUG_AGENT_INIT_DXE_LOAD 10\r
-#define DEBUG_AGENT_INIT_DXE_UNLOAD 11\r
+#define DEBUG_AGENT_INIT_PREMEM_SEC 1\r
+#define DEBUG_AGENT_INIT_POSTMEM_SEC 2\r
+#define DEBUG_AGENT_INIT_DXE_CORE 3\r
+#define DEBUG_AGENT_INIT_SMM 4\r
+#define DEBUG_AGENT_INIT_ENTER_SMI 5\r
+#define DEBUG_AGENT_INIT_EXIT_SMI 6\r
+#define DEBUG_AGENT_INIT_S3 7\r
+#define DEBUG_AGENT_INIT_DXE_AP 8\r
+#define DEBUG_AGENT_INIT_PEI 9\r
+#define DEBUG_AGENT_INIT_DXE_LOAD 10\r
+#define DEBUG_AGENT_INIT_DXE_UNLOAD 11\r
+#define DEBUG_AGENT_INIT_THUNK_PEI_IA32TOX64 12\r
\r
//\r
// Context for DEBUG_AGENT_INIT_POSTMEM_SEC\r
UINTN TempStackTop;\r
UINTN TempStack[0x10];\r
UINTN AsmTransferControl16Address;\r
+ IA32_DESCRIPTOR IdtDescriptor;\r
\r
//\r
// Disable interrupt of Debug timer, since new IDT table cannot handle it.\r
//\r
SaveAndSetDebugTimerInterrupt (FALSE);\r
\r
+ AsmReadIdtr (&IdtDescriptor);\r
//\r
// Restore IDT for debug\r
//\r
SetIdtEntry (AcpiS3Context);\r
\r
//\r
- // Initialize Debug Agent to support source level debug in S3 path.\r
+ // Initialize Debug Agent to support source level debug in S3 path, it will disable interrupt and Debug Timer.\r
//\r
- InitializeDebugAgent (DEBUG_AGENT_INIT_S3, NULL, NULL);\r
+ InitializeDebugAgent (DEBUG_AGENT_INIT_S3, (VOID *)&IdtDescriptor, NULL);\r
\r
//\r
// Because not install BootScriptExecute PPI(used just in this module), So just pass NULL\r
/** @file\r
\r
-Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>\r
\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions\r
#include <Library/PeCoffGetEntryPointLib.h>\r
#include <Library/PcdLib.h>\r
#include <Library/ReportStatusCodeLib.h>\r
+#include <Library/DebugAgentLib.h>\r
#include <IndustryStandard/PeImage.h>\r
#include "Common/CommonHeader.h"\r
\r
[LibraryClasses.IA32]\r
PeCoffGetEntryPointLib\r
PcdLib\r
+ DebugAgentLib\r
\r
[Guids]\r
gEfiCapsuleVendorGuid # ALWAYS_CONSUMED\r
BaseLib\r
DebugLib\r
CpuExceptionHandlerLib\r
+ DebugAgentLib\r
\r
[Depex]\r
FALSE\r
/** @file\r
Capsule update PEIM for UEFI2.0\r
\r
-Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>\r
\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions\r
//\r
AsmWriteCr3 ((UINTN) PageTableAddress);\r
\r
+ //\r
+ // Disable interrupt of Debug timer, since the IDT table cannot work in long mode\r
+ //\r
+ SaveAndSetDebugTimerInterrupt (FALSE);\r
//\r
// Transfer to long mode\r
//\r
#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