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.

128 lines
2.8 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. //
  15. // Structure signatures
  16. //
  17. #define EHCI_TAG 'ehci' //"EHCI"
  18. // write to one of the reserved operational registers
  19. // we use this to trigger the PCI analyzer
  20. #define PCI_TRIGGER(hcOp) WRITE_REGISTER_ULONG(&(hcOp)->PciTrigger, 0xABADBABE);
  21. #if DBG
  22. #define DEBUG_LOG
  23. // Triggers a break in the debugger in the registry key
  24. // debugbreakOn is set. These breakpoins are useful for
  25. // debugging hardware/client software problems
  26. //
  27. #define DEBUG_BREAK(dd) RegistrationPacket.USBPORTSVC_TestDebugBreak;
  28. //
  29. // This Breakpoint means we either need to test the code path
  30. // somehow or the code is not implemented. ie either case we
  31. // should not have any of these when the driver is finished
  32. //
  33. #define TEST_TRAP() {\
  34. DbgPrint("<EHCI TEST_TRAP> %s, line %d\n", __FILE__, __LINE__);\
  35. DbgBreakPoint();\
  36. }
  37. #define ASSERT_TRANSFER(dd, t) EHCI_ASSERT((dd), (t)->Sig == SIG_EHCI_TRANSFER)
  38. #define ASSERT_TD(dd, t) EHCI_ASSERT((dd), (t)->Sig == SIG_HCD_TD)
  39. #define ASSERT_SITD(dd, t) EHCI_ASSERT((dd), (t)->Sig == SIG_HCD_SITD)
  40. #define ASSERT_ITD(dd, t) EHCI_ASSERT((dd), (t)->Sig == SIG_HCD_ITD)
  41. #define ASSERT_DUMMY_TD(dd, t) \
  42. EHCI_ASSERT((dd), (t)->NextHcdTD.Pointer == NULL);\
  43. EHCI_ASSERT((dd), (t)->AltNextHcdTD.Pointer == NULL);
  44. ULONG
  45. _cdecl
  46. EHCI_KdPrintX(
  47. PVOID DeviceData,
  48. ULONG Level,
  49. PCH Format,
  50. ...
  51. );
  52. #define EHCI_KdPrint(_x_) EHCI_KdPrintX _x_
  53. #define EHCI_ASSERT(dd, exp ) \
  54. if (!(exp)) {\
  55. RegistrationPacket.USBPORTSVC_AssertFailure( (dd), #exp, __FILE__, __LINE__, NULL );\
  56. }
  57. #define EHCI_QHCHK(dd, ed) EHCI_AssertQhChk(dd, ed);
  58. #else
  59. // debug macros for retail build
  60. #define TEST_TRAP()
  61. #define DEBUG_BREAK(dd)
  62. #define ASSERT_TRANSFER(dd, t)
  63. #define ASSERT_DUMMY_TD(dd, t)
  64. #define ASSERT_TD(dd, t)
  65. #define ASSERT_SITD(dd, t)
  66. #define ASSERT_ITD(dd, t)
  67. #define EHCI_ASSERT(dd, exp )
  68. #define EHCI_KdPrint(_x_)
  69. #define EHCI_QHCHK(dd, ed)
  70. #endif /* DBG */
  71. // retail and debug
  72. #ifdef DEBUG_LOG
  73. #define LOGENTRY(dd, mask, sig, info1, info2, info3) \
  74. RegistrationPacket.USBPORTSVC_LogEntry( (dd), (mask), (sig), \
  75. (ULONG_PTR)(info1), (ULONG_PTR)(info2), (ULONG_PTR)(info3) )
  76. #else
  77. #define LOGENTRY(dd, mask, sig, info1, info2, info3)
  78. #endif
  79. #endif /* __DBG_H__ */