ReactOS 0.4.15-dev-7704-gc07eb9f
debug.h
Go to the documentation of this file.
1/********************************************************************************
2** Copyright (c) 1998-1999 Microsoft Corporation. All Rights Reserved.
3**
4** Portions Copyright (c) 1998-1999 Intel Corporation
5**
6********************************************************************************/
7
8/* The file debug.h was reviewed by LCA in June 2011 and is acceptable for use by Microsoft. */
9
10#ifndef _DEBUG_H_
11#define _DEBUG_H_
12
13//
14// Modified version of ksdebug.h to support runtime debug level changes.
15//
16const int DBG_NONE = 0x00000000;
17const int DBG_PRINT = 0x00000001; // Blabla. Function entries for example
18const int DBG_WARNING = 0x00000002; // warning level
19const int DBG_ERROR = 0x00000004; // this doesn't generate a breakpoint
20
21// specific debug output; you don't have to enable DBG_PRINT for this.
22const int DBG_STREAM = 0x00000010; // Enables stream output.
23const int DBG_POWER = 0x00000020; // Enables power management output.
24const int DBG_DMA = 0x00000040; // Enables DMA engine output.
25const int DBG_REGS = 0x00000080; // Enables register outout.
26const int DBG_PROBE = 0x00000100; // Enables hardware probing output.
27const int DBG_SYSINFO = 0x00000200; // Enables system info output.
28const int DBG_VSR = 0x00000400; // Enables variable sample rate output.
29const int DBG_PROPERTY = 0x00000800; // Enables property handler output
30const int DBG_POSITION = 0x00001000; // Enables printing of position on GetPosition
31const int DBG_PINS = 0x10000000; // Enables dump of created pins in topology
32const int DBG_NODES = 0x20000000; // Enables dump of created nodes in topology
33const int DBG_CONNS = 0x40000000; // Enables dump of the connections in topology
34
35const int DBG_ALL = 0xFFFFFFFF;
36
37//
38// The default statements that will print are warnings (DBG_WARNING) and
39// errors (DBG_ERROR).
40//
41const int DBG_DEFAULT = 0x00000004; // Errors only.
42
43
44//
45// Define global debug variable.
46//
47#ifdef DEFINE_DEBUG_VARS
48#if (DBG)
49unsigned long ulDebugOut = DBG_DEFAULT;
50#endif
51
52#else // !DEFINED_DEBUG_VARS
53#if (DBG)
54extern unsigned long ulDebugOut;
55#endif
56#endif
57
58
59//
60// Define the print statement.
61//
62#if defined(__cplusplus)
63extern "C" {
64#endif // #if defined(__cplusplus)
65
66//
67// DBG is 1 in checked builds
68//
69#if (DBG)
70#define DOUT(lvl, strings) \
71 if ((lvl) & ulDebugOut) \
72 { \
73 DbgPrint(STR_MODULENAME); \
74 DbgPrint strings; \
75 DbgPrint("\n"); \
76 }
77
78#define BREAK() \
79 DbgBreakPoint()
80
81#else // if (!DBG)
82#define DOUT(lvl, strings)
83#define BREAK()
84#endif // !DBG
85
86
87#if defined(__cplusplus)
88}
89#endif // #if defined(__cplusplus)
90
91
92
93#endif
const int DBG_STREAM
Definition: debug.h:22
const int DBG_ALL
Definition: debug.h:35
const int DBG_REGS
Definition: debug.h:25
const int DBG_ERROR
Definition: debug.h:19
const int DBG_PROBE
Definition: debug.h:26
const int DBG_NODES
Definition: debug.h:32
const int DBG_POWER
Definition: debug.h:23
const int DBG_CONNS
Definition: debug.h:33
const int DBG_DEFAULT
Definition: debug.h:41
const int DBG_VSR
Definition: debug.h:28
const int DBG_PINS
Definition: debug.h:31
const int DBG_SYSINFO
Definition: debug.h:27
const int DBG_NONE
Definition: debug.h:16
const int DBG_PRINT
Definition: debug.h:17
const int DBG_POSITION
Definition: debug.h:30
const int DBG_PROPERTY
Definition: debug.h:29
const int DBG_WARNING
Definition: debug.h:18
const int DBG_DMA
Definition: debug.h:24