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.

120 lines
3.2 KiB

  1. // TITLE("Fast Event Pair Support")
  2. //++
  3. //
  4. // Copyright (c) 1992 Microsoft Corporation
  5. // Copyright (c) 1992 Digital Equipment Corporation
  6. //
  7. // Module Name:
  8. //
  9. // evpair.s
  10. //
  11. // Abstract:
  12. //
  13. // This module contains the implementation for the fast event pair
  14. // system services that are used for client/server synchronization.
  15. //
  16. // Author:
  17. //
  18. // David N. Cutler (davec) 1-Feb-1992
  19. //
  20. // Environment:
  21. //
  22. // Kernel mode.
  23. //
  24. // Revision History:
  25. //
  26. // Thomas Van Baak (tvb) 20-May-1992
  27. //
  28. // Adapted for Alpha AXP.
  29. //
  30. //--
  31. #include "ksalpha.h"
  32. SBTTL("Set Low Wait High Thread")
  33. //++
  34. //
  35. // NTSTATUS
  36. // NtSetLowWaitHighThread (
  37. // )
  38. //
  39. // Routine Description:
  40. //
  41. // This function uses the prereferenced client/server event pair pointer
  42. // and sets the low event of the event pair and waits on the high event
  43. // of the event pair object.
  44. //
  45. // N.B. This is a very heavily used service.
  46. //
  47. // Arguments:
  48. //
  49. // None.
  50. //
  51. // Return Value:
  52. //
  53. // STATUS_NO_EVENT_PAIR is returned if no event pair is associated with
  54. // the current thread. Otherwise, the status of the wait operation is
  55. // returned as the function value.
  56. //
  57. //
  58. //--
  59. LEAF_ENTRY(NtSetLowWaitHighThread)
  60. GET_CURRENT_THREAD // v0 = current thread
  61. ldl a0, EtEventPair(v0) // get address of event pair object
  62. beq a0, 10f // if eq, no event pair associated
  63. addl a0, EpEventHigh, a1 // compute client event address
  64. addl a0, EpEventLow, a0 // comput server event address
  65. ldil a2, 1 // set user mode value
  66. br zero, KiSetServerWaitClientEvent // finish in wait code
  67. 10: ldil v0, STATUS_NO_EVENT_PAIR // set error status return value
  68. ret zero, (ra) // return
  69. .end NtSetLowWaitHighThread
  70. SBTTL("Set High Wait Low Thread")
  71. //++
  72. //
  73. // NTSTATUS
  74. // NtSetHighWaitLowThread (
  75. // )
  76. //
  77. // Routine Description:
  78. //
  79. // This function uses the prereferenced client/server event pair pointer
  80. // and sets the High event of the event pair and waits on the low event
  81. // of the event pair object.
  82. //
  83. // N.B. This is a very heavily used service.
  84. //
  85. // Arguments:
  86. //
  87. // None.
  88. //
  89. // Return Value:
  90. //
  91. // STATUS_NO_EVENT_PAIR is returned if no event pair is associated with
  92. // the current thread. Otherwise, the status of the wait operation is
  93. // returned as the function value.
  94. //
  95. //
  96. //--
  97. LEAF_ENTRY(NtSetHighWaitLowThread)
  98. GET_CURRENT_THREAD // v0 = current thread
  99. ldl a0, EtEventPair(v0) // get address of event pair object
  100. beq a0, 10f // if eq, no event pair associated
  101. addl a0, EpEventLow, a1 // compute client event address
  102. addl a0, EpEventHigh, a0 // compute server event address
  103. ldil a2, 1 // set user mode value
  104. br zero, KiSetServerWaitClientEvent // finish in wait code
  105. 10: ldil v0, STATUS_NO_EVENT_PAIR // set error status return value
  106. ret zero, (ra) // return
  107. .end NtSetHighWaitLowThread