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.

86 lines
1.6 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. NdisInterlockedIncrement(&g_MaxReentrancy);
  46. }
  47. Count = NdisInterlockedIncrement(&g_ReentrancyCount);
  48. if (Count > (g_MaxGlobalReentrancy+1))
  49. {
  50. NdisInterlockedIncrement(&g_MaxGlobalReentrancy);
  51. }
  52. }
  53. VOID
  54. arpDbgDecrementReentrancy(
  55. PLONG pReentrancyCount
  56. )
  57. {
  58. LONG Count;
  59. Count = NdisInterlockedDecrement(pReentrancyCount);
  60. Count = NdisInterlockedDecrement(&g_ReentrancyCount);
  61. }
  62. #endif // DBG