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.

111 lines
2.2 KiB

  1. /*++
  2. Copyright (c) 1999 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 OHCI_TAG 'hymp' //"HYMP"
  18. // always log
  19. #define DEBUG_LOG
  20. #if DBG
  21. // Triggers a break in the debugger in the registry key
  22. // debugbreakOn is set. These breakpoins are useful for
  23. // debugging hardware/client software problems
  24. //
  25. #define DEBUG_BREAK(dd) RegistrationPacket.USBPORTSVC_TestDebugBreak;
  26. //
  27. // This Breakpoint means we either need to test the code path
  28. // somehow or the code is not implemented. ie either case we
  29. // should not have any of these when the driver is finished
  30. //
  31. #define TEST_TRAP() {\
  32. DbgPrint("<OHCI TEST_TRAP> %s, line %d\n", __FILE__, __LINE__);\
  33. DbgBreakPoint();\
  34. }
  35. #define ASSERT_TRANSFER(dd, t) OHCI_ASSERT((dd), (t)->Sig == SIG_OHCI_TRANSFER)
  36. ULONG
  37. _cdecl
  38. OHCI_KdPrintX(
  39. PVOID DeviceData,
  40. ULONG Level,
  41. PCH Format,
  42. ...
  43. );
  44. #define OHCI_KdPrint(_x_) OHCI_KdPrintX _x_
  45. #define OHCI_ASSERT(dd, exp ) \
  46. if (!(exp)) {\
  47. RegistrationPacket.USBPORTSVC_AssertFailure( (dd), #exp, __FILE__, __LINE__, NULL );\
  48. }
  49. #define OHCI_ASSERT_ED(dd, ed) OHCI_ASSERT((dd), ((ed)->Sig == SIG_HCD_ED || \
  50. (ed)->Sig == SIG_HCD_DUMMY_ED))
  51. #else
  52. // debug macros for retail build
  53. #define TEST_TRAP()
  54. #define ASSERT_TRANSFER(dd, t)
  55. #define DEBUG_BREAK(dd)
  56. #define OHCI_KdPrint(_x_)
  57. #define OHCI_ASSERT_ED(dd, ed)
  58. #define OHCI_ASSERT(dd, exp )
  59. #endif /* DBG */
  60. // retail and debug
  61. #ifdef DEBUG_LOG
  62. #define LOGENTRY(dd, mask, sig, info1, info2, info3) \
  63. RegistrationPacket.USBPORTSVC_LogEntry( (dd), (mask), (sig), \
  64. (ULONG_PTR)(info1), (ULONG_PTR)(info2), (ULONG_PTR)(info3) )
  65. #else
  66. #define LOGENTRY(dd, mask, sig, info1, info2, info3)
  67. #endif
  68. #endif /* __DBG_H__ */