2000-08-01 18:43:15 +00:00
|
|
|
/*
|
|
|
|
* COPYRIGHT: See COPYING in the top level directory
|
|
|
|
* PROJECT: ReactOS NDIS library
|
|
|
|
* FILE: include/debug.h
|
|
|
|
* PURPOSE: Debugging support macros
|
|
|
|
* DEFINES: DBG - Enable debug output
|
|
|
|
*/
|
2010-02-26 11:43:19 +00:00
|
|
|
|
|
|
|
#pragma once
|
2000-08-01 18:43:15 +00:00
|
|
|
|
|
|
|
#define NORMAL_MASK 0x000000FF
|
|
|
|
#define SPECIAL_MASK 0xFFFFFF00
|
|
|
|
#define MIN_TRACE 0x00000001
|
|
|
|
#define MID_TRACE 0x00000002
|
|
|
|
#define MAX_TRACE 0x00000003
|
|
|
|
|
|
|
|
#define DEBUG_MINIPORT 0x00000200
|
|
|
|
#define DEBUG_PROTOCOL 0x00000400
|
2000-08-27 16:31:41 +00:00
|
|
|
#define DEBUG_PACKET 0x00000800
|
2000-08-01 18:43:15 +00:00
|
|
|
#define DEBUG_ULTRA 0xFFFFFFFF
|
|
|
|
|
2009-06-17 12:44:05 +00:00
|
|
|
#if DBG
|
2000-08-01 18:43:15 +00:00
|
|
|
|
2005-08-23 22:11:03 +00:00
|
|
|
extern ULONG DebugTraceLevel;
|
2000-08-01 18:43:15 +00:00
|
|
|
|
|
|
|
#ifdef _MSC_VER
|
|
|
|
|
|
|
|
#define NDIS_DbgPrint(_t_, _x_) \
|
2015-10-23 07:26:42 +00:00
|
|
|
if ((_t_ > NORMAL_MASK) \
|
|
|
|
? (DebugTraceLevel & _t_) > NORMAL_MASK \
|
|
|
|
: (DebugTraceLevel & NORMAL_MASK) >= _t_) { \
|
2000-08-01 18:43:15 +00:00
|
|
|
DbgPrint("(%s:%d) ", __FILE__, __LINE__); \
|
|
|
|
DbgPrint _x_ ; \
|
|
|
|
}
|
|
|
|
|
|
|
|
#else /* _MSC_VER */
|
|
|
|
|
|
|
|
#define NDIS_DbgPrint(_t_, _x_) \
|
2015-10-23 07:26:42 +00:00
|
|
|
if ((_t_ > NORMAL_MASK) \
|
|
|
|
? (DebugTraceLevel & _t_) > NORMAL_MASK \
|
|
|
|
: (DebugTraceLevel & NORMAL_MASK) >= _t_) { \
|
2000-08-01 18:43:15 +00:00
|
|
|
DbgPrint("(%s:%d)(%s) ", __FILE__, __LINE__, __FUNCTION__); \
|
|
|
|
DbgPrint _x_ ; \
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif /* _MSC_VER */
|
|
|
|
|
|
|
|
#define ASSERT_IRQL(x) ASSERT(KeGetCurrentIrql() <= (x))
|
|
|
|
|
|
|
|
#else /* DBG */
|
|
|
|
|
|
|
|
#define NDIS_DbgPrint(_t_, _x_)
|
|
|
|
|
|
|
|
#define ASSERT_IRQL(x)
|
2003-07-24 18:14:59 +00:00
|
|
|
/*#define ASSERT(x)*/
|
2000-08-01 18:43:15 +00:00
|
|
|
|
|
|
|
#endif /* DBG */
|
|
|
|
|
|
|
|
|
|
|
|
#define assert(x) ASSERT(x)
|
|
|
|
#define assert_irql(x) ASSERT_IRQL(x)
|
|
|
|
|
|
|
|
|
|
|
|
#define UNIMPLEMENTED \
|
2007-11-14 12:25:53 +00:00
|
|
|
NDIS_DbgPrint(MIN_TRACE, ("Unimplemented.\n", __FUNCTION__));
|
2000-08-01 18:43:15 +00:00
|
|
|
|
|
|
|
|
|
|
|
#define CHECKPOINT \
|
2007-11-14 12:25:53 +00:00
|
|
|
do { NDIS_DbgPrint(MIN_TRACE, ("\n")); } while(0);
|
2000-08-01 18:43:15 +00:00
|
|
|
|
2001-05-01 22:44:07 +00:00
|
|
|
#define CP CHECKPOINT
|
|
|
|
|
2000-08-01 18:43:15 +00:00
|
|
|
/* EOF */
|