1 /* 2 * COPYRIGHT: See COPYING in the top level directory 3 * PROJECT: ReactOS Intel PRO/1000 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 26 #define NDIS_DbgPrint(_t_, _x_) \ 27 if ((_t_ > NORMAL_MASK) \ 28 ? (DebugTraceLevel & _t_) > NORMAL_MASK \ 29 : (DebugTraceLevel & NORMAL_MASK) >= _t_) { \ 30 DbgPrint("(%s:%d)(%s) ", __FILE__, __LINE__, __FUNCTION__); \ 31 DbgPrint _x_ ; \ 32 } 33 34 35 #define ASSERT_IRQL(x) ASSERT(KeGetCurrentIrql() <= (x)) 36 #define ASSERT_IRQL_EQUAL(x) ASSERT(KeGetCurrentIrql() == (x)) 37 38 #else /* DBG */ 39 40 #define NDIS_DbgPrint(_t_, _x_) 41 42 #define ASSERT_IRQL(x) 43 #define ASSERT_IRQL_EQUAL(x) 44 /* #define ASSERT(x) */ /* ndis.h */ 45 46 #endif /* DBG */ 47 48 49 #define assert(x) ASSERT(x) 50 #define assert_irql(x) ASSERT_IRQL(x) 51 52 53 #define UNIMPLEMENTED \ 54 NDIS_DbgPrint(MIN_TRACE, ("UNIMPLEMENTED.\n")); 55 56 57 #define UNIMPLEMENTED_DBGBREAK(...) \ 58 do { \ 59 NDIS_DbgPrint(MIN_TRACE, ("UNIMPLEMENTED.\n")); \ 60 DbgPrint("" __VA_ARGS__); \ 61 DbgBreakPoint(); \ 62 } while (0) 63 64 65 const char* Oid2Str(IN NDIS_OID Oid); 66 67