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.

71 lines
2.1 KiB

  1. /*++
  2. Copyright (c) 1995 Microsoft Corporation
  3. Module Name:
  4. lock.h
  5. Abstract:
  6. Prototypes for lock instructions
  7. Author:
  8. 15-Aug-1995 t-orig (Ori Gershony)
  9. Revision History:
  10. --*/
  11. // Macros for prototyping the lock helper functions
  12. #define LOCKHELPER0(fn) ULONG fn ## LockHelper ()
  13. #define LOCKHELPER1(fn,a1) ULONG fn ## LockHelper (a1)
  14. #define LOCKHELPER2(fn,a1,a2) ULONG fn ## LockHelper (a1,a2)
  15. #define LOCKHELPER3(fn,a1,a2,a3) ULONG fn ## LockHelper (a1,a2,a3)
  16. #define LOCKHELPER4(fn,a1,a2,a3,a4) ULONG fn ## LockHelper (a1,a2,a3,a4)
  17. // The lock fragments
  18. FRAG2(LockAddFrag32, ULONG);
  19. FRAG2(LockOrFrag32, ULONG);
  20. FRAG2(LockAdcFrag32, ULONG);
  21. FRAG2(LockSbbFrag32, ULONG);
  22. FRAG2(LockAndFrag32, ULONG);
  23. FRAG2(LockSubFrag32, ULONG);
  24. FRAG2(LockXorFrag32, ULONG);
  25. FRAG1(LockNotFrag32, ULONG);
  26. FRAG1(LockNegFrag32, ULONG);
  27. FRAG1(LockIncFrag32, ULONG);
  28. FRAG1(LockDecFrag32, ULONG);
  29. FRAG2(LockBtsMemFrag32, ULONG);
  30. FRAG2(LockBtsRegFrag32, ULONG);
  31. FRAG2(LockBtrMemFrag32, ULONG);
  32. FRAG2(LockBtrRegFrag32, ULONG);
  33. FRAG2(LockBtcMemFrag32, ULONG);
  34. FRAG2(LockBtcRegFrag32, ULONG);
  35. FRAG2REF(LockXchgFrag32, ULONG);
  36. FRAG2REF(LockXaddFrag32, ULONG);
  37. FRAG2REF(LockCmpXchgFrag32, ULONG);
  38. FRAG2REF(LockCmpXchg8bFrag32, ULONGLONG);
  39. // The lock helper functions
  40. LOCKHELPER3(Add, ULONG *localpop1, ULONG *pop1, ULONG op2);
  41. LOCKHELPER2(Or, ULONG *pop1, ULONG op2);
  42. LOCKHELPER4(Adc, ULONG *localpop1, ULONG *pop1, ULONG op2, ULONG carry);
  43. LOCKHELPER4(Sbb, ULONG *localpop1, ULONG *pop1, ULONG op2, ULONG carry);
  44. LOCKHELPER2(And, ULONG *pop1, ULONG op2);
  45. LOCKHELPER3(Sub, ULONG *localpop1, ULONG *pop1, ULONG op2);
  46. LOCKHELPER2(Xor, ULONG *pop1, ULONG op2);
  47. LOCKHELPER1(Not, ULONG *pop1);
  48. LOCKHELPER2(Neg, ULONG *localpop1, ULONG *pop1);
  49. LOCKHELPER2(Bts, ULONG *pop1, ULONG bit);
  50. LOCKHELPER2(Btr, ULONG *pop1, ULONG bit);
  51. LOCKHELPER2(Btc, ULONG *pop1, ULONG bit);
  52. LOCKHELPER2(Xchg, ULONG *pop1, ULONG *pop2);
  53. LOCKHELPER3(Xadd, ULONG *localpop1, ULONG *pop1, ULONG *pop2);
  54. LOCKHELPER4(CmpXchg, ULONG *Reax, ULONG *pop1, ULONG *pop2, ULONG *localpop1);
  55. LOCKHELPER3(CmpXchg8b, ULONGLONG *EaxEcx, ULONGLONG *EcxEdx, ULONGLONG *pop2);