- KdDebuggerNotPresent should be FALSE by default.
[reactos.git] / reactos / ntoskrnl / kd64 / kddata.c
1 /*
2 * PROJECT: ReactOS Kernel
3 * LICENSE: GPL - See COPYING in the top level directory
4 * FILE: ntoskrnl/kd64/kddata.c
5 * PURPOSE: Contains all global variables and settings for KD64
6 * PROGRAMMERS: Alex Ionescu (alex.ionescu@reactos.org)
7 */
8
9 /* INCLUDES ******************************************************************/
10
11 #include <ntoskrnl.h>
12 #define NDEBUG
13 #include <debug.h>
14
15 /* GLOBALS *******************************************************************/
16
17 //
18 // Debugger Version Block
19 //
20 DBGKD_GET_VERSION64 KdVersionBlock =
21 {
22 0,
23 0,
24 DBGKD_64BIT_PROTOCOL_VERSION2,
25 KD_SECONDARY_VERSION_DEFAULT,
26 DBGKD_VERS_FLAG_DATA,
27 IMAGE_FILE_MACHINE_I386,
28 PACKET_TYPE_MAX,
29 0,
30 0,
31 DBGKD_SIMULATION_NONE,
32 {0},
33 0,
34 0,
35 0
36 };
37
38 //
39 // Debugger Data
40 //
41 KDDEBUGGER_DATA64 KdDebuggerDataBlock;
42 LIST_ENTRY KdpDebuggerDataListHead;
43 KSPIN_LOCK KdpDataSpinLock;
44
45 //
46 // Debugger State
47 //
48 KD_CONTEXT KdpContext;
49 BOOLEAN KdpControlCPressed;
50 BOOLEAN KdpControlCWaiting;
51 BOOLEAN KdpPortLocked;
52 KSPIN_LOCK KdpDebuggerLock;
53
54 //
55 // Debug Trap Handlers
56 //
57 PKDEBUG_ROUTINE KiDebugRoutine = KdpStub;
58 PKDEBUG_SWITCH_ROUTINE KiDebugSwitchRoutine;
59
60 //
61 // Debugger Configuration Settings
62 //
63 BOOLEAN KdBreakAfterSymbolLoad;
64 BOOLEAN KdPitchDebugger;
65 BOOLEAN _KdDebuggerNotPresent;
66 BOOLEAN _KdDebuggerEnabled;
67 BOOLEAN KdAutoEnableOnEvent;
68 BOOLEAN KdPreviouslyEnabled;
69 BOOLEAN KdpDebuggerStructuresInitialized;
70 BOOLEAN KdEnteredDebugger;
71 ULONG KdDisableCount;
72 LARGE_INTEGER KdPerformanceCounterRate;
73
74 //
75 // Time Slip Support
76 //
77 KDPC KdpTimeSlipDpc;
78 KTIMER KdpTimeSlipTimer;
79 WORK_QUEUE_ITEM KdpTimeSlipWorkItem;
80 LONG KdpTimeSlipPending = 1;
81 PKEVENT KdpTimeSlipEvent;
82 KSPIN_LOCK KdpTimeSlipEventLock;
83 LARGE_INTEGER KdTimerStop, KdTimerStart, KdTimerDifference;
84
85 //
86 // Debug Filter Masks
87 //
88 ULONG Kd_WIN2000_Mask = 1;
89 ULONG Kd_SYSTEM_Mask;
90 ULONG Kd_SMSS_Mask;
91 ULONG Kd_SETUP_Mask;
92 ULONG Kd_NTFS_Mask;
93 ULONG Kd_FSTUB_Mask;
94 ULONG Kd_CRASHDUMP_Mask;
95 ULONG Kd_CDAUDIO_Mask;
96 ULONG Kd_CDROM_Mask;
97 ULONG Kd_CLASSPNP_Mask;
98 ULONG Kd_DISK_Mask;
99 ULONG Kd_REDBOOK_Mask;
100 ULONG Kd_STORPROP_Mask;
101 ULONG Kd_SCSIPORT_Mask;
102 ULONG Kd_SCSIMINIPORT_Mask;
103 ULONG Kd_CONFIG_Mask;
104 ULONG Kd_I8042PRT_Mask;
105 ULONG Kd_SERMOUSE_Mask;
106 ULONG Kd_LSERMOUS_Mask;
107 ULONG Kd_KBDHID_Mask;
108 ULONG Kd_MOUHID_Mask;
109 ULONG Kd_KBDCLASS_Mask;
110 ULONG Kd_MOUCLASS_Mask;
111 ULONG Kd_TWOTRACK_Mask;
112 ULONG Kd_WMILIB_Mask;
113 ULONG Kd_ACPI_Mask;
114 ULONG Kd_AMLI_Mask;
115 ULONG Kd_HALIA64_Mask;
116 ULONG Kd_VIDEO_Mask;
117 ULONG Kd_SVCHOST_Mask;
118 ULONG Kd_VIDEOPRT_Mask;
119 ULONG Kd_TCPIP_Mask;
120 ULONG Kd_DMSYNTH_Mask;
121 ULONG Kd_NTOSPNP_Mask;
122 ULONG Kd_FASTFAT_Mask;
123 ULONG Kd_SAMSS_Mask;
124 ULONG Kd_PNPMGR_Mask;
125 ULONG Kd_NETAPI_Mask;
126 ULONG Kd_SCSERVER_Mask;
127 ULONG Kd_SCCLIENT_Mask;
128 ULONG Kd_SERIAL_Mask;
129 ULONG Kd_SERENUM_Mask;
130 ULONG Kd_UHCD_Mask;
131 ULONG Kd_RPCPROXY_Mask;
132 ULONG Kd_AUTOCHK_Mask;
133 ULONG Kd_DCOMSS_Mask;
134 ULONG Kd_UNIMODEM_Mask;
135 ULONG Kd_SIS_Mask;
136 ULONG Kd_FLTMGR_Mask;
137 ULONG Kd_WMICORE_Mask;
138 ULONG Kd_BURNENG_Mask;
139 ULONG Kd_IMAPI_Mask;
140 ULONG Kd_SXS_Mask;
141 ULONG Kd_FUSION_Mask;
142 ULONG Kd_IDLETASK_Mask;
143 ULONG Kd_SOFTPCI_Mask;
144 ULONG Kd_TAPE_Mask;
145 ULONG Kd_MCHGR_Mask;
146 ULONG Kd_IDEP_Mask;
147 ULONG Kd_PCIIDE_Mask;
148 ULONG Kd_FLOPPY_Mask;
149 ULONG Kd_FDC_Mask;
150 ULONG Kd_TERMSRV_Mask;
151 ULONG Kd_W32TIME_Mask;
152 ULONG Kd_PREFETCHER_Mask;
153 ULONG Kd_RSFILTER_Mask;
154 ULONG Kd_FCPORT_Mask;
155 ULONG Kd_PCI_Mask;
156 ULONG Kd_DMIO_Mask;
157 ULONG Kd_DMCONFIG_Mask;
158 ULONG Kd_DMADMIN_Mask;
159 ULONG Kd_WSOCKTRANSPORT_Mask;
160 ULONG Kd_VSS_Mask;
161 ULONG Kd_PNPMEM_Mask;
162 ULONG Kd_PROCESSOR_Mask;
163 ULONG Kd_DMSERVER_Mask;
164 ULONG Kd_SR_Mask;
165 ULONG Kd_INFINIBAND_Mask;
166 ULONG Kd_IHVDRIVER_Mask;
167 ULONG Kd_IHVVIDEO_Mask;
168 ULONG Kd_IHVAUDIO_Mask;
169 ULONG Kd_IHVNETWORK_Mask;
170 ULONG Kd_IHVSTREAMING_Mask;
171 ULONG Kd_IHVBUS_Mask;
172 ULONG Kd_HPS_Mask;
173 ULONG Kd_RTLTHREADPOOL_Mask;
174 ULONG Kd_LDR_Mask;
175 ULONG Kd_TCPIP6_Mask;
176 ULONG Kd_ISAPNP_Mask;
177 ULONG Kd_SHPC_Mask;
178 ULONG Kd_STORPORT_Mask;
179 ULONG Kd_STORMINIPORT_Mask;
180 ULONG Kd_PRINTSPOOLER_Mask;
181 ULONG Kd_VSSDYNDISK_Mask;
182 ULONG Kd_VERIFIER_Mask;
183 ULONG Kd_VDS_Mask;
184 ULONG Kd_VDSBAS_Mask;
185 ULONG Kd_VDSDYNDR_Mask;
186 ULONG Kd_VDSUTIL_Mask;
187 ULONG Kd_DFRGIFC_Mask;
188 ULONG Kd_DEFAULT_Mask;
189 ULONG Kd_MM_Mask;
190 ULONG Kd_DFSC_Mask;
191 ULONG Kd_WOW64_Mask;
192 ULONG Kd_ENDOFTABLE_Mask;
193
194 //
195 // Debug Filter Component Table
196 //
197 PULONG KdComponentTable[104] =
198 {
199 &Kd_SYSTEM_Mask,
200 &Kd_SMSS_Mask,
201 &Kd_SETUP_Mask,
202 &Kd_NTFS_Mask,
203 &Kd_FSTUB_Mask,
204 &Kd_CRASHDUMP_Mask,
205 &Kd_CDAUDIO_Mask,
206 &Kd_CDROM_Mask,
207 &Kd_CLASSPNP_Mask,
208 &Kd_DISK_Mask,
209 &Kd_REDBOOK_Mask,
210 &Kd_STORPROP_Mask,
211 &Kd_SCSIPORT_Mask,
212 &Kd_SCSIMINIPORT_Mask,
213 &Kd_CONFIG_Mask,
214 &Kd_I8042PRT_Mask,
215 &Kd_SERMOUSE_Mask,
216 &Kd_LSERMOUS_Mask,
217 &Kd_KBDHID_Mask,
218 &Kd_MOUHID_Mask,
219 &Kd_KBDCLASS_Mask,
220 &Kd_MOUCLASS_Mask,
221 &Kd_TWOTRACK_Mask,
222 &Kd_WMILIB_Mask,
223 &Kd_ACPI_Mask,
224 &Kd_AMLI_Mask,
225 &Kd_HALIA64_Mask,
226 &Kd_VIDEO_Mask,
227 &Kd_SVCHOST_Mask,
228 &Kd_VIDEOPRT_Mask,
229 &Kd_TCPIP_Mask,
230 &Kd_DMSYNTH_Mask,
231 &Kd_NTOSPNP_Mask,
232 &Kd_FASTFAT_Mask,
233 &Kd_SAMSS_Mask,
234 &Kd_PNPMGR_Mask,
235 &Kd_NETAPI_Mask,
236 &Kd_SCSERVER_Mask,
237 &Kd_SCCLIENT_Mask,
238 &Kd_SERIAL_Mask,
239 &Kd_SERENUM_Mask,
240 &Kd_UHCD_Mask,
241 &Kd_RPCPROXY_Mask,
242 &Kd_AUTOCHK_Mask,
243 &Kd_DCOMSS_Mask,
244 &Kd_UNIMODEM_Mask,
245 &Kd_SIS_Mask,
246 &Kd_FLTMGR_Mask,
247 &Kd_WMICORE_Mask,
248 &Kd_BURNENG_Mask,
249 &Kd_IMAPI_Mask,
250 &Kd_SXS_Mask,
251 &Kd_FUSION_Mask,
252 &Kd_IDLETASK_Mask,
253 &Kd_SOFTPCI_Mask,
254 &Kd_TAPE_Mask,
255 &Kd_MCHGR_Mask,
256 &Kd_IDEP_Mask,
257 &Kd_PCIIDE_Mask,
258 &Kd_FLOPPY_Mask,
259 &Kd_FDC_Mask,
260 &Kd_TERMSRV_Mask,
261 &Kd_W32TIME_Mask,
262 &Kd_PREFETCHER_Mask,
263 &Kd_RSFILTER_Mask,
264 &Kd_FCPORT_Mask,
265 &Kd_PCI_Mask,
266 &Kd_DMIO_Mask,
267 &Kd_DMCONFIG_Mask,
268 &Kd_DMADMIN_Mask,
269 &Kd_WSOCKTRANSPORT_Mask,
270 &Kd_VSS_Mask,
271 &Kd_PNPMEM_Mask,
272 &Kd_PROCESSOR_Mask,
273 &Kd_DMSERVER_Mask,
274 &Kd_SR_Mask,
275 &Kd_INFINIBAND_Mask,
276 &Kd_IHVDRIVER_Mask,
277 &Kd_IHVVIDEO_Mask,
278 &Kd_IHVAUDIO_Mask,
279 &Kd_IHVNETWORK_Mask,
280 &Kd_IHVSTREAMING_Mask,
281 &Kd_IHVBUS_Mask,
282 &Kd_HPS_Mask,
283 &Kd_RTLTHREADPOOL_Mask,
284 &Kd_LDR_Mask,
285 &Kd_TCPIP6_Mask,
286 &Kd_ISAPNP_Mask,
287 &Kd_SHPC_Mask,
288 &Kd_STORPORT_Mask,
289 &Kd_STORMINIPORT_Mask,
290 &Kd_PRINTSPOOLER_Mask,
291 &Kd_VSSDYNDISK_Mask,
292 &Kd_VERIFIER_Mask,
293 &Kd_VDS_Mask,
294 &Kd_VDSBAS_Mask,
295 &Kd_VDSDYNDR_Mask,
296 &Kd_VDSUTIL_Mask,
297 &Kd_DFRGIFC_Mask,
298 &Kd_DEFAULT_Mask,
299 &Kd_MM_Mask,
300 &Kd_DFSC_Mask,
301 &Kd_WOW64_Mask,
302 &Kd_ENDOFTABLE_Mask,
303 };
304
305 ULONG KdComponentTableSize = sizeof(KdComponentTable);