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.

133 lines
2.7 KiB

  1. /*++
  2. Copyright (c) 1995 Microsoft Corporation
  3. Module Name:
  4. synlock.h
  5. Abstract:
  6. Prototypes for synlock.c
  7. Author:
  8. 22-Aug-1995 t-orig (Ori Gershony)
  9. Revision History:
  10. 24-Aug-1999 [askhalid] copied from 32-bit wx86 directory and make work for 64bit.
  11. 20-Sept-1999[barrybo] added FRAG2REF(LockCmpXchg8bFrag32, ULONGLONG)
  12. --*/
  13. //
  14. // Macros for 8 bit fragments
  15. //
  16. #define SLOCKFRAG1_8(x) \
  17. FRAG1(SynchLock ## x ## Frag8, unsigned char);
  18. #define SLOCKFRAG2_8(x) \
  19. FRAG2(SynchLock ## x ## Frag8, unsigned char);
  20. #define SLOCKFRAG2REF_8(x) \
  21. FRAG2REF(SynchLock ## x ## Frag8, unsigned char);
  22. //
  23. // Macros for 16 bit fragments
  24. //
  25. #define SLOCKFRAG1_16(x) \
  26. FRAG1(SynchLock ## x ## Frag16, unsigned short);
  27. #define SLOCKFRAG2_16(x) \
  28. FRAG2(SynchLock ## x ## Frag16, unsigned short);
  29. #define SLOCKFRAG2REF_16(x) \
  30. FRAG2REF(SynchLock ## x ## Frag16, unsigned short);
  31. //
  32. // Macros for 32 bit fragments
  33. //
  34. #define SLOCKFRAG1_32(x) \
  35. FRAG1(SynchLock ## x ## Frag32, unsigned long);
  36. #define SLOCKFRAG2_32(x) \
  37. FRAG2(SynchLock ## x ## Frag32, unsigned long);
  38. #define SLOCKFRAG2REF_32(x) \
  39. FRAG2REF(SynchLock ## x ## Frag32, unsigned long);
  40. //
  41. // Monster macros!
  42. //
  43. #define SLOCKFRAG1(x) \
  44. SLOCKFRAG1_8(x) \
  45. SLOCKFRAG1_16(x) \
  46. SLOCKFRAG1_32(x)
  47. #define SLOCKFRAG2(x) \
  48. SLOCKFRAG2_8(x) \
  49. SLOCKFRAG2_16(x) \
  50. SLOCKFRAG2_32(x)
  51. #define SLOCKFRAG2REF(x) \
  52. SLOCKFRAG2REF_8(x) \
  53. SLOCKFRAG2REF_16(x) \
  54. SLOCKFRAG2REF_32(x)
  55. //
  56. // Now finally the actual fragments
  57. //
  58. SLOCKFRAG2(Add)
  59. SLOCKFRAG2(Or)
  60. SLOCKFRAG2(Adc)
  61. SLOCKFRAG2(Sbb)
  62. SLOCKFRAG2(And)
  63. SLOCKFRAG2(Sub)
  64. SLOCKFRAG2(Xor)
  65. SLOCKFRAG1(Not)
  66. SLOCKFRAG1(Neg)
  67. SLOCKFRAG1(Inc)
  68. SLOCKFRAG1(Dec)
  69. SLOCKFRAG2REF(Xchg)
  70. SLOCKFRAG2REF(Xadd)
  71. SLOCKFRAG2REF(CmpXchg)
  72. FRAG2REF(SynchLockCmpXchg8bFrag32, ULONGLONG);
  73. //
  74. // Bts, Btr and Btc only come in 16bit and 32bit flavors
  75. //
  76. SLOCKFRAG2_16(BtsMem)
  77. SLOCKFRAG2_16(BtsReg)
  78. SLOCKFRAG2_16(BtrMem)
  79. SLOCKFRAG2_16(BtrReg)
  80. SLOCKFRAG2_16(BtcMem)
  81. SLOCKFRAG2_16(BtcReg)
  82. SLOCKFRAG2_32(BtsMem)
  83. SLOCKFRAG2_32(BtsReg)
  84. SLOCKFRAG2_32(BtrMem)
  85. SLOCKFRAG2_32(BtrReg)
  86. SLOCKFRAG2_32(BtcMem)
  87. SLOCKFRAG2_32(BtcReg)
  88. //
  89. // Now undef the macros
  90. //
  91. #undef SLOCKFRAG1_8
  92. #undef SLOCKFRAG2_8
  93. #undef SLOCKFRAG2REF_8
  94. #undef SLOCKFRAG1_16
  95. #undef SLOCKFRAG2_16
  96. #undef SLOCKFRAG2REF_16
  97. #undef SLOCKFRAG1_32
  98. #undef SLOCKFRAG2_32
  99. #undef SLOCKFRAG2REF_32
  100. #undef SLOCKFRAG1
  101. #undef SLOCKFRAG2
  102. #undef SLOCKFRAG2REF