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.

263 lines
6.6 KiB

  1. /**
  2. *** Copyright (C) 1996-99 Intel Corporation. All rights reserved.
  3. ***
  4. *** The information and source code contained herein is the exclusive
  5. *** property of Intel Corporation and may not be disclosed, examined
  6. *** or reproduced in whole or in part without explicit written authorization
  7. *** from the company.
  8. **/
  9. #if defined(__assembler)
  10. //
  11. // Define standard integer registers.
  12. //
  13. zero = r0 // always 0
  14. gp = r1 // global pointer
  15. v0 = r8 // return value
  16. sp = r12 // stack pointer
  17. s0 = r4 // saved (preserved) integer registers
  18. s1 = r5
  19. s2 = r6
  20. s3 = r7
  21. //
  22. // temporary (volatile) integer registers
  23. //
  24. t0 = r2
  25. t1 = r3
  26. t2 = r9
  27. t3 = r10
  28. t4 = r11
  29. t5 = r14
  30. t6 = r15
  31. t7 = r16
  32. t8 = r17
  33. t9 = r18
  34. t10 = r19
  35. t11 = r20
  36. t12 = r21
  37. t13 = r22
  38. t14 = r23
  39. t15 = r24
  40. t16 = r25
  41. t17 = r26
  42. t18 = r27
  43. t19 = r28
  44. t20 = r29
  45. t21 = r30
  46. t22 = r31
  47. //
  48. // Floating point saved (preserved) registers
  49. //
  50. fs0 = f2
  51. fs1 = f3
  52. fs2 = f4
  53. fs3 = f5
  54. fs4 = f16
  55. fs5 = f17
  56. fs6 = f18
  57. fs7 = f19
  58. fs8 = f20
  59. fs9 = f21
  60. fs10 = f22
  61. fs11 = f23
  62. fs12 = f24
  63. fs13 = f25
  64. fs14 = f26
  65. fs15 = f27
  66. fs16 = f28
  67. fs17 = f29
  68. fs18 = f30
  69. fs19 = f31
  70. //
  71. // Low floating point temporary (volatile) registers
  72. //
  73. ft0 = f6
  74. ft1 = f7
  75. ft2 = f8
  76. ft3 = f9
  77. ft4 = f10
  78. ft5 = f11
  79. ft6 = f12
  80. ft7 = f13
  81. ft8 = f14
  82. ft9 = f15
  83. //
  84. // input arguments
  85. // Should be:
  86. // a0 = in0
  87. // a1 = in1
  88. // a2 = in2
  89. // a3 = in3
  90. // a4 = in4
  91. // a5 = in5
  92. // a6 = in6
  93. // a7 = in7
  94. //
  95. a0 = r32
  96. a1 = r33
  97. a2 = r34
  98. a3 = r35
  99. a4 = r36
  100. a5 = r37
  101. a6 = r38
  102. a7 = r39
  103. //
  104. // branch return pointer (b0)
  105. //
  106. brp = rp
  107. //
  108. // branch saved (preserved)
  109. //
  110. bs0 = b1
  111. bs1 = b2
  112. bs2 = b3
  113. bs3 = b4
  114. bs4 = b5
  115. //
  116. // branch temporary (volatile) registers
  117. //
  118. bt0 = b6
  119. bt1 = b7
  120. //
  121. // predicate registers
  122. //
  123. // p0 predicate register always 1
  124. //
  125. ps0 = p1 // saved (preserved) predicate registers
  126. ps1 = p2
  127. ps2 = p3
  128. ps3 = p4
  129. ps4 = p5
  130. ps5 = p16 // Predicates p16-p63 are also preserved
  131. ps6 = p17
  132. ps7 = p18
  133. ps8 = p19
  134. ps9 = p20
  135. pt0 = p6 // temporary (volatile) predicate registers
  136. pt1 = p7
  137. pt2 = p8
  138. pt3 = p9
  139. pt4 = p10
  140. pt5 = p11
  141. pt6 = p12
  142. pt7 = p13
  143. pt8 = p14
  144. pt9 = p15
  145. //
  146. // Kernel registers
  147. //
  148. k0 = ar.k0
  149. k1 = ar.k1
  150. k2 = ar.k2
  151. k3 = ar.k3
  152. k4 = ar.k4
  153. k5 = ar.k5
  154. k6 = ar.k6
  155. k7 = ar.k7
  156. ia32dr67 = ar.k5 // dr6/dr7 for iA32
  157. ia32fcr = ar21 // FCR for iA32
  158. ia32eflag = ar24 // EFLAG for iA32
  159. ia32csd = ar25 // CSD for iA32
  160. ia32ssd = ar26 // SSD for iA32
  161. ia32cflag = ar27 // CFLG (cr0/cr4) for iA32
  162. ia32fsr = ar28 // FSR for iA32
  163. ia32fir = ar29 // FIR for iA32
  164. ia32fdr = ar30 // FDR for iA32
  165. //
  166. // Define iA32 constants, to be used by ISA transition code
  167. //
  168. _DataSelector == 0x23
  169. _CodeSelector == 0x1b
  170. _FsSelector == 0x3b
  171. _LdtSelector == 0x4b
  172. //
  173. // Define the IA-32 registers
  174. //
  175. rEax = r8 // v0
  176. rEcx = r9 // t2
  177. rEdx = r10 // t3
  178. rEbx = r11 // t4
  179. rEsp = r12 // sp
  180. rEbp = r13 // teb
  181. rEsi = r14 // t5
  182. rEdi = r15 // t6
  183. //
  184. // Define iA-32 Segment Registers mapping
  185. //
  186. rDSESFSGS = r16 // ES selector register (t7)
  187. rCSSSLDTTSS = r17 // CS selector register (t8)
  188. rEFLAG = ar24 // Eflag register
  189. rESD = r24 // ES Descriptor register (t15)
  190. rCSD = ar25 // CS Descriptor register
  191. rSSD = ar26 // SS Descriptor register
  192. rDSD = r27 // DS Descriptor register (t18)
  193. rFSD = r28 // FS Descriptor register (t19)
  194. rGSD = r29 // GS Descriptor register (t20)
  195. rLDTD = r30 // LDT Descriptor register (t21)
  196. rGDTD = r31 // GDT Descriptor register (t22)
  197. //
  198. // pointer to thread environment block
  199. //
  200. teb = r13 // per s/w convention
  201. kteb = ar.k3 // known "true" value (changed only by kernel)
  202. //
  203. // kernel bank shadow (hidden) registers
  204. //
  205. h16 = r16
  206. h17 = r17
  207. h18 = r18
  208. h19 = r19
  209. h20 = r20
  210. h21 = r21
  211. h22 = r22
  212. h23 = r23
  213. h24 = r24
  214. h25 = r25
  215. h26 = r26
  216. h27 = r27
  217. h28 = r28
  218. h29 = r29
  219. h30 = r30
  220. h31 = r31
  221. // Standard register aliases for procedure entry/exit
  222. // Should be:
  223. // savedpfs = loc0
  224. // savedbrp = loc1
  225. #define savedpfs loc0
  226. #define savedbrp loc1
  227. #endif