xref: /reactos/drivers/wdm/audio/drivers/ac97/debug.h (revision 9c79a798)
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 //
16 const int DBG_NONE     = 0x00000000;
17 const int DBG_PRINT    = 0x00000001; // Blabla. Function entries for example
18 const int DBG_WARNING  = 0x00000002; // warning level
19 const 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.
22 const int DBG_STREAM   = 0x00000010; // Enables stream output.
23 const int DBG_POWER    = 0x00000020; // Enables power management output.
24 const int DBG_DMA      = 0x00000040; // Enables DMA engine output.
25 const int DBG_REGS     = 0x00000080; // Enables register outout.
26 const int DBG_PROBE    = 0x00000100; // Enables hardware probing output.
27 const int DBG_SYSINFO  = 0x00000200; // Enables system info output.
28 const int DBG_VSR      = 0x00000400; // Enables variable sample rate output.
29 const int DBG_PROPERTY = 0x00000800; // Enables property handler output
30 const int DBG_POSITION = 0x00001000; // Enables printing of position on GetPosition
31 const int DBG_PINS     = 0x10000000; // Enables dump of created pins in topology
32 const int DBG_NODES    = 0x20000000; // Enables dump of created nodes in topology
33 const int DBG_CONNS    = 0x40000000; // Enables dump of the connections in topology
34 
35 const int DBG_ALL      = 0xFFFFFFFF;
36 
37 //
38 // The default statements that will print are warnings (DBG_WARNING) and
39 // errors (DBG_ERROR).
40 //
41 const int DBG_DEFAULT = 0x00000004;  // Errors only.
42 
43 
44 //
45 // Define global debug variable.
46 //
47 #ifdef DEFINE_DEBUG_VARS
48 #if (DBG)
49 unsigned long ulDebugOut = DBG_DEFAULT;
50 #endif
51 
52 #else // !DEFINED_DEBUG_VARS
53 #if (DBG)
54 extern unsigned long ulDebugOut;
55 #endif
56 #endif
57 
58 
59 //
60 // Define the print statement.
61 //
62 #if defined(__cplusplus)
63 extern "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
94