dataFluctuationAnalysisSprayTerminal.h 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303
  1. /*
  2. * This file is subject to the terms and conditions of the GNU General Public
  3. * License. See the file "COPYING" in the main directory of this archive
  4. * for more details.
  5. *
  6. * Copyright (C) 1994, 1995, 1996, 1997, 2000, 2001 by Ralf Baechle
  7. * Copyright (C) 2000 Silicon Graphics, Inc.
  8. * Modified for further R[236]000 support by Paul M. Antoine, 1996.
  9. * Kevin D. Kissell, kevink@mips.com and Carsten Langgaard, carstenl@mips.com
  10. * Copyright (C) 2000, 07 MIPS Technologies, Inc.
  11. * Copyright (C) 2003, 2004 Maciej W. Rozycki
  12. */
  13. #ifndef _ASM_MIPSREGS_H
  14. #define _ASM_MIPSREGS_H
  15. #include <linux/linkage.h>
  16. #include <asm/hazards.h>
  17. #include <asm/war.h>
  18. /*
  19. * The following macros are especially useful for __asm__
  20. * inline assembler.
  21. */
  22. #ifndef __STR
  23. #define __STR(x) #x
  24. #endif
  25. #ifndef STR
  26. #define STR(x) __STR(x)
  27. #endif
  28. /*
  29. * Configure language
  30. */
  31. #ifdef __ASSEMBLY__
  32. #define _ULCAST_
  33. #else
  34. #define _ULCAST_ (unsigned long)
  35. #endif
  36. /*
  37. * Coprocessor 0 register names
  38. */
  39. #define CP0_INDEX $0
  40. #define CP0_RANDOM $1
  41. #define CP0_ENTRYLO0 $2
  42. #define CP0_ENTRYLO1 $3
  43. #define CP0_CONF $3
  44. #define CP0_CONTEXT $4
  45. #define CP0_PAGEMASK $5
  46. #define CP0_WIRED $6
  47. #define CP0_INFO $7
  48. #define CP0_BADVADDR $8
  49. #define CP0_COUNT $9
  50. #define CP0_ENTRYHI $10
  51. #define CP0_COMPARE $11
  52. #define CP0_STATUS $12
  53. #define CP0_CAUSE $13
  54. #define CP0_EPC $14
  55. #define CP0_PRID $15
  56. #define CP0_CONFIG $16
  57. #define CP0_LLADDR $17
  58. #define CP0_WATCHLO $18
  59. #define CP0_WATCHHI $19
  60. #define CP0_XCONTEXT $20
  61. #define CP0_FRAMEMASK $21
  62. #define CP0_DIAGNOSTIC $22
  63. #define CP0_DEBUG $23
  64. #define CP0_DEPC $24
  65. #define CP0_PERFORMANCE $25
  66. #define CP0_ECC $26
  67. #define CP0_CACHEERR $27
  68. #define CP0_TAGLO $28
  69. #define CP0_TAGHI $29
  70. #define CP0_ERROREPC $30
  71. #define CP0_DESAVE $31
  72. /*
  73. * R4640/R4650 cp0 register names. These registers are listed
  74. * here only for completeness; without MMU these CPUs are not useable
  75. * by Linux. A future ELKS port might take make Linux run on them
  76. * though ...
  77. */
  78. #define CP0_IBASE $0
  79. #define CP0_IBOUND $1
  80. #define CP0_DBASE $2
  81. #define CP0_DBOUND $3
  82. #define CP0_CALG $17
  83. #define CP0_IWATCH $18
  84. #define CP0_DWATCH $19
  85. /*
  86. * Coprocessor 0 Set 1 register names
  87. */
  88. #define CP0_S1_DERRADDR0 $26
  89. #define CP0_S1_DERRADDR1 $27
  90. #define CP0_S1_INTCONTROL $20
  91. /*
  92. * Coprocessor 0 Set 2 register names
  93. */
  94. #define CP0_S2_SRSCTL $12 /* MIPSR2 */
  95. /*
  96. * Coprocessor 0 Set 3 register names
  97. */
  98. #define CP0_S3_SRSMAP $12 /* MIPSR2 */
  99. /*
  100. * TX39 Series
  101. */
  102. #define CP0_TX39_CACHE $7
  103. /*
  104. * Coprocessor 1 (FPU) register names
  105. */
  106. #define CP1_REVISION $0
  107. #define CP1_STATUS $31
  108. /*
  109. * FPU Status Register Values
  110. */
  111. /*
  112. * Status Register Values
  113. */
  114. #define FPU_CSR_FLUSH 0x01000000 /* flush denormalised results to 0 */
  115. #define FPU_CSR_COND 0x00800000 /* $fcc0 */
  116. #define FPU_CSR_COND0 0x00800000 /* $fcc0 */
  117. #define FPU_CSR_COND1 0x02000000 /* $fcc1 */
  118. #define FPU_CSR_COND2 0x04000000 /* $fcc2 */
  119. #define FPU_CSR_COND3 0x08000000 /* $fcc3 */
  120. #define FPU_CSR_COND4 0x10000000 /* $fcc4 */
  121. #define FPU_CSR_COND5 0x20000000 /* $fcc5 */
  122. #define FPU_CSR_COND6 0x40000000 /* $fcc6 */
  123. #define FPU_CSR_COND7 0x80000000 /* $fcc7 */
  124. /*
  125. * Bits 18 - 20 of the FPU Status Register will be read as 0,
  126. * and should be written as zero.
  127. */
  128. #define FPU_CSR_RSVD 0x001c0000
  129. /*
  130. * X the exception cause indicator
  131. * E the exception enable
  132. * S the sticky/flag bit
  133. */
  134. #define FPU_CSR_ALL_X 0x0003f000
  135. #define FPU_CSR_UNI_X 0x00020000
  136. #define FPU_CSR_INV_X 0x00010000
  137. #define FPU_CSR_DIV_X 0x00008000
  138. #define FPU_CSR_OVF_X 0x00004000
  139. #define FPU_CSR_UDF_X 0x00002000
  140. #define FPU_CSR_INE_X 0x00001000
  141. #define FPU_CSR_ALL_E 0x00000f80
  142. #define FPU_CSR_INV_E 0x00000800
  143. #define FPU_CSR_DIV_E 0x00000400
  144. #define FPU_CSR_OVF_E 0x00000200
  145. #define FPU_CSR_UDF_E 0x00000100
  146. #define FPU_CSR_INE_E 0x00000080
  147. #define FPU_CSR_ALL_S 0x0000007c
  148. #define FPU_CSR_INV_S 0x00000040
  149. #define FPU_CSR_DIV_S 0x00000020
  150. #define FPU_CSR_OVF_S 0x00000010
  151. #define FPU_CSR_UDF_S 0x00000008
  152. #define FPU_CSR_INE_S 0x00000004
  153. /* Bits 0 and 1 of FPU Status Register specify the rounding mode */
  154. #define FPU_CSR_RM 0x00000003
  155. #define FPU_CSR_RN 0x0 /* nearest */
  156. #define FPU_CSR_RZ 0x1 /* towards zero */
  157. #define FPU_CSR_RU 0x2 /* towards +Infinity */
  158. #define FPU_CSR_RD 0x3 /* towards -Infinity */
  159. /*
  160. * Values for PageMask register
  161. */
  162. #ifdef CONFIG_CPU_VR41XX
  163. /* Why doesn't stupidity hurt ... */
  164. #define PM_1K 0x00000000
  165. #define PM_4K 0x00001800
  166. #define PM_16K 0x00007800
  167. #define PM_64K 0x0001f800
  168. #define PM_256K 0x0007f800
  169. #else
  170. #define PM_4K 0x00000000
  171. #define PM_8K 0x00002000
  172. #define PM_16K 0x00006000
  173. #define PM_32K 0x0000e000
  174. #define PM_64K 0x0001e000
  175. #define PM_128K 0x0003e000
  176. #define PM_256K 0x0007e000
  177. #define PM_512K 0x000fe000
  178. #define PM_1M 0x001fe000
  179. #define PM_2M 0x003fe000
  180. #define PM_4M 0x007fe000
  181. #define PM_8M 0x00ffe000
  182. #define PM_16M 0x01ffe000
  183. #define PM_32M 0x03ffe000
  184. #define PM_64M 0x07ffe000
  185. #define PM_256M 0x1fffe000
  186. #define PM_1G 0x7fffe000
  187. #endif
  188. /*
  189. * Default page size for a given kernel configuration
  190. */
  191. #ifdef CONFIG_PAGE_SIZE_4KB
  192. #define PM_DEFAULT_MASK PM_4K
  193. #elif defined(CONFIG_PAGE_SIZE_8KB)
  194. #define PM_DEFAULT_MASK PM_8K
  195. #elif defined(CONFIG_PAGE_SIZE_16KB)
  196. #define PM_DEFAULT_MASK PM_16K
  197. #elif defined(CONFIG_PAGE_SIZE_32KB)
  198. #define PM_DEFAULT_MASK PM_32K
  199. #elif defined(CONFIG_PAGE_SIZE_64KB)
  200. #define PM_DEFAULT_MASK PM_64K
  201. #else
  202. #error Bad page size configuration!
  203. #endif
  204. /*
  205. * Default huge tlb size for a given kernel configuration
  206. */
  207. #ifdef CONFIG_PAGE_SIZE_4KB
  208. #define PM_HUGE_MASK PM_1M
  209. #elif defined(CONFIG_PAGE_SIZE_8KB)
  210. #define PM_HUGE_MASK PM_4M
  211. #elif defined(CONFIG_PAGE_SIZE_16KB)
  212. #define PM_HUGE_MASK PM_16M
  213. #elif defined(CONFIG_PAGE_SIZE_32KB)
  214. #define PM_HUGE_MASK PM_64M
  215. #elif defined(CONFIG_PAGE_SIZE_64KB)
  216. #define PM_HUGE_MASK PM_256M
  217. #elif defined(CONFIG_MIPS_HUGE_TLB_SUPPORT)
  218. #error Bad page size configuration for hugetlbfs!
  219. #endif
  220. /*
  221. * Values used for computation of new tlb entries
  222. */
  223. #define PL_4K 12
  224. #define PL_16K 14
  225. #define PL_64K 16
  226. #define PL_256K 18
  227. #define PL_1M 20
  228. #define PL_4M 22
  229. #define PL_16M 24
  230. #define PL_64M 26
  231. #define PL_256M 28
  232. /*
  233. * PageGrain bits
  234. */
  235. #define PG_RIE (_ULCAST_(1) << 31)
  236. #define PG_XIE (_ULCAST_(1) << 30)
  237. #define PG_ELPA (_ULCAST_(1) << 29)
  238. #define PG_ESP (_ULCAST_(1) << 28)
  239. /*
  240. * R4x00 interrupt enable / cause bits
  241. */
  242. #define IE_SW0 (_ULCAST_(1) << 8)
  243. #define IE_SW1 (_ULCAST_(1) << 9)
  244. #define IE_IRQ0 (_ULCAST_(1) << 10)
  245. #define IE_IRQ1 (_ULCAST_(1) << 11)
  246. #define IE_IRQ2 (_ULCAST_(1) << 12)
  247. #define IE_IRQ3 (_ULCAST_(1) << 13)
  248. #define IE_IRQ4 (_ULCAST_(1) << 14)
  249. #define IE_IRQ5 (_ULCAST_(1) << 15)
  250. /*
  251. * R4x00 interrupt cause bits
  252. */
  253. #define C_SW0 (_ULCAST_(1) << 8)
  254. #define C_SW1 (_ULCAST_(1) << 9)
  255. #define C_IRQ0 (_ULCAST_(1) << 10)
  256. #define C_IRQ1 (_ULCAST_(1) << 11)
  257. #define C_IRQ2 (_ULCAST_(1) << 12)
  258. #define C_IRQ3 (_ULCAST_(1) << 13)
  259. #define C_IRQ4 (_ULCAST_(1) << 14)
  260. #define C_IRQ5 (_ULCAST_(1) << 15)
  261. /*
  262. * Bitfields in the R4xx0 cp0 status register
  263. */
  264. #define ST0_IE 0x00000001
  265. #define ST0_EXL 0x00000002
  266. #define ST0_ERL 0x00000004
  267. #define ST0_KSU 0x00000018
  268. # define KSU_USER 0x00000010
  269. # define KSU_SUPERVISOR 0x00000008
  270. # define KSU_KERNEL 0x00000000
  271. #define ST0_UX 0x00000020
  272. #define ST0_SX 0x00000040