xref: /reactos/sdk/include/ndk/kdtypes.h (revision c2c66aff)
1 /*++ NDK Version: 0098
2 
3 Copyright (c) Alex Ionescu.  All rights reserved.
4 
5 Header Name:
6 
7     kdtypes.h
8 
9 Abstract:
10 
11     Type definitions for the Kernel Debugger.
12 
13 Author:
14 
15     Alex Ionescu (alexi@tinykrnl.org) - Updated - 27-Feb-2006
16 
17 --*/
18 
19 #ifndef _KDTYPES_H
20 #define _KDTYPES_H
21 
22 //
23 // Dependencies
24 //
25 #include <umtypes.h>
26 
27 //
28 // Debug Filter Levels
29 //
30 #define DPFLTR_ERROR_LEVEL                  0
31 #define DPFLTR_WARNING_LEVEL                1
32 #define DPFLTR_TRACE_LEVEL                  2
33 #define DPFLTR_INFO_LEVEL                   3
34 #define DPFLTR_MASK                         0x80000000
35 
36 //
37 // Debug Status Codes
38 //
39 #define DBG_STATUS_CONTROL_C                1
40 #define DBG_STATUS_SYSRQ                    2
41 #define DBG_STATUS_BUGCHECK_FIRST           3
42 #define DBG_STATUS_BUGCHECK_SECOND          4
43 #define DBG_STATUS_FATAL                    5
44 #define DBG_STATUS_DEBUG_CONTROL            6
45 #define DBG_STATUS_WORKER                   7
46 
47 //
48 // DebugService Control Types
49 //
50 #define BREAKPOINT_BREAK                    0
51 #define BREAKPOINT_PRINT                    1
52 #define BREAKPOINT_PROMPT                   2
53 #define BREAKPOINT_LOAD_SYMBOLS             3
54 #define BREAKPOINT_UNLOAD_SYMBOLS           4
55 #define BREAKPOINT_COMMAND_STRING           5
56 
57 //
58 // Debug Control Codes for NtSystemDebugcontrol
59 //
60 typedef enum _SYSDBG_COMMAND
61 {
62     SysDbgQueryModuleInformation = 0,
63     SysDbgQueryTraceInformation = 1,
64     SysDbgSetTracepoint = 2,
65     SysDbgSetSpecialCall = 3,
66     SysDbgClearSpecialCalls = 4,
67     SysDbgQuerySpecialCalls = 5,
68     SysDbgBreakPoint = 6,
69     SysDbgQueryVersion = 7,
70     SysDbgReadVirtual = 8,
71     SysDbgWriteVirtual = 9,
72     SysDbgReadPhysical = 10,
73     SysDbgWritePhysical = 11,
74     SysDbgReadControlSpace = 12,
75     SysDbgWriteControlSpace = 13,
76     SysDbgReadIoSpace = 14,
77     SysDbgWriteIoSpace = 15,
78     SysDbgReadMsr = 16,
79     SysDbgWriteMsr = 17,
80     SysDbgReadBusData = 18,
81     SysDbgWriteBusData = 19,
82     SysDbgCheckLowMemory = 20,
83     SysDbgEnableKernelDebugger = 21,
84     SysDbgDisableKernelDebugger = 22,
85     SysDbgGetAutoKdEnable = 23,
86     SysDbgSetAutoKdEnable = 24,
87     SysDbgGetPrintBufferSize = 25,
88     SysDbgSetPrintBufferSize = 26,
89     SysDbgGetKdUmExceptionEnable = 27,
90     SysDbgSetKdUmExceptionEnable = 28,
91     SysDbgGetTriageDump = 29,
92     SysDbgGetKdBlockEnable = 30,
93     SysDbgSetKdBlockEnable = 31,
94     SysDbgRegisterForUmBreakInfo = 32,
95     SysDbgGetUmBreakPid = 33,
96     SysDbgClearUmBreakPid = 34,
97     SysDbgGetUmAttachPid = 35,
98     SysDbgClearUmAttachPid = 36,
99 } SYSDBG_COMMAND;
100 
101 //
102 // System Debugger Types
103 //
104 typedef struct _SYSDBG_PHYSICAL
105 {
106     PHYSICAL_ADDRESS Address;
107     PVOID Buffer;
108     ULONG Request;
109 } SYSDBG_PHYSICAL, *PSYSDBG_PHYSICAL;
110 
111 typedef struct _SYSDBG_VIRTUAL
112 {
113     PVOID Address;
114     PVOID Buffer;
115     ULONG Request;
116 } SYSDBG_VIRTUAL, *PSYSDBG_VIRTUAL;
117 
118 typedef struct _SYSDBG_CONTROL_SPACE
119 {
120     ULONGLONG Address;
121     PVOID Buffer;
122     ULONG Request;
123     ULONG Processor;
124 } SYSDBG_CONTROL_SPACE, *PSYSDBG_CONTROL_SPACE;
125 
126 typedef struct _SYSDBG_IO_SPACE
127 {
128     ULONGLONG Address;
129     PVOID Buffer;
130     ULONG Request;
131     INTERFACE_TYPE InterfaceType;
132     ULONG BusNumber;
133     ULONG AddressSpace;
134 } SYSDBG_IO_SPACE, *PSYSDBG_IO_SPACE;
135 
136 typedef struct _SYSDBG_BUS_DATA
137 {
138     ULONG Address;
139     PVOID Buffer;
140     ULONG Request;
141     BUS_DATA_TYPE BusDataType;
142     ULONG BusNumber;
143     ULONG SlotNumber;
144 } SYSDBG_BUS_DATA, *PSYSDBG_BUS_DATA;
145 
146 typedef struct _SYSDBG_MSR
147 {
148     ULONG Address;
149     ULONGLONG Data;
150 } SYSDBG_MSR, *PSYSDBG_MSR;
151 
152 typedef struct _SYSDBG_TRIAGE_DUMP
153 {
154     ULONG Flags;
155     ULONG BugCheckCode;
156     ULONG_PTR BugCheckParam1;
157     ULONG_PTR BugCheckParam2;
158     ULONG_PTR BugCheckParam3;
159     ULONG_PTR BugCheckParam4;
160     ULONG ProcessHandles;
161     ULONG ThreadHandles;
162     PHANDLE Handles;
163 } SYSDBG_TRIAGE_DUMP, *PSYSDBG_TRIAGE_DUMP;
164 
165 //
166 // KD Structures
167 //
168 typedef struct _KD_SYMBOLS_INFO
169 {
170     PVOID BaseOfDll;
171     ULONG_PTR ProcessId;
172     ULONG CheckSum;
173     ULONG SizeOfImage;
174 } KD_SYMBOLS_INFO, *PKD_SYMBOLS_INFO;
175 
176 #endif // _KDTYPES_H
177