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.

104 lines
1.8 KiB

  1. /*++
  2. Copyright (c) 1998-1999 Microsoft Corporation
  3. Module Name:
  4. dbg.c ARP1394 Debugging Code
  5. Abstract:
  6. NT System entry points for ARP1394.
  7. Revision History:
  8. Who When What
  9. -------- -------- ----------------------------------------------
  10. josephj 12-02-98 Created
  11. Notes:
  12. --*/
  13. #include <precomp.h>
  14. //
  15. // File-specific debugging defaults.
  16. //
  17. #define TM_CURRENT TM_DBG
  18. INT g_DiscardNonUnicastPackets;
  19. INT g_SkipAll;
  20. #if DBG
  21. ULONG g_ulTraceMask = 0xffffffff;
  22. #define DEFAULT_TRACE_LEVEL TL_FATAL
  23. INT g_ulTraceLevel = DEFAULT_TRACE_LEVEL;
  24. void
  25. DbgMark(UINT Luid)
  26. {
  27. // do nothing useful, but do something specific, so that the compiler doesn't
  28. // alias DbgMark to some other function that happens to do nothing.
  29. //
  30. static int i;
  31. i=Luid;
  32. }
  33. LONG g_MaxReentrancy = 5;
  34. LONG g_MaxGlobalReentrancy = 10;
  35. LONG g_ReentrancyCount=1;
  36. VOID
  37. arpDbgIncrementReentrancy(
  38. PLONG pReentrancyCount
  39. )
  40. {
  41. LONG Count;
  42. Count = NdisInterlockedIncrement(pReentrancyCount);
  43. if (Count > (g_MaxReentrancy+1))
  44. {
  45. #if MILLEN
  46. DbgBreakPoint();
  47. #endif
  48. NdisInterlockedIncrement(&g_MaxReentrancy);
  49. }
  50. Count = NdisInterlockedIncrement(&g_ReentrancyCount);
  51. if (Count > (g_MaxGlobalReentrancy+1))
  52. {
  53. #if MILLEN
  54. DbgBreakPoint();
  55. #endif
  56. NdisInterlockedIncrement(&g_MaxGlobalReentrancy);
  57. }
  58. }
  59. VOID
  60. arpDbgDecrementReentrancy(
  61. PLONG pReentrancyCount
  62. )
  63. {
  64. LONG Count;
  65. Count = NdisInterlockedDecrement(pReentrancyCount);
  66. if (Count<0)
  67. {
  68. #if MILLEN
  69. DbgBreakPoint();
  70. #endif
  71. }
  72. Count = NdisInterlockedDecrement(&g_ReentrancyCount);
  73. if (Count<0)
  74. {
  75. #if MILLEN
  76. DbgBreakPoint();
  77. #endif
  78. }
  79. }
  80. #endif // DBG