ReactOS  0.4.15-dev-1206-g731eddf
debug.h
Go to the documentation of this file.
1 /*
2  * COPYRIGHT: See COPYING in the top level directory
3  * PROJECT: ReactOS Novell Eagle 2000 driver
4  * FILE: include/debug.h
5  * PURPOSE: Debugging support macros
6  * DEFINES: DBG - Enable debug output
7  * NASSERT - Disable assertions
8  */
9 
10 #pragma once
11 
12 #define NORMAL_MASK 0x000000FF
13 #define SPECIAL_MASK 0xFFFFFF00
14 #define MIN_TRACE 0x00000001
15 #define MID_TRACE 0x00000002
16 #define MAX_TRACE 0x00000003
17 
18 #define DEBUG_MEMORY 0x00000100
19 #define DEBUG_ULTRA 0xFFFFFFFF
20 
21 #if DBG
22 
23 extern ULONG DebugTraceLevel;
24 
25 #ifdef _MSC_VER
26 
27 #define NDIS_DbgPrint(_t_, _x_) \
28  if ((_t_ > NORMAL_MASK) \
29  ? (DebugTraceLevel & _t_) > NORMAL_MASK \
30  : (DebugTraceLevel & NORMAL_MASK) >= _t_) { \
31  DbgPrint("(%s:%d) ", __FILE__, __LINE__); \
32  DbgPrint _x_ ; \
33  }
34 
35 #else /* _MSC_VER */
36 
37 #define NDIS_DbgPrint(_t_, _x_) \
38  if ((_t_ > NORMAL_MASK) \
39  ? (DebugTraceLevel & _t_) > NORMAL_MASK \
40  : (DebugTraceLevel & NORMAL_MASK) >= _t_) { \
41  DbgPrint("(%s:%d)(%s) ", __FILE__, __LINE__, __FUNCTION__); \
42  DbgPrint _x_ ; \
43  }
44 
45 #endif /* _MSC_VER */
46 
47 
48 #define ASSERT_IRQL(x) ASSERT(KeGetCurrentIrql() <= (x))
49 #define ASSERT_IRQL_EQUAL(x) ASSERT(KeGetCurrentIrql() == (x))
50 
51 #else /* DBG */
52 
53 #define NDIS_DbgPrint(_t_, _x_)
54 
55 #define ASSERT_IRQL(x)
56 #define ASSERT_IRQL_EQUAL(x)
57 /* #define ASSERT(x) */ /* ndis.h */
58 
59 #endif /* DBG */
60 
61 
62 #define assert(x) ASSERT(x)
63 #define assert_irql(x) ASSERT_IRQL(x)
64 
65 
66 #ifdef _MSC_VER
67 
68 #define UNIMPLEMENTED \
69  NDIS_DbgPrint(MIN_TRACE, ("The function at %s:%d is unimplemented, \
70  but come back another day.\n", __FILE__, __LINE__));
71 
72 #else /* _MSC_VER */
73 
74 #define UNIMPLEMENTED \
75  NDIS_DbgPrint(MIN_TRACE, ("%s at %s:%d is unimplemented, \
76  but come back another day.\n", __FUNCTION__, __FILE__, __LINE__));
77 
78 #endif /* _MSC_VER */
79 
80 
81 #define CHECKPOINT \
82  do { NDIS_DbgPrint(MIN_TRACE, ("%s:%d\n", __FILE__, __LINE__)); } while(0);
83 
84 /* EOF */
ULONG DebugTraceLevel
Definition: ndis.c:13
unsigned int ULONG
Definition: retypes.h:1