Leaked source code of windows server 2003
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.

208 lines
9.2 KiB

  1. /****************************************************************************
  2. * *
  3. * The following enumeration is ordered to match the _CONTEXT record. *
  4. * Enumerations after STIFS is ordered to match the _KSPECIAL_REGISTERS *
  5. * record. The ORDERING IS NECESSARY for GetRegValue() to index into the *
  6. * Context record correctly. *
  7. * *
  8. * SRxxx may be moved as a group only. *
  9. * *
  10. * Each floating point register occupies two numbers to address the *
  11. * Float128 as two high and low 64-bit parts *
  12. * *
  13. ****************************************************************************/
  14. enum {
  15. /* Begin of _CONTEXT */
  16. // Debug breakpoint registers
  17. REGDBI0, REGDBI1, REGDBI2, REGDBI3, REGDBI4, REGDBI5, REGDBI6, REGDBI7,
  18. REGDBD0, REGDBD1, REGDBD2, REGDBD3, REGDBD4, REGDBD5, REGDBD6, REGDBD7,
  19. /* all floating point high's are inserted for space */
  20. // Lower floating
  21. // FLTZERO, FLTONE,
  22. FLTS0, FLTS0H, FLTS1, FLTS1H, FLTS2, FLTS2H, FLTS3, FLTS3H, FLTT0, FLTT0H,
  23. FLTT1, FLTT1H, FLTT2, FLTT2H, FLTT3, FLTT3H, FLTT4, FLTT4H, FLTT5, FLTT5H,
  24. FLTT6, FLTT6H, FLTT7, FLTT7H, FLTT8, FLTT8H, FLTT9, FLTT9H,
  25. // high floating saved
  26. FLTS4, FLTS4H,
  27. FLTS5, FLTS5H, FLTS6, FLTS6H, FLTS7, FLTS7H, FLTS8, FLTS8H, FLTS9, FLTS9H,
  28. FLTS10, FLTS10H, FLTS11, FLTS11H, FLTS12, FLTS12H, FLTS13, FLTS13H, FLTS14, FLTS14H,
  29. FLTS15, FLTS15H, FLTS16, FLTS16H, FLTS17, FLTS17H, FLTS18, FLTS18H, FLTS19, FLTS19H,
  30. // high floating temp
  31. FLTF32, FLTF32H, FLTF33, FLTF33H, FLTF34, FLTF34H, FLTF35, FLTF35H, FLTF36, FLTF36H,
  32. FLTF37, FLTF37H, FLTF38, FLTF38H, FLTF39, FLTF39H, FLTF40, FLTF40H, FLTF41, FLTF41H,
  33. FLTF42, FLTF42H, FLTF43, FLTF43H, FLTF44, FLTF44H, FLTF45, FLTF45H, FLTF46, FLTF46H,
  34. FLTF47, FLTF47H, FLTF48, FLTF48H, FLTF49, FLTF49H, FLTF50, FLTF50H, FLTF51, FLTF51H,
  35. FLTF52, FLTF52H, FLTF53, FLTF53H, FLTF54, FLTF54H, FLTF55, FLTF55H, FLTF56, FLTF56H,
  36. FLTF57, FLTF57H, FLTF58, FLTF58H, FLTF59, FLTF59H, FLTF60, FLTF60H, FLTF61, FLTF61H,
  37. FLTF62, FLTF62H, FLTF63, FLTF63H, FLTF64, FLTF64H, FLTF65, FLTF65H, FLTF66, FLTF66H,
  38. FLTF67, FLTF67H, FLTF68, FLTF68H, FLTF69, FLTF69H, FLTF70, FLTF70H, FLTF71, FLTF71H,
  39. FLTF72, FLTF72H, FLTF73, FLTF73H, FLTF74, FLTF74H, FLTF75, FLTF75H, FLTF76, FLTF76H,
  40. FLTF77, FLTF77H, FLTF78, FLTF78H, FLTF79, FLTF79H, FLTF80, FLTF80H, FLTF81, FLTF81H,
  41. FLTF82, FLTF82H, FLTF83, FLTF83H, FLTF84, FLTF84H, FLTF85, FLTF85H, FLTF86, FLTF86H,
  42. FLTF87, FLTF87H, FLTF88, FLTF88H, FLTF89, FLTF89H, FLTF90, FLTF90H, FLTF91, FLTF91H,
  43. FLTF92, FLTF92H, FLTF93, FLTF93H, FLTF94, FLTF94H, FLTF95, FLTF95H, FLTF96, FLTF96H,
  44. FLTF97, FLTF97H, FLTF98, FLTF98H, FLTF99, FLTF99H, FLTF100, FLTF100H, FLTF101, FLTF101H,
  45. FLTF102, FLTF102H, FLTF103, FLTF103H, FLTF104, FLTF104H, FLTF105, FLTF105H, FLTF106, FLTF106H,
  46. FLTF107, FLTF107H, FLTF108, FLTF108H, FLTF109, FLTF109H, FLTF110, FLTF110H, FLTF111, FLTF111H,
  47. FLTF112, FLTF112H, FLTF113, FLTF113H, FLTF114, FLTF114H, FLTF115, FLTF115H, FLTF116, FLTF116H,
  48. FLTF117, FLTF117H, FLTF118, FLTF118H, FLTF119, FLTF119H, FLTF120, FLTF120H, FLTF121, FLTF121H,
  49. FLTF122, FLTF122H, FLTF123, FLTF123H, FLTF124, FLTF124H, FLTF125, FLTF125H, FLTF126, FLTF126H,
  50. FLTF127, FLTF127H,
  51. STFPSR, // FP Status saved
  52. // Integer registers
  53. // INTZERO,
  54. INTGP, INTT0, INTT1, INTS0, INTS1,
  55. INTS2, INTS3, INTV0, INTT2, INTT3, INTT4,
  56. INTSP, INTTEB, INTT5, INTT6, INTT7, INTT8,
  57. INTT9, INTT10, INTT11, INTT12, INTT13, INTT14,
  58. INTT15, INTT16, INTT17, INTT18, INTT19, INTT20,
  59. INTT21, INTT22,
  60. INTNATS, // Nat bits for r1-r31
  61. PREDS, // predicates saved
  62. // Branch registers
  63. BRRP, BRS0, BRS1, BRS2, BRS3, BRS4, BRT0, BRT1,
  64. // System registers - from _CONTEXT record
  65. APUNAT, APLC, APEC, APCCV, APDCR, // other application reg's
  66. RSPFS, RSBSP, RSBSPSTORE, RSRSC, RSRNAT, // register stack info
  67. STIPSR, STIIP, STIFS, // trap status info
  68. StFCR, // iA32 copy of Ar21
  69. Eflag, // iA32 (Ar24)
  70. SegCSD, // iA32 Descriptor(Ar25)
  71. SegSSD, // iA32 Descriptor(Ar26)
  72. Cflag, // iA32 (Ar27)
  73. STFSR, // x86 FP status
  74. STFIR,
  75. STFDR,
  76. /* End of _CONTEXT */
  77. INTR32, INTR33, INTR34, INTR35, INTR36, INTR37, INTR38, INTR39,
  78. INTR40, INTR41, INTR42, INTR43, INTR44,
  79. INTR45, INTR46, INTR47, INTR48, INTR49,
  80. INTR50, INTR51, INTR52, INTR53, INTR54,
  81. INTR55, INTR56, INTR57, INTR58, INTR59,
  82. INTR60, INTR61, INTR62, INTR63, INTR64,
  83. INTR65, INTR66, INTR67, INTR68, INTR69,
  84. INTR70, INTR71, INTR72, INTR73, INTR74,
  85. INTR75, INTR76, INTR77, INTR78, INTR79,
  86. INTR80, INTR81, INTR82, INTR83, INTR84,
  87. INTR85, INTR86, INTR87, INTR88, INTR89,
  88. INTR90, INTR91, INTR92, INTR93, INTR94,
  89. INTR95, INTR96, INTR97, INTR98, INTR99,
  90. INTR100, INTR101, INTR102, INTR103, INTR104,
  91. INTR105, INTR106, INTR107, INTR108, INTR109,
  92. INTR110, INTR111, INTR112, INTR113, INTR114,
  93. INTR115, INTR116, INTR117, INTR118, INTR119,
  94. INTR120, INTR121, INTR122, INTR123, INTR124,
  95. INTR125, INTR126, INTR127,
  96. /* Begin of _KSPECIAL_REGISTER */
  97. // Kernel debug breakpoint registers
  98. KRDBI0, KRDBI1, KRDBI2, KRDBI3, KRDBI4, KRDBI5, KRDBI6, KRDBI7,
  99. KRDBD0, KRDBD1, KRDBD2, KRDBD3, KRDBD4, KRDBD5, KRDBD6, KRDBD7,
  100. // Kernel performance monitor registers
  101. KRPFC0, KRPFC1, KRPFC2, KRPFC3, KRPFC4, KRPFC5, KRPFC6, KRPFC7,
  102. KRPFD0, KRPFD1, KRPFD2, KRPFD3, KRPFD4, KRPFD5, KRPFD6, KRPFD7,
  103. // Kernel bank shadow registers
  104. INTH16, INTH17, INTH18, INTH19, INTH20, INTH21, INTH22, INTH23,
  105. INTH24, INTH25, INTH26, INTH27, INTH28, INTH29, INTH30, INTH31,
  106. // System registers - from _KSPECIAL_REGISTERS record
  107. // application registers
  108. // CPUID registers
  109. ACPUID0, ACPUID1, ACPUID2, ACPUID3, ACPUID4, ACPUID5, ACPUID6, ACPUID7,
  110. // kernel registers
  111. APKR0, APKR1, APKR2, APKR3, APKR4, APKR5, APKR6, APKR7,
  112. APITC, APITM, APIVA, APPTA, APGPTA,
  113. STISR, STIDA, STIITR, STIIPA, STIIM, STIHA,
  114. // SAPIC registers
  115. SALID, SAIVR, SATPR, SAEOI, SAIRR0, SAIRR1, SAIRR2, SAIRR3,
  116. SAITV, SAPMV, SACMCV, SALRR0, SALRR1,
  117. // region registers
  118. SRRR0, SRRR1, SRRR2, SRRR3, SRRR4, SRRR5, SRRR6, SRRR7,
  119. // protection key regs
  120. SRPKR0, SRPKR1, SRPKR2, SRPKR3, SRPKR4, SRPKR5, SRPKR6, SRPKR7,
  121. SRPKR8, SRPKR9, SRPKR10, SRPKR11, SRPKR12, SRPKR13, SRPKR14, SRPKR15,
  122. // translation lookaside registers
  123. SRTRI0, SRTRI1, SRTRI2, SRTRI3, SRTRI4, SRTRI5, SRTRI6, SRTRI7,
  124. SRTRD0, SRTRD1, SRTRD2, SRTRD3, SRTRD4, SRTRD5, SRTRD6, SRTRD7,
  125. // machine specific registers
  126. SMSR0, SMSR1, SMSR2, SMSR3, SMSR4, SMSR5, SMSR6, SMSR7,
  127. /* End of _KSPECIAL_REGISTERS */
  128. // IPSR flags
  129. IPSRBN, IPSRED, IPSRRI, IPSRSS, IPSRDD, IPSRDA, IPSRID, IPSRIT,
  130. IPSRME, IPSRIS, IPSRCPL, IPSRRT, IPSRTB, IPSRLP, IPSRDB,
  131. IPSRSI, IPSRDI, IPSRPP, IPSRSP, IPSRDFH, IPSRDFL, IPSRDT,
  132. IPSRPK, IPSRI, IPSRIC, IPSRAC, IPSRUP, IPSRBE, IPSROR,
  133. // FPSR flags
  134. FPSRMDH, FPSRMDL, FPSRSF3, FPSRSF2, FPSRSF1, FPSRSF0,
  135. FPSRTRAPID, FPSRTRAPUD, FPSRTRAPOD, FPSRTRAPZD, FPSRTRAPDD, FPSRTRAPVD,
  136. // Predicate registers
  137. // PR0,
  138. PR1, PR2, PR3,
  139. PR4, PR5, PR6, PR7,
  140. PR8, PR9, PR10, PR11,
  141. PR12, PR13, PR14, PR15,
  142. PR16, PR17, PR18, PR19,
  143. PR20, PR21, PR22, PR23,
  144. PR24, PR25, PR26, PR27,
  145. PR28, PR29, PR30, PR31,
  146. PR32, PR33, PR34, PR35,
  147. PR36, PR37, PR38, PR39,
  148. PR40, PR41, PR42, PR43,
  149. PR44, PR45, PR46, PR47,
  150. PR48, PR49, PR50, PR51,
  151. PR52, PR53, PR54, PR55,
  152. PR56, PR57, PR58, PR59,
  153. PR60, PR61, PR62, PR63,
  154. };
  155. #define IA64_DBBASE REGDBI0
  156. #define IA64_DBLAST REGDBD7
  157. #define IA64_FLTBASE FLTS0
  158. #define IA64_FLTLAST FLTF127
  159. #define IA64_REGBASE INTGP
  160. #define IA64_ARBASE APUNAT
  161. #define IA64_SRBASE KRDBI0
  162. #define IA64_SREND SMSR7
  163. #define IA64_FLAGBASE IPSRBN
  164. #define IA64_DB_COUNT (IA64_DBLAST - IA64_DBBASE + 1)
  165. // Debug register flags.
  166. #define IA64_DBR_RDWR 0xC000000000000000UI64
  167. #define IA64_DBR_RD 0x8000000000000000UI64
  168. #define IA64_DBR_WR 0x4000000000000000UI64
  169. #define IA64_DBR_EXEC 0x8000000000000000UI64
  170. #define IA64_DBG_MASK_MASK 0x00FFFFFFFFFFFFFFUI64
  171. #define IA64_DBG_REG_PLM_USER 0x0800000000000000UI64
  172. #define IA64_DBG_REG_PLM_ALL 0x0F00000000000000UI64