update for HEAD-2003091401
[reactos.git] / drivers / net / dd / ne2000 / include / debug.h
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 #ifndef __DEBUG_H
10 #define __DEBUG_H
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 #ifdef DBG
22
23 extern ULONG DebugTraceLevel;
24
25 #ifdef _MSC_VER
26
27 #define NDIS_DbgPrint(_t_, _x_) \
28     if (((DebugTraceLevel & NORMAL_MASK) >= _t_) || \
29         ((DebugTraceLevel & _t_) > NORMAL_MASK)) { \
30         DbgPrint("(%s:%d) ", __FILE__, __LINE__); \
31         DbgPrint _x_ ; \
32     }
33
34 #else /* _MSC_VER */
35
36 #define NDIS_DbgPrint(_t_, _x_) \
37     if (((DebugTraceLevel & NORMAL_MASK) >= _t_) || \
38         ((DebugTraceLevel & _t_) > NORMAL_MASK)) { \
39         DbgPrint("(%s:%d)(%s) ", __FILE__, __LINE__, __FUNCTION__); \
40         DbgPrint _x_ ; \
41     }
42
43 #endif /* _MSC_VER */
44
45
46 /* Assert is defined in ndis.h */
47 #if 0
48 #ifdef ASSERT
49 #undef ASSERT
50 #endif
51
52 #ifdef NASSERT
53 #define ASSERT(x)
54 #else /* NASSERT */
55 #define ASSERT(x) if (!(x)) { NDIS_DbgPrint(MIN_TRACE, ("Assertion "#x" failed at %s:%d\n", __FILE__, __LINE__)); KeBugCheck(0); }
56 #endif /* NASSERT */
57 #endif
58 #define ASSERT_IRQL(x) ASSERT(KeGetCurrentIrql() <= (x))
59
60 #else /* DBG */
61
62 #define NDIS_DbgPrint(_t_, _x_)
63
64 #define ASSERT_IRQL(x)
65 /* #define ASSERT(x) */  /* ndis.h */
66
67 #endif /* DBG */
68
69
70 #define assert(x) ASSERT(x)
71 #define assert_irql(x) ASSERT_IRQL(x)
72
73
74 #ifdef _MSC_VER
75
76 #define UNIMPLEMENTED \
77     NDIS_DbgPrint(MIN_TRACE, ("The function at %s:%d is unimplemented, \
78         but come back another day.\n", __FILE__, __LINE__));
79
80 #else /* _MSC_VER */
81
82 #define UNIMPLEMENTED \
83     NDIS_DbgPrint(MIN_TRACE, ("%s at %s:%d is unimplemented, \
84         but come back another day.\n", __FUNCTION__, __FILE__, __LINE__));
85
86 #endif /* _MSC_VER */
87
88
89 #define CHECKPOINT \
90     do { NDIS_DbgPrint(MIN_TRACE, ("%s:%d\n", __FILE__, __LINE__)); } while(0);
91
92 #endif /* __DEBUG_H */
93
94 /* EOF */