Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

93 lines
2.5 KiB

  1. /*++
  2. Copyright (C) 1999-2002 Microsoft Corporation
  3. Module Name:
  4. debug.h
  5. Abstract
  6. SBP2 Protocol Driver
  7. Author:
  8. Peter Binder
  9. Revision History:
  10. Date Who What
  11. ---------- --------- ------------------------------------------------------------
  12. 11/11/1999 pbinder created
  13. 04/10/2000 pbinder cleanup for whistler
  14. 01/13/2002 pbinder taken for sbp2port
  15. --*/
  16. #if DBG
  17. #define _DRIVERNAME_ "SBP2PORT"
  18. #define TL_MASK 0xF0000000
  19. #define TL_INFO 0x10000000
  20. #define TL_TRACE 0x20000000
  21. #define TL_WARNING 0x40000000
  22. #define TL_ERROR 0x80000000
  23. #define TL_PNP_MASK 0x0000000F
  24. #define TL_PNP_INFO 0x00000001
  25. #define TL_PNP_TRACE 0x00000002
  26. #define TL_PNP_WARNING 0x00000004
  27. #define TL_PNP_ERROR 0x00000008
  28. #define TL_1394_MASK 0x000000F0
  29. #define TL_1394_INFO 0x00000010
  30. #define TL_1394_TRACE 0x00000020
  31. #define TL_1394_WARNING 0x00000040
  32. #define TL_1394_ERROR 0x00000080
  33. #define TL_SCSI_MASK 0x00000F00
  34. #define TL_SCSI_INFO 0x00000100
  35. #define TL_SCSI_TRACE 0x00000200
  36. #define TL_SCSI_WARNING 0x00000400
  37. #define TL_SCSI_ERROR 0x00000800
  38. #define DEFAULT_DEBUG_LEVEL 0x00000000
  39. extern ULONG NewSbp2DebugLevel;
  40. extern ULONG Sbp2TrapLevel;
  41. #define TRACE( l, x ) \
  42. if( (l) & NewSbp2DebugLevel ) { \
  43. KdPrint( (_DRIVERNAME_ ": ") ); \
  44. KdPrint( x ); \
  45. KdPrint( ("\n") ); \
  46. }
  47. #define TRAP \
  48. if (Sbp2TrapLevel) { \
  49. TRACE( TL_ERROR, \
  50. ("Code coverage trap: file %s, line %d", \
  51. __FILE__, __LINE__ )); \
  52. DbgBreakPoint(); \
  53. }
  54. #define BAD_POINTER ((PVOID)0xFFFFFFFE)
  55. #define ENTER(n) TRACE(TL_TRACE, ("%s Enter", n))
  56. #define EXIT(n,x) \
  57. if (NT_SUCCESS(x)) { \
  58. TRACE(TL_TRACE, ("%s Exit = %x", n, x)); \
  59. } else { \
  60. TRACE(TL_ERROR, ("%s Exit = %x", n, x)); \
  61. }
  62. #else // DBG
  63. #define TRACE( l, x )
  64. #define TRAP
  65. #define ENTER(n)
  66. #define EXIT(n,x)
  67. #endif // DBG