Author: tkreuzer
Date: Wed Dec 3 10:39:26 2008
New Revision: 37820
URL:
http://svn.reactos.org/svn/reactos?rev=37820&view=rev
Log:
add more stuff to x64 asm.h
Modified:
branches/ros-amd64-bringup/reactos/include/ndk/amd64/asm.h
Modified: branches/ros-amd64-bringup/reactos/include/ndk/amd64/asm.h
URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/inclu…
==============================================================================
--- branches/ros-amd64-bringup/reactos/include/ndk/amd64/asm.h [iso-8859-1] (original)
+++ branches/ros-amd64-bringup/reactos/include/ndk/amd64/asm.h [iso-8859-1] Wed Dec 3
10:39:26 2008
@@ -50,6 +50,11 @@
#define KTHREAD_STACK_LIMIT 0x30
#define KTHREAD_WAIT_IRQL 0x156
+//
+// KPRCB Offsets
+//
+#define KPRCB_CurrentThread 0x08
+
//
// KPCR Offsets
@@ -57,10 +62,63 @@
#define KPCR_TSS_BASE 0x08
#define KPCR_SELF 0x18
#define KPCR_STALL_SCALE_FACTOR 0x64
-
-//
-// Trap Frame Offsets
-//
+#define KPCR_PRCB 0x180
+
+//
+// KTRAP_FRAME Offsets
+//
+#define KTRAP_FRAME_P1Home 0x00
+#define KTRAP_FRAME_P2Home 0x08
+#define KTRAP_FRAME_P3Home 0x10
+#define KTRAP_FRAME_P4Home 0x18
+#define KTRAP_FRAME_P5 0x20
+#define KTRAP_FRAME_PreviousMode 0x28
+#define KTRAP_FRAME_PreviousIrql 0x29
+#define KTRAP_FRAME_FaultIndicator 0x2A
+#define KTRAP_FRAME_ExceptionActive 0x2B
+#define KTRAP_FRAME_MxCsr 0x2C
+#define KTRAP_FRAME_Rax 0x30
+#define KTRAP_FRAME_Rcx 0x38
+#define KTRAP_FRAME_Rdx 0x40
+#define KTRAP_FRAME_R8 0x48
+#define KTRAP_FRAME_R9 0x50
+#define KTRAP_FRAME_R10 0x58
+#define KTRAP_FRAME_R11 0x60
+#define KTRAP_FRAME_Spare0 0x68
+#define KTRAP_FRAME_Xmm0 0x70
+#define KTRAP_FRAME_Xmm1 0x80
+#define KTRAP_FRAME_Xmm2 0x90
+#define KTRAP_FRAME_Xmm3 0xA0
+#define KTRAP_FRAME_Xmm4 0xB0
+#define KTRAP_FRAME_Xmm5 0xC0
+#define KTRAP_FRAME_FaultAddress 0xD0
+#define KTRAP_FRAME_Dr0 0xD8
+#define KTRAP_FRAME_Dr1 0xE0
+#define KTRAP_FRAME_Dr2 0xE8
+#define KTRAP_FRAME_Dr3 0xF0
+#define KTRAP_FRAME_Dr6 0xF8
+#define KTRAP_FRAME_Dr7 0x100
+#define KTRAP_FRAME_DebugControl 0x108
+#define KTRAP_FRAME_LastBranchToRip 0x110
+#define KTRAP_FRAME_LastBranchFromRip 0x118
+#define KTRAP_FRAME_LastExceptionToRip 0x120
+#define KTRAP_FRAME_LastExceptionFromRip 0x128
+#define KTRAP_FRAME_SegDs 0x130
+#define KTRAP_FRAME_SegEs 0x132
+#define KTRAP_FRAME_SegFs 0x134
+#define KTRAP_FRAME_SegGs 0x136
+#define KTRAP_FRAME_TrapFrame 0x138
+#define KTRAP_FRAME_Rbx 0x140
+#define KTRAP_FRAME_Rdi 0x148
+#define KTRAP_FRAME_Rsi 0x150
+#define KTRAP_FRAME_Rbp 0x158
+#define KTRAP_FRAME_ErrorCode 0x160
+#define KTRAP_FRAME_Rip 0x168
+#define KTRAP_FRAME_SegCs 0x170
+#define KTRAP_FRAME_EFlags 0x178
+#define KTRAP_FRAME_Rsp 0x180
+#define KTRAP_FRAME_SegSs 0x188
+#define SIZE_KTRAP_FRAME 0x190
#define KTRAP_FRAME_ALIGN 0x10
#define KTRAP_FRAME_LENGTH 0x190
@@ -132,60 +190,15 @@
#define CONTEXT_LastExceptionFromRip 0x4c8
//
-// KTRAP_FRAME Offsets
-//
-#define KTRAP_FRAME_P1Home 0x00
-#define KTRAP_FRAME_P2Home 0x08
-#define KTRAP_FRAME_P3Home 0x10
-#define KTRAP_FRAME_P4Home 0x18
-#define KTRAP_FRAME_P5 0x20
-#define KTRAP_FRAME_PreviousMode 0x28
-#define KTRAP_FRAME_PreviousIrql 0x29
-#define KTRAP_FRAME_FaultIndicator 0x2A
-#define KTRAP_FRAME_ExceptionActive 0x2B
-#define KTRAP_FRAME_MxCsr 0x2C
-#define KTRAP_FRAME_Rax 0x30
-#define KTRAP_FRAME_Rcx 0x38
-#define KTRAP_FRAME_Rdx 0x40
-#define KTRAP_FRAME_R8 0x48
-#define KTRAP_FRAME_R9 0x50
-#define KTRAP_FRAME_R10 0x58
-#define KTRAP_FRAME_R11 0x60
-#define KTRAP_FRAME_Spare0 0x68
-#define KTRAP_FRAME_Xmm0 0x70
-#define KTRAP_FRAME_Xmm1 0x80
-#define KTRAP_FRAME_Xmm2 0x90
-#define KTRAP_FRAME_Xmm3 0xA0
-#define KTRAP_FRAME_Xmm4 0xB0
-#define KTRAP_FRAME_Xmm5 0xC0
-#define KTRAP_FRAME_FaultAddress 0xD0
-#define KTRAP_FRAME_Dr0 0xD8
-#define KTRAP_FRAME_Dr1 0xE0
-#define KTRAP_FRAME_Dr2 0xE8
-#define KTRAP_FRAME_Dr3 0xF0
-#define KTRAP_FRAME_Dr6 0xF8
-#define KTRAP_FRAME_Dr7 0x100
-#define KTRAP_FRAME_DebugControl 0x108
-#define KTRAP_FRAME_LastBranchToRip 0x110
-#define KTRAP_FRAME_LastBranchFromRip 0x118
-#define KTRAP_FRAME_LastExceptionToRip 0x120
-#define KTRAP_FRAME_LastExceptionFromRip 0x128
-#define KTRAP_FRAME_SegDs 0x130
-#define KTRAP_FRAME_SegEs 0x132
-#define KTRAP_FRAME_SegFs 0x134
-#define KTRAP_FRAME_SegGs 0x136
-#define KTRAP_FRAME_TrapFrame 0x138
-#define KTRAP_FRAME_Rbx 0x140
-#define KTRAP_FRAME_Rdi 0x148
-#define KTRAP_FRAME_Rsi 0x150
-#define KTRAP_FRAME_Rbp 0x158
-#define KTRAP_FRAME_ErrorCode 0x160
-#define KTRAP_FRAME_Rip 0x168
-#define KTRAP_FRAME_SegCs 0x170
-#define KTRAP_FRAME_EFlags 0x178
-#define KTRAP_FRAME_Rsp 0x180
-#define KTRAP_FRAME_SegSs 0x188
-#define SIZE_KTRAP_FRAME 0x190
+// EXCEPTION_RECORD Offsets
+//
+#define EXCEPTION_RECORD_ExceptionCode 0x00
+#define EXCEPTION_RECORD_ExceptionFlags 0x04
+#define EXCEPTION_RECORD_ExceptionRecord 0x08
+#define EXCEPTION_RECORD_ExceptionAddress 0x10
+#define EXCEPTION_RECORD_NumberParameters 0x18
+#define EXCEPTION_RECORD_ExceptionInformation 0x20
+#define SIZE_EXCEPTION_RECORD 0x98
//
// CR0
@@ -203,6 +216,20 @@
#define CR0_PG 0x80000000
//
+// CR4
+//
+#define CR4_VME 0x1
+#define CR4_PVI 0x2
+#define CR4_TSD 0x4
+#define CR4_DE 0x8
+#define CR4_PSE 0x10
+#define CR4_PAE 0x20
+#define CR4_MCE 0x40
+#define CR4_PGE 0x80
+#define CR4_FXSR 0x200
+#define CR4_XMMEXCPT 0x400
+
+//
// Generic Definitions
//
#define PRIMARY_VECTOR_BASE 0x30
@@ -233,6 +260,43 @@
#define EFLAG_SELECT (EFLAG_SIGN + EFLAG_ZERO)
#define EFLAGS_USER_SANITIZE 0x3F4DD7
+//
+// NTSTATUS and Bugcheck Codes
+//
+#define STATUS_ACCESS_VIOLATION 0xC0000005
+#define STATUS_IN_PAGE_ERROR 0xC0000006
+#define STATUS_GUARD_PAGE_VIOLATION 0x80000001
+#define STATUS_PRIVILEGED_INSTRUCTION 0xC0000096
+#define STATUS_STACK_OVERFLOW 0xC00000FD
+#define KI_EXCEPTION_ACCESS_VIOLATION 0x10000004
+#define STATUS_INVALID_SYSTEM_SERVICE 0xC000001C
+#define STATUS_NO_CALLBACK_ACTIVE 0xC0000258
+#define STATUS_CALLBACK_POP_STACK 0xC0000423
+#define STATUS_ARRAY_BOUNDS_EXCEEDED 0xC000008C
+#define STATUS_ILLEGAL_INSTRUCTION 0xC000001D
+#define STATUS_INVALID_LOCK_SEQUENCE 0xC000001E
+#define STATUS_BREAKPOINT 0x80000003
+#define STATUS_SINGLE_STEP 0x80000004
+#define STATUS_INTEGER_DIVIDE_BY_ZERO 0xC0000094
+#define STATUS_INTEGER_OVERFLOW 0xC0000095
+#define STATUS_FLOAT_DENORMAL_OPERAND 0xC000008D
+#define STATUS_FLOAT_DIVIDE_BY_ZERO 0xC000008E
+#define STATUS_FLOAT_INEXACT_RESULT 0xC000008F
+#define STATUS_FLOAT_INVALID_OPERATION 0xC0000090
+#define STATUS_FLOAT_OVERFLOW 0xC0000091
+#define STATUS_FLOAT_STACK_CHECK 0xC0000092
+#define STATUS_FLOAT_UNDERFLOW 0xC0000093
+#define STATUS_FLOAT_MULTIPLE_FAULTS 0xC00002B4
+#define STATUS_FLOAT_MULTIPLE_TRAPS 0xC00002B5
+#define APC_INDEX_MISMATCH 0x01
+#define IRQL_NOT_GREATER_OR_EQUAL 0x09
+#define IRQL_NOT_LESS_OR_EQUAL 0x0A
+#define TRAP_CAUSE_UNKNOWN 0x12
+#define KMODE_EXCEPTION_NOT_HANDLED 0x13
+#define IRQL_GT_ZERO_AT_SYSTEM_SERVICE 0x4A
+#define UNEXPECTED_KERNEL_MODE_TRAP 0x7F
+#define ATTEMPTED_SWITCH_FROM_DPC 0xB8
+#define HARDWARE_INTERRUPT_STORM 0xF2
//
// IRQL Levels