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.

149 lines
4.2 KiB

  1. // TITLE("POSIX Thunks")
  2. //++
  3. //
  4. // Copyright (c) 1991 Microsoft Corporation
  5. // Copyright (c) 1993 Digital Equipment Corporation
  6. //
  7. // Module Name:
  8. //
  9. // psxthunk.s
  10. //
  11. // Abstract:
  12. //
  13. // Author:
  14. //
  15. // Ellena Aycock-Wright (ellena) 11-Jan-1991
  16. //
  17. // Revision History:
  18. //
  19. // Thomas Van Baak (tvb) 11-Dec-1992
  20. //
  21. // Adapted for Alpha AXP.
  22. //
  23. //--
  24. #include "ksalpha.h"
  25. SBTTL("Call Null Api")
  26. //++
  27. //
  28. // The following code is never executed. Its purpose is to support unwinding
  29. // through the call to the null API function. The instructions below are read
  30. // by virtual unwind to restore the context of the calling function.
  31. //
  32. //--
  33. NESTED_ENTRY(PdxNullApiCall, ContextFrameLength, zero)
  34. .set noreorder
  35. .set noat
  36. stq sp, CxIntSp(sp) // stack pointer
  37. stq ra, CxIntRa(sp) // return address
  38. stq ra, CxFir(sp) // continuation address
  39. stq gp, CxIntGp(sp) // integer register gp
  40. stq s0, CxIntS0(sp) // integer registers s0 - s5
  41. stq s1, CxIntS1(sp) //
  42. stq s2, CxIntS2(sp) //
  43. stq s3, CxIntS3(sp) //
  44. stq s4, CxIntS4(sp) //
  45. stq s5, CxIntS5(sp) //
  46. stq fp, CxIntFp(sp) // integer register fp
  47. stt f2, CxFltF2(sp) // floating registers f2 - f9
  48. stt f3, CxFltF3(sp) //
  49. stt f4, CxFltF4(sp) //
  50. stt f5, CxFltF5(sp) //
  51. stt f6, CxFltF6(sp) //
  52. stt f7, CxFltF7(sp) //
  53. stt f8, CxFltF8(sp) //
  54. stt f9, CxFltF9(sp) //
  55. .set at
  56. .set reorder
  57. PROLOGUE_END
  58. ALTERNATE_ENTRY(_PdxNullApiCaller)
  59. mov sp, a0 // set address of context record
  60. bsr ra, PdxNullApiCaller // call null api caller
  61. .end PdxNullApiCaller
  62. SBTTL("Call Signal Deliverer")
  63. //++
  64. //
  65. // The following code is never executed. Its purpose is to support unwinding
  66. // through the call to the signal deliverer. The instructions below are read
  67. // by virtual unwind to restore the context of the calling function.
  68. //
  69. //--
  70. NESTED_ENTRY(PdxSignalDeliver, ContextFrameLength, zero)
  71. .set noreorder
  72. .set noat
  73. stq sp, CxIntSp(sp) // stack pointer
  74. stq ra, CxIntRa(sp) // return address
  75. stq ra, CxFir(sp) // continuation address
  76. stq gp, CxIntGp(sp) // integer register gp
  77. stq s0, CxIntS0(sp) // integer registers s0 - s5
  78. stq s1, CxIntS1(sp) //
  79. stq s2, CxIntS2(sp) //
  80. stq s3, CxIntS3(sp) //
  81. stq s4, CxIntS4(sp) //
  82. stq s5, CxIntS5(sp) //
  83. stq fp, CxIntFp(sp) // integer register fp
  84. stt f2, CxFltF2(sp) // floating registers f2 - f9
  85. stt f3, CxFltF3(sp) //
  86. stt f4, CxFltF4(sp) //
  87. stt f5, CxFltF5(sp) //
  88. stt f6, CxFltF6(sp) //
  89. stt f7, CxFltF7(sp) //
  90. stt f8, CxFltF8(sp) //
  91. stt f9, CxFltF9(sp) //
  92. .set at
  93. .set reorder
  94. PROLOGUE_END
  95. //++
  96. //
  97. // VOID
  98. // _PdxSignalDeliverer (
  99. // IN PCONTEXT Context,
  100. // IN sigset_t Mask,
  101. // IN int Signal,
  102. // IN _handler Handler
  103. // )
  104. //
  105. // Routine Description:
  106. //
  107. // The following routine provides linkage to POSIX client routines to
  108. // perform signal delivery.
  109. //
  110. // Arguments:
  111. //
  112. // s0 - s5 - Supply parameter values.
  113. //
  114. // sp - Supplies the address of a context record.
  115. //
  116. // Return Value:
  117. //
  118. // There is no return from these routines.
  119. //
  120. //--
  121. ALTERNATE_ENTRY(_PdxSignalDeliverer)
  122. mov sp, a0 // set address of context record
  123. mov s1, a1 // set previous block mask
  124. mov s2, a2 // set signal number
  125. mov s3, a3 // set signal handler
  126. bsr ra, PdxSignalDeliverer // deliver signal to POSIX client
  127. .end _PsxSignalDeliverer