Sync DebugSupport Protocol with UEFI2.0 spec
authorlgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524>
Thu, 29 Jun 2006 10:31:10 +0000 (10:31 +0000)
committerlgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524>
Thu, 29 Jun 2006 10:31:10 +0000 (10:31 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@656 6f19259b-4bc3-4df7-8a09-765794883524

MdePkg/Include/Protocol/DebugSupport.h

index 1b782cf..4f7d3d1 100644 (file)
@@ -1,5 +1,5 @@
 /** @file\r
-  DebugSupport protocol and supporting definitions as defined in the EFI 1.1\r
+  DebugSupport protocol and supporting definitions as defined in the UEFI2.0\r
   specification.\r
 \r
   The DebugSupport protocol is used by source level debuggers to abstract the\r
@@ -75,6 +75,26 @@ typedef struct {
   UINT32  DataOffset;\r
   UINT16  Ds;\r
   UINT8   Reserved2[10];\r
+#if (EFI_SPECIFICATION_VERSION >= 0x00020000)\r
+  UINT8   St0Mm0[10], Reserved3[6];\r
+  UINT8   St1Mm1[10], Reserved4[6];\r
+  UINT8   St2Mm2[10], Reserved5[6];\r
+  UINT8   St3Mm3[10], Reserved6[6];\r
+  UINT8   St4Mm4[10], Reserved7[6];\r
+  UINT8   St5Mm5[10], Reserved8[6];\r
+  UINT8   St6Mm6[10], Reserved9[6];\r
+  UINT8   St7Mm7[10], Reserved10[6];\r
+  UINT8   Xmm0[16];\r
+  UINT8   Xmm1[16];\r
+  UINT8   Xmm2[16];\r
+  UINT8   Xmm3[16];\r
+  UINT8   Xmm4[16];\r
+  UINT8   Xmm5[16];\r
+  UINT8   Xmm6[16];\r
+  UINT8   Xmm7[16];\r
+  UINT8   Reserved11[14 * 16];\r
+} EFI_FX_SAVE_STATE_IA32;\r
+#else\r
   UINT8   St0Mm0[10], Reserved3[6];\r
   UINT8   St0Mm1[10], Reserved4[6];\r
   UINT8   St0Mm2[10], Reserved5[6];\r
@@ -84,11 +104,16 @@ typedef struct {
   UINT8   St0Mm6[10], Reserved9[6];\r
   UINT8   St0Mm7[10], Reserved10[6];\r
   UINT8   Reserved11[22 * 16];\r
-} EFI_FX_SAVE_STATE_IA32;\r
+} EFI_FX_SAVE_STATE;\r
+#endif\r
 \r
 typedef struct {\r
   UINT32                 ExceptionData;\r
+#if (EFI_SPECIFICATION_VERSION >= 0x00020000)\r
   EFI_FX_SAVE_STATE_IA32 FxSaveState;\r
+#else\r
+  EFI_FX_SAVE_STATE      FxSaveState;\r
+#endif\r
   UINT32                 Dr0;\r
   UINT32                 Dr1;\r
   UINT32                 Dr2;\r
@@ -96,7 +121,7 @@ typedef struct {
   UINT32                 Dr6;\r
   UINT32                 Dr7;\r
   UINT32                 Cr0;\r
-  UINT32                 Cr1;  \r
+  UINT32                 Cr1;  /* Reserved */\r
   UINT32                 Cr2;\r
   UINT32                 Cr3;\r
   UINT32                 Cr4;\r
@@ -122,6 +147,105 @@ typedef struct {
   UINT32                 Eax;\r
 } EFI_SYSTEM_CONTEXT_IA32;\r
 \r
+//\r
+//  X64 processor exception types\r
+//\r
+#define EXCEPT_X64_DIVIDE_ERROR    0\r
+#define EXCEPT_X64_DEBUG           1\r
+#define EXCEPT_X64_NMI             2\r
+#define EXCEPT_X64_BREAKPOINT      3\r
+#define EXCEPT_X64_OVERFLOW        4\r
+#define EXCEPT_X64_BOUND           5\r
+#define EXCEPT_X64_INVALID_OPCODE  6\r
+#define EXCEPT_X64_DOUBLE_FAULT    8\r
+#define EXCEPT_X64_INVALID_TSS     10\r
+#define EXCEPT_X64_SEG_NOT_PRESENT 11\r
+#define EXCEPT_X64_STACK_FAULT     12\r
+#define EXCEPT_X64_GP_FAULT        13\r
+#define EXCEPT_X64_PAGE_FAULT      14\r
+#define EXCEPT_X64_FP_ERROR        16\r
+#define EXCEPT_X64_ALIGNMENT_CHECK 17\r
+#define EXCEPT_X64_MACHINE_CHECK   18\r
+#define EXCEPT_X64_SIMD            19\r
+\r
+//\r
+//  X64 processor context definition\r
+//\r
+// FXSAVE_STATE\r
+// FP / MMX / XMM registers (see fxrstor instruction definition)\r
+//\r
+typedef struct {\r
+  UINT16  Fcw;\r
+  UINT16  Fsw;\r
+  UINT16  Ftw;\r
+  UINT16  Opcode;\r
+  UINT64  Rip;\r
+  UINT64  DataOffset;\r
+  UINT8   Reserved1[8];\r
+  UINT8   St0Mm0[10], Reserved2[6];\r
+  UINT8   St1Mm1[10], Reserved3[6];\r
+  UINT8   St2Mm2[10], Reserved4[6];\r
+  UINT8   St3Mm3[10], Reserved5[6];\r
+  UINT8   St4Mm4[10], Reserved6[6];\r
+  UINT8   St5Mm5[10], Reserved7[6];\r
+  UINT8   St6Mm6[10], Reserved8[6];\r
+  UINT8   St7Mm7[10], Reserved9[6];\r
+  UINT8   Xmm0[16];\r
+  UINT8   Xmm1[16];\r
+  UINT8   Xmm2[16];\r
+  UINT8   Xmm3[16];\r
+  UINT8   Xmm4[16];\r
+  UINT8   Xmm5[16];\r
+  UINT8   Xmm6[16];\r
+  UINT8   Xmm7[16];\r
+  UINT8   Reserved11[14 * 16];\r
+} EFI_FX_SAVE_STATE_X64;\r
+\r
+typedef struct {\r
+  UINT64                ExceptionData;\r
+  EFI_FX_SAVE_STATE_X64 FxSaveState;\r
+  UINT64                Dr0;\r
+  UINT64                Dr1;\r
+  UINT64                Dr2;\r
+  UINT64                Dr3;\r
+  UINT64                Dr6;\r
+  UINT64                Dr7;\r
+  UINT64                Cr0;\r
+  UINT64                Cr1;  /* Reserved */\r
+  UINT64                Cr2;\r
+  UINT64                Cr3;\r
+  UINT64                Cr4;\r
+  UINT64                Cr8;\r
+  UINT64                Rflags;\r
+  UINT64                Ldtr;\r
+  UINT64                Tr;\r
+  UINT64                Gdtr[2];\r
+  UINT64                Idtr[2];\r
+  UINT64                Rip;\r
+  UINT64                Gs;\r
+  UINT64                Fs;\r
+  UINT64                Es;\r
+  UINT64                Ds;\r
+  UINT64                Cs;\r
+  UINT64                Ss;\r
+  UINT64                Rdi;\r
+  UINT64                Rsi;\r
+  UINT64                Rbp;\r
+  UINT64                Rsp;\r
+  UINT64                Rbx;\r
+  UINT64                Rdx;\r
+  UINT64                Rcx;\r
+  UINT64                Rax;\r
+  UINT64                R8;\r
+  UINT64                R9;\r
+  UINT64                R10;\r
+  UINT64                R11;\r
+  UINT64                R12;\r
+  UINT64                R13;\r
+  UINT64                R14;\r
+  UINT64                R15;\r
+} EFI_SYSTEM_CONTEXT_X64;\r
+\r
 //\r
 //  IPF processor exception types\r
 //\r
@@ -365,6 +489,7 @@ typedef struct {
 typedef union {\r
   EFI_SYSTEM_CONTEXT_EBC  *SystemContextEbc;\r
   EFI_SYSTEM_CONTEXT_IA32 *SystemContextIa32;\r
+  EFI_SYSTEM_CONTEXT_X64  *SystemContextX64;\r
   EFI_SYSTEM_CONTEXT_IPF  *SystemContextIpf;\r
 } EFI_SYSTEM_CONTEXT;\r
 \r