Windows NT 4.0 source code leak
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.

184 lines
3.0 KiB

4 years ago
  1. // TITLE("Alpha PAL funtions for HAL")
  2. //++
  3. //
  4. // Copyright (c) 1992-1993 Digital Equipment Corporation
  5. //
  6. // Module Name:
  7. //
  8. // palhalt.s
  9. //
  10. // Abstract:
  11. //
  12. // This module implements routines to call PAL functions
  13. // from the Hal.
  14. //
  15. //
  16. // Author:
  17. //
  18. // Jeff McLeman (mcleman) 09-Jul-1992
  19. //
  20. // Environment:
  21. //
  22. // Kernel mode only.
  23. //
  24. // Revision History:
  25. //
  26. // 13-Jul-1992 Jeff McLeman (mcleman)
  27. // add HalpMb to functions.
  28. //
  29. // 14-Dec-1993 Joe Notarangelo
  30. // Change HalpHalt to HalpReboot to fit new call pal encodings.
  31. //--
  32. #include "ksalpha.h"
  33. //++
  34. //
  35. // VOID
  36. // HalpReboot(
  37. // )
  38. //
  39. // Routine Description:
  40. //
  41. // This function merely calls the PAL to reboot the Alpha processor.
  42. // THis is used to restart the console firmware. (Note, MIPS does
  43. // not have a REBOOT instruction, so there had to be a mechanism to
  44. // restart the firware. Alpha merely reboots, which causes a jump
  45. // to firmware PAL, which restarts the firmware.)
  46. //
  47. // Arguments:
  48. //
  49. // None.
  50. //
  51. // Return Value:
  52. //
  53. // None.
  54. //
  55. //--
  56. LEAF_ENTRY(HalpReboot)
  57. REBOOT // call the PAL to reboot to firmware
  58. .end HalpReboot
  59. //++
  60. //
  61. // VOID
  62. // HalpImb(
  63. // )
  64. //
  65. // Routine Description:
  66. //
  67. // This function merely calls the PAL to issue an Instruction
  68. // Memory Barrier on the Alpha processor..
  69. //
  70. // Arguments:
  71. //
  72. // None.
  73. //
  74. // Return Value:
  75. //
  76. // None.
  77. //
  78. //--
  79. LEAF_ENTRY(HalpImb)
  80. IMB // call the PAL to do an IMB
  81. ret zero,(ra)
  82. .end HalpImb
  83. //++
  84. //
  85. // VOID
  86. // HalpMb(
  87. // )
  88. //
  89. // Routine Description:
  90. //
  91. // This function merely calls the PAL to issue a general
  92. // Memory Barrier on the Alpha processor..
  93. //
  94. // Arguments:
  95. //
  96. // None.
  97. //
  98. // Return Value:
  99. //
  100. // None.
  101. //
  102. //--
  103. LEAF_ENTRY(HalpMb)
  104. mb // memory barrier
  105. ret zero, (ra)
  106. .end HalpMb
  107. //++
  108. //
  109. // VOID
  110. // HalpCachePcrValues(
  111. // )
  112. //
  113. // Routine Description:
  114. //
  115. // This function merely calls the PAL to cache values in the
  116. // PCR for faster access.
  117. //
  118. // Arguments:
  119. //
  120. // None.
  121. //
  122. // Return Value:
  123. //
  124. // None.
  125. //
  126. //--
  127. LEAF_ENTRY(HalpCachePcrValues)
  128. CACHE_PCR_VALUES // call the palcode
  129. ret zero,(ra)
  130. .end HalpCachePcrValues
  131. //++
  132. //
  133. // ULONG
  134. // HalpRpcc(
  135. // )
  136. //
  137. // Routine Description:
  138. //
  139. // This function executes the RPCC (read processor cycle counter)
  140. // instruction.
  141. //
  142. // Arguments:
  143. //
  144. // None.
  145. //
  146. // Return Value:
  147. //
  148. // The low-order 32 bits of the processor cycle counter is returned
  149. // as the function value.
  150. // N.B. At 125 MHz this counter wraps about every 30 seconds. It is
  151. // the caller's responsibility to deal with overflow or wraparound.
  152. //
  153. //--
  154. LEAF_ENTRY(HalpRpcc)
  155. rpcc v0 // get rpcc value
  156. addl v0, zero, v0 // extend
  157. ret zero, (ra) // return
  158. .end HalpRpcc