Source code of Windows XP (NT5)
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.

92 lines
2.6 KiB

  1. /********************************************************************************
  2. ** Copyright (c) 1998-1999 Microsoft Corporation. All Rights Reserved.
  3. **
  4. ** Portions Copyright (c) 1998-1999 Intel Corporation
  5. **
  6. ********************************************************************************/
  7. #ifndef _DEBUG_H_
  8. #define _DEBUG_H_
  9. //
  10. // Modified version of ksdebug.h to support runtime debug level changes.
  11. //
  12. const int DBG_NONE = 0x00000000;
  13. const int DBG_PRINT = 0x00000001; // Blabla. Function entries for example
  14. const int DBG_WARNING = 0x00000002; // warning level
  15. const int DBG_ERROR = 0x00000004; // this doesn't generate a breakpoint
  16. // specific debug output; you don't have to enable DBG_PRINT for this.
  17. const int DBG_STREAM = 0x00000010; // Enables stream output.
  18. const int DBG_POWER = 0x00000020; // Enables power management output.
  19. const int DBG_DMA = 0x00000040; // Enables DMA engine output.
  20. const int DBG_REGS = 0x00000080; // Enables register outout.
  21. const int DBG_PROBE = 0x00000100; // Enables hardware probing output.
  22. const int DBG_SYSINFO = 0x00000200; // Enables system info output.
  23. const int DBG_VSR = 0x00000400; // Enables variable sample rate output.
  24. const int DBG_PROPERTY = 0x00000800; // Enables property handler output
  25. const int DBG_POSITION = 0x00001000; // Enables printing of position on GetPosition
  26. const int DBG_PINS = 0x10000000; // Enables dump of created pins in topology
  27. const int DBG_NODES = 0x20000000; // Enables dump of created nodes in topology
  28. const int DBG_CONNS = 0x40000000; // Enables dump of the connections in topology
  29. const int DBG_ALL = 0xFFFFFFFF;
  30. //
  31. // The default statements that will print are warnings (DBG_WARNING) and
  32. // errors (DBG_ERROR).
  33. //
  34. const int DBG_DEFAULT = 0x00000004; // Errors only.
  35. //
  36. // Define global debug variable.
  37. //
  38. #ifdef DEFINE_DEBUG_VARS
  39. #if (DBG)
  40. unsigned long ulDebugOut = DBG_DEFAULT;
  41. #endif
  42. #else // !DEFINED_DEBUG_VARS
  43. #if (DBG)
  44. extern unsigned long ulDebugOut;
  45. #endif
  46. #endif
  47. //
  48. // Define the print statement.
  49. //
  50. #if defined(__cplusplus)
  51. extern "C" {
  52. #endif // #if defined(__cplusplus)
  53. //
  54. // DBG is 1 in checked builds
  55. //
  56. #if (DBG)
  57. #define DOUT(lvl, strings) \
  58. if ((lvl) & ulDebugOut) \
  59. { \
  60. DbgPrint(STR_MODULENAME); \
  61. DbgPrint##strings; \
  62. DbgPrint("\n"); \
  63. }
  64. #define BREAK() \
  65. DbgBreakPoint()
  66. #else // if (!DBG)
  67. #define DOUT(lvl, strings)
  68. #define BREAK()
  69. #endif // !DBG
  70. #if defined(__cplusplus)
  71. }
  72. #endif // #if defined(__cplusplus)
  73. #endif