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.

116 lines
2.4 KiB

  1. /*++
  2. Copyright (c) 1999, 2000 Microsoft Corporation
  3. Module Name:
  4. dbg.h
  5. Abstract:
  6. debug macros
  7. Environment:
  8. Kernel & user mode
  9. Revision History:
  10. 6-20-99 : created
  11. --*/
  12. #ifndef __DBG_H__
  13. #define __DBG_H__
  14. // write to one of the reserved operational registers
  15. // we use this to trigger the PCI analyzer
  16. #define PCI_TRIGGER(hcOp) WRITE_REGISTER_ULONG(&(hcOp)->PciTrigger, 0xABADBABE);
  17. // always log
  18. #define DEBUG_LOG
  19. #if DBG
  20. // Triggers a break in the debugger in the registry key
  21. // debugbreakOn is set. These breakpoins are useful for
  22. // debugging hardware/client software problems
  23. //
  24. #define DEBUG_BREAK(dd) RegistrationPacket.USBPORTSVC_TestDebugBreak(dd);
  25. //
  26. // This Breakpoint means we either need to test the code path
  27. // somehow or the code is not implemented. ie either case we
  28. // should not have any of these when the driver is finished
  29. //
  30. #define TEST_TRAP() {\
  31. DbgPrint("<UHCI TEST_TRAP> %s, line %d\n", __FILE__, __LINE__);\
  32. DbgBreakPoint();\
  33. }
  34. #define TRAP_FATAL_ERROR() {\
  35. DbgPrint("<UHCI FATAL_ERROR> %s, line %d\n", __FILE__, __LINE__);\
  36. DbgBreakPoint();\
  37. }
  38. #define ASSERT_TRANSFER(dd, t) UHCI_ASSERT((dd), (t)->Sig == SIG_UHCI_TRANSFER)
  39. #define ASSERT_TD(dd, t) UHCI_ASSERT((dd), (t)->Sig == SIG_HCD_TD)
  40. ULONG
  41. _cdecl
  42. UhciKdPrintX(
  43. PVOID DeviceData,
  44. ULONG Level,
  45. PCH Format,
  46. ...
  47. );
  48. #define UhciKdPrint(_x_) UhciKdPrintX _x_
  49. #define UHCI_ASSERT(dd, exp ) \
  50. if (!(exp)) {\
  51. RegistrationPacket.USBPORTSVC_AssertFailure( (dd), #exp, __FILE__, __LINE__, NULL );\
  52. }
  53. #else
  54. // debug macros for retail build
  55. #define TEST_TRAP()
  56. #define DEBUG_BREAK(dd)
  57. #define TRAP_FATAL_ERROR()
  58. #define ASSERT_TRANSFER(dd, t)
  59. #define ASSERT_TD(dd, t)
  60. #define UHCI_ASSERT(dd, exp )
  61. #define UhciKdPrint(_x_)
  62. #endif /* DBG */
  63. // retail and debug
  64. #ifdef DEBUG_LOG
  65. #define LOGENTRY(dd, mask, sig, info1, info2, info3) \
  66. RegistrationPacket.USBPORTSVC_LogEntry( (dd), (mask), (sig), \
  67. (ULONG_PTR)(info1), (ULONG_PTR)(info2), (ULONG_PTR)(info3) )
  68. #else
  69. #define LOGENTRY(dd, mask, sig, info1, info2, info3)
  70. #endif
  71. #endif /* __DBG_H__ */