mipsregs.h 46 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606
  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. * X the exception cause indicator
  126. * E the exception enable
  127. * S the sticky/flag bit
  128. */
  129. #define FPU_CSR_ALL_X 0x0003f000
  130. #define FPU_CSR_UNI_X 0x00020000
  131. #define FPU_CSR_INV_X 0x00010000
  132. #define FPU_CSR_DIV_X 0x00008000
  133. #define FPU_CSR_OVF_X 0x00004000
  134. #define FPU_CSR_UDF_X 0x00002000
  135. #define FPU_CSR_INE_X 0x00001000
  136. #define FPU_CSR_ALL_E 0x00000f80
  137. #define FPU_CSR_INV_E 0x00000800
  138. #define FPU_CSR_DIV_E 0x00000400
  139. #define FPU_CSR_OVF_E 0x00000200
  140. #define FPU_CSR_UDF_E 0x00000100
  141. #define FPU_CSR_INE_E 0x00000080
  142. #define FPU_CSR_ALL_S 0x0000007c
  143. #define FPU_CSR_INV_S 0x00000040
  144. #define FPU_CSR_DIV_S 0x00000020
  145. #define FPU_CSR_OVF_S 0x00000010
  146. #define FPU_CSR_UDF_S 0x00000008
  147. #define FPU_CSR_INE_S 0x00000004
  148. /* rounding mode */
  149. #define FPU_CSR_RN 0x0 /* nearest */
  150. #define FPU_CSR_RZ 0x1 /* towards zero */
  151. #define FPU_CSR_RU 0x2 /* towards +Infinity */
  152. #define FPU_CSR_RD 0x3 /* towards -Infinity */
  153. /*
  154. * Values for PageMask register
  155. */
  156. #ifdef CONFIG_CPU_VR41XX
  157. /* Why doesn't stupidity hurt ... */
  158. #define PM_1K 0x00000000
  159. #define PM_4K 0x00001800
  160. #define PM_16K 0x00007800
  161. #define PM_64K 0x0001f800
  162. #define PM_256K 0x0007f800
  163. #else
  164. #define PM_4K 0x00000000
  165. #define PM_8K 0x00002000
  166. #define PM_16K 0x00006000
  167. #define PM_32K 0x0000e000
  168. #define PM_64K 0x0001e000
  169. #define PM_128K 0x0003e000
  170. #define PM_256K 0x0007e000
  171. #define PM_512K 0x000fe000
  172. #define PM_1M 0x001fe000
  173. #define PM_2M 0x003fe000
  174. #define PM_4M 0x007fe000
  175. #define PM_8M 0x00ffe000
  176. #define PM_16M 0x01ffe000
  177. #define PM_32M 0x03ffe000
  178. #define PM_64M 0x07ffe000
  179. #define PM_256M 0x1fffe000
  180. #define PM_1G 0x7fffe000
  181. #endif
  182. /*
  183. * Default page size for a given kernel configuration
  184. */
  185. #ifdef CONFIG_PAGE_SIZE_4KB
  186. #define PM_DEFAULT_MASK PM_4K
  187. #elif defined(CONFIG_PAGE_SIZE_8KB)
  188. #define PM_DEFAULT_MASK PM_8K
  189. #elif defined(CONFIG_PAGE_SIZE_16KB)
  190. #define PM_DEFAULT_MASK PM_16K
  191. #elif defined(CONFIG_PAGE_SIZE_32KB)
  192. #define PM_DEFAULT_MASK PM_32K
  193. #elif defined(CONFIG_PAGE_SIZE_64KB)
  194. #define PM_DEFAULT_MASK PM_64K
  195. #else
  196. #error Bad page size configuration!
  197. #endif
  198. /*
  199. * Default huge tlb size for a given kernel configuration
  200. */
  201. #ifdef CONFIG_PAGE_SIZE_4KB
  202. #define PM_HUGE_MASK PM_1M
  203. #elif defined(CONFIG_PAGE_SIZE_8KB)
  204. #define PM_HUGE_MASK PM_4M
  205. #elif defined(CONFIG_PAGE_SIZE_16KB)
  206. #define PM_HUGE_MASK PM_16M
  207. #elif defined(CONFIG_PAGE_SIZE_32KB)
  208. #define PM_HUGE_MASK PM_64M
  209. #elif defined(CONFIG_PAGE_SIZE_64KB)
  210. #define PM_HUGE_MASK PM_256M
  211. #elif defined(CONFIG_HUGETLB_PAGE)
  212. #error Bad page size configuration for hugetlbfs!
  213. #endif
  214. /*
  215. * Values used for computation of new tlb entries
  216. */
  217. #define PL_4K 12
  218. #define PL_16K 14
  219. #define PL_64K 16
  220. #define PL_256K 18
  221. #define PL_1M 20
  222. #define PL_4M 22
  223. #define PL_16M 24
  224. #define PL_64M 26
  225. #define PL_256M 28
  226. /*
  227. * PageGrain bits
  228. */
  229. #define PG_RIE (_ULCAST_(1) << 31)
  230. #define PG_XIE (_ULCAST_(1) << 30)
  231. #define PG_ELPA (_ULCAST_(1) << 29)
  232. #define PG_ESP (_ULCAST_(1) << 28)
  233. /*
  234. * R4x00 interrupt enable / cause bits
  235. */
  236. #define IE_SW0 (_ULCAST_(1) << 8)
  237. #define IE_SW1 (_ULCAST_(1) << 9)
  238. #define IE_IRQ0 (_ULCAST_(1) << 10)
  239. #define IE_IRQ1 (_ULCAST_(1) << 11)
  240. #define IE_IRQ2 (_ULCAST_(1) << 12)
  241. #define IE_IRQ3 (_ULCAST_(1) << 13)
  242. #define IE_IRQ4 (_ULCAST_(1) << 14)
  243. #define IE_IRQ5 (_ULCAST_(1) << 15)
  244. /*
  245. * R4x00 interrupt cause bits
  246. */
  247. #define C_SW0 (_ULCAST_(1) << 8)
  248. #define C_SW1 (_ULCAST_(1) << 9)
  249. #define C_IRQ0 (_ULCAST_(1) << 10)
  250. #define C_IRQ1 (_ULCAST_(1) << 11)
  251. #define C_IRQ2 (_ULCAST_(1) << 12)
  252. #define C_IRQ3 (_ULCAST_(1) << 13)
  253. #define C_IRQ4 (_ULCAST_(1) << 14)
  254. #define C_IRQ5 (_ULCAST_(1) << 15)
  255. /*
  256. * Bitfields in the R4xx0 cp0 status register
  257. */
  258. #define ST0_IE 0x00000001
  259. #define ST0_EXL 0x00000002
  260. #define ST0_ERL 0x00000004
  261. #define ST0_KSU 0x00000018
  262. # define KSU_USER 0x00000010
  263. # define KSU_SUPERVISOR 0x00000008
  264. # define KSU_KERNEL 0x00000000
  265. #define ST0_UX 0x00000020
  266. #define ST0_SX 0x00000040
  267. #define ST0_KX 0x00000080
  268. #define ST0_DE 0x00010000
  269. #define ST0_CE 0x00020000
  270. /*
  271. * Setting c0_status.co enables Hit_Writeback and Hit_Writeback_Invalidate
  272. * cacheops in userspace. This bit exists only on RM7000 and RM9000
  273. * processors.
  274. */
  275. #define ST0_CO 0x08000000
  276. /*
  277. * Bitfields in the R[23]000 cp0 status register.
  278. */
  279. #define ST0_IEC 0x00000001
  280. #define ST0_KUC 0x00000002
  281. #define ST0_IEP 0x00000004
  282. #define ST0_KUP 0x00000008
  283. #define ST0_IEO 0x00000010
  284. #define ST0_KUO 0x00000020
  285. /* bits 6 & 7 are reserved on R[23]000 */
  286. #define ST0_ISC 0x00010000
  287. #define ST0_SWC 0x00020000
  288. #define ST0_CM 0x00080000
  289. /*
  290. * Bits specific to the R4640/R4650
  291. */
  292. #define ST0_UM (_ULCAST_(1) << 4)
  293. #define ST0_IL (_ULCAST_(1) << 23)
  294. #define ST0_DL (_ULCAST_(1) << 24)
  295. /*
  296. * Enable the MIPS MDMX and DSP ASEs
  297. */
  298. #define ST0_MX 0x01000000
  299. /*
  300. * Bitfields in the TX39 family CP0 Configuration Register 3
  301. */
  302. #define TX39_CONF_ICS_SHIFT 19
  303. #define TX39_CONF_ICS_MASK 0x00380000
  304. #define TX39_CONF_ICS_1KB 0x00000000
  305. #define TX39_CONF_ICS_2KB 0x00080000
  306. #define TX39_CONF_ICS_4KB 0x00100000
  307. #define TX39_CONF_ICS_8KB 0x00180000
  308. #define TX39_CONF_ICS_16KB 0x00200000
  309. #define TX39_CONF_DCS_SHIFT 16
  310. #define TX39_CONF_DCS_MASK 0x00070000
  311. #define TX39_CONF_DCS_1KB 0x00000000
  312. #define TX39_CONF_DCS_2KB 0x00010000
  313. #define TX39_CONF_DCS_4KB 0x00020000
  314. #define TX39_CONF_DCS_8KB 0x00030000
  315. #define TX39_CONF_DCS_16KB 0x00040000
  316. #define TX39_CONF_CWFON 0x00004000
  317. #define TX39_CONF_WBON 0x00002000
  318. #define TX39_CONF_RF_SHIFT 10
  319. #define TX39_CONF_RF_MASK 0x00000c00
  320. #define TX39_CONF_DOZE 0x00000200
  321. #define TX39_CONF_HALT 0x00000100
  322. #define TX39_CONF_LOCK 0x00000080
  323. #define TX39_CONF_ICE 0x00000020
  324. #define TX39_CONF_DCE 0x00000010
  325. #define TX39_CONF_IRSIZE_SHIFT 2
  326. #define TX39_CONF_IRSIZE_MASK 0x0000000c
  327. #define TX39_CONF_DRSIZE_SHIFT 0
  328. #define TX39_CONF_DRSIZE_MASK 0x00000003
  329. /*
  330. * Status register bits available in all MIPS CPUs.
  331. */
  332. #define ST0_IM 0x0000ff00
  333. #define STATUSB_IP0 8
  334. #define STATUSF_IP0 (_ULCAST_(1) << 8)
  335. #define STATUSB_IP1 9
  336. #define STATUSF_IP1 (_ULCAST_(1) << 9)
  337. #define STATUSB_IP2 10
  338. #define STATUSF_IP2 (_ULCAST_(1) << 10)
  339. #define STATUSB_IP3 11
  340. #define STATUSF_IP3 (_ULCAST_(1) << 11)
  341. #define STATUSB_IP4 12
  342. #define STATUSF_IP4 (_ULCAST_(1) << 12)
  343. #define STATUSB_IP5 13
  344. #define STATUSF_IP5 (_ULCAST_(1) << 13)
  345. #define STATUSB_IP6 14
  346. #define STATUSF_IP6 (_ULCAST_(1) << 14)
  347. #define STATUSB_IP7 15
  348. #define STATUSF_IP7 (_ULCAST_(1) << 15)
  349. #define STATUSB_IP8 0
  350. #define STATUSF_IP8 (_ULCAST_(1) << 0)
  351. #define STATUSB_IP9 1
  352. #define STATUSF_IP9 (_ULCAST_(1) << 1)
  353. #define STATUSB_IP10 2
  354. #define STATUSF_IP10 (_ULCAST_(1) << 2)
  355. #define STATUSB_IP11 3
  356. #define STATUSF_IP11 (_ULCAST_(1) << 3)
  357. #define STATUSB_IP12 4
  358. #define STATUSF_IP12 (_ULCAST_(1) << 4)
  359. #define STATUSB_IP13 5
  360. #define STATUSF_IP13 (_ULCAST_(1) << 5)
  361. #define STATUSB_IP14 6
  362. #define STATUSF_IP14 (_ULCAST_(1) << 6)
  363. #define STATUSB_IP15 7
  364. #define STATUSF_IP15 (_ULCAST_(1) << 7)
  365. #define ST0_CH 0x00040000
  366. #define ST0_SR 0x00100000
  367. #define ST0_TS 0x00200000
  368. #define ST0_BEV 0x00400000
  369. #define ST0_RE 0x02000000
  370. #define ST0_FR 0x04000000
  371. #define ST0_CU 0xf0000000
  372. #define ST0_CU0 0x10000000
  373. #define ST0_CU1 0x20000000
  374. #define ST0_CU2 0x40000000
  375. #define ST0_CU3 0x80000000
  376. #define ST0_XX 0x80000000 /* MIPS IV naming */
  377. /*
  378. * Bitfields and bit numbers in the coprocessor 0 IntCtl register. (MIPSR2)
  379. *
  380. * Refer to your MIPS R4xx0 manual, chapter 5 for explanation.
  381. */
  382. #define INTCTLB_IPPCI 26
  383. #define INTCTLF_IPPCI (_ULCAST_(7) << INTCTLB_IPPCI)
  384. #define INTCTLB_IPTI 29
  385. #define INTCTLF_IPTI (_ULCAST_(7) << INTCTLB_IPTI)
  386. /*
  387. * Bitfields and bit numbers in the coprocessor 0 cause register.
  388. *
  389. * Refer to your MIPS R4xx0 manual, chapter 5 for explanation.
  390. */
  391. #define CAUSEB_EXCCODE 2
  392. #define CAUSEF_EXCCODE (_ULCAST_(31) << 2)
  393. #define CAUSEB_IP 8
  394. #define CAUSEF_IP (_ULCAST_(255) << 8)
  395. #define CAUSEB_IP0 8
  396. #define CAUSEF_IP0 (_ULCAST_(1) << 8)
  397. #define CAUSEB_IP1 9
  398. #define CAUSEF_IP1 (_ULCAST_(1) << 9)
  399. #define CAUSEB_IP2 10
  400. #define CAUSEF_IP2 (_ULCAST_(1) << 10)
  401. #define CAUSEB_IP3 11
  402. #define CAUSEF_IP3 (_ULCAST_(1) << 11)
  403. #define CAUSEB_IP4 12
  404. #define CAUSEF_IP4 (_ULCAST_(1) << 12)
  405. #define CAUSEB_IP5 13
  406. #define CAUSEF_IP5 (_ULCAST_(1) << 13)
  407. #define CAUSEB_IP6 14
  408. #define CAUSEF_IP6 (_ULCAST_(1) << 14)
  409. #define CAUSEB_IP7 15
  410. #define CAUSEF_IP7 (_ULCAST_(1) << 15)
  411. #define CAUSEB_IV 23
  412. #define CAUSEF_IV (_ULCAST_(1) << 23)
  413. #define CAUSEB_CE 28
  414. #define CAUSEF_CE (_ULCAST_(3) << 28)
  415. #define CAUSEB_TI 30
  416. #define CAUSEF_TI (_ULCAST_(1) << 30)
  417. #define CAUSEB_BD 31
  418. #define CAUSEF_BD (_ULCAST_(1) << 31)
  419. /*
  420. * Bits in the coprocessor 0 config register.
  421. */
  422. /* Generic bits. */
  423. #define CONF_CM_CACHABLE_NO_WA 0
  424. #define CONF_CM_CACHABLE_WA 1
  425. #define CONF_CM_UNCACHED 2
  426. #define CONF_CM_CACHABLE_NONCOHERENT 3
  427. #define CONF_CM_CACHABLE_CE 4
  428. #define CONF_CM_CACHABLE_COW 5
  429. #define CONF_CM_CACHABLE_CUW 6
  430. #define CONF_CM_CACHABLE_ACCELERATED 7
  431. #define CONF_CM_CMASK 7
  432. #define CONF_BE (_ULCAST_(1) << 15)
  433. /* Bits common to various processors. */
  434. #define CONF_CU (_ULCAST_(1) << 3)
  435. #define CONF_DB (_ULCAST_(1) << 4)
  436. #define CONF_IB (_ULCAST_(1) << 5)
  437. #define CONF_DC (_ULCAST_(7) << 6)
  438. #define CONF_IC (_ULCAST_(7) << 9)
  439. #define CONF_EB (_ULCAST_(1) << 13)
  440. #define CONF_EM (_ULCAST_(1) << 14)
  441. #define CONF_SM (_ULCAST_(1) << 16)
  442. #define CONF_SC (_ULCAST_(1) << 17)
  443. #define CONF_EW (_ULCAST_(3) << 18)
  444. #define CONF_EP (_ULCAST_(15)<< 24)
  445. #define CONF_EC (_ULCAST_(7) << 28)
  446. #define CONF_CM (_ULCAST_(1) << 31)
  447. /* Bits specific to the R4xx0. */
  448. #define R4K_CONF_SW (_ULCAST_(1) << 20)
  449. #define R4K_CONF_SS (_ULCAST_(1) << 21)
  450. #define R4K_CONF_SB (_ULCAST_(3) << 22)
  451. /* Bits specific to the R5000. */
  452. #define R5K_CONF_SE (_ULCAST_(1) << 12)
  453. #define R5K_CONF_SS (_ULCAST_(3) << 20)
  454. /* Bits specific to the RM7000. */
  455. #define RM7K_CONF_SE (_ULCAST_(1) << 3)
  456. #define RM7K_CONF_TE (_ULCAST_(1) << 12)
  457. #define RM7K_CONF_CLK (_ULCAST_(1) << 16)
  458. #define RM7K_CONF_TC (_ULCAST_(1) << 17)
  459. #define RM7K_CONF_SI (_ULCAST_(3) << 20)
  460. #define RM7K_CONF_SC (_ULCAST_(1) << 31)
  461. /* Bits specific to the R10000. */
  462. #define R10K_CONF_DN (_ULCAST_(3) << 3)
  463. #define R10K_CONF_CT (_ULCAST_(1) << 5)
  464. #define R10K_CONF_PE (_ULCAST_(1) << 6)
  465. #define R10K_CONF_PM (_ULCAST_(3) << 7)
  466. #define R10K_CONF_EC (_ULCAST_(15)<< 9)
  467. #define R10K_CONF_SB (_ULCAST_(1) << 13)
  468. #define R10K_CONF_SK (_ULCAST_(1) << 14)
  469. #define R10K_CONF_SS (_ULCAST_(7) << 16)
  470. #define R10K_CONF_SC (_ULCAST_(7) << 19)
  471. #define R10K_CONF_DC (_ULCAST_(7) << 26)
  472. #define R10K_CONF_IC (_ULCAST_(7) << 29)
  473. /* Bits specific to the VR41xx. */
  474. #define VR41_CONF_CS (_ULCAST_(1) << 12)
  475. #define VR41_CONF_P4K (_ULCAST_(1) << 13)
  476. #define VR41_CONF_BP (_ULCAST_(1) << 16)
  477. #define VR41_CONF_M16 (_ULCAST_(1) << 20)
  478. #define VR41_CONF_AD (_ULCAST_(1) << 23)
  479. /* Bits specific to the R30xx. */
  480. #define R30XX_CONF_FDM (_ULCAST_(1) << 19)
  481. #define R30XX_CONF_REV (_ULCAST_(1) << 22)
  482. #define R30XX_CONF_AC (_ULCAST_(1) << 23)
  483. #define R30XX_CONF_RF (_ULCAST_(1) << 24)
  484. #define R30XX_CONF_HALT (_ULCAST_(1) << 25)
  485. #define R30XX_CONF_FPINT (_ULCAST_(7) << 26)
  486. #define R30XX_CONF_DBR (_ULCAST_(1) << 29)
  487. #define R30XX_CONF_SB (_ULCAST_(1) << 30)
  488. #define R30XX_CONF_LOCK (_ULCAST_(1) << 31)
  489. /* Bits specific to the TX49. */
  490. #define TX49_CONF_DC (_ULCAST_(1) << 16)
  491. #define TX49_CONF_IC (_ULCAST_(1) << 17) /* conflict with CONF_SC */
  492. #define TX49_CONF_HALT (_ULCAST_(1) << 18)
  493. #define TX49_CONF_CWFON (_ULCAST_(1) << 27)
  494. /* Bits specific to the MIPS32/64 PRA. */
  495. #define MIPS_CONF_MT (_ULCAST_(7) << 7)
  496. #define MIPS_CONF_AR (_ULCAST_(7) << 10)
  497. #define MIPS_CONF_AT (_ULCAST_(3) << 13)
  498. #define MIPS_CONF_M (_ULCAST_(1) << 31)
  499. /*
  500. * Bits in the MIPS32/64 PRA coprocessor 0 config registers 1 and above.
  501. */
  502. #define MIPS_CONF1_FP (_ULCAST_(1) << 0)
  503. #define MIPS_CONF1_EP (_ULCAST_(1) << 1)
  504. #define MIPS_CONF1_CA (_ULCAST_(1) << 2)
  505. #define MIPS_CONF1_WR (_ULCAST_(1) << 3)
  506. #define MIPS_CONF1_PC (_ULCAST_(1) << 4)
  507. #define MIPS_CONF1_MD (_ULCAST_(1) << 5)
  508. #define MIPS_CONF1_C2 (_ULCAST_(1) << 6)
  509. #define MIPS_CONF1_DA (_ULCAST_(7) << 7)
  510. #define MIPS_CONF1_DL (_ULCAST_(7) << 10)
  511. #define MIPS_CONF1_DS (_ULCAST_(7) << 13)
  512. #define MIPS_CONF1_IA (_ULCAST_(7) << 16)
  513. #define MIPS_CONF1_IL (_ULCAST_(7) << 19)
  514. #define MIPS_CONF1_IS (_ULCAST_(7) << 22)
  515. #define MIPS_CONF1_TLBS (_ULCAST_(63)<< 25)
  516. #define MIPS_CONF2_SA (_ULCAST_(15)<< 0)
  517. #define MIPS_CONF2_SL (_ULCAST_(15)<< 4)
  518. #define MIPS_CONF2_SS (_ULCAST_(15)<< 8)
  519. #define MIPS_CONF2_SU (_ULCAST_(15)<< 12)
  520. #define MIPS_CONF2_TA (_ULCAST_(15)<< 16)
  521. #define MIPS_CONF2_TL (_ULCAST_(15)<< 20)
  522. #define MIPS_CONF2_TS (_ULCAST_(15)<< 24)
  523. #define MIPS_CONF2_TU (_ULCAST_(7) << 28)
  524. #define MIPS_CONF3_TL (_ULCAST_(1) << 0)
  525. #define MIPS_CONF3_SM (_ULCAST_(1) << 1)
  526. #define MIPS_CONF3_MT (_ULCAST_(1) << 2)
  527. #define MIPS_CONF3_SP (_ULCAST_(1) << 4)
  528. #define MIPS_CONF3_VINT (_ULCAST_(1) << 5)
  529. #define MIPS_CONF3_VEIC (_ULCAST_(1) << 6)
  530. #define MIPS_CONF3_LPA (_ULCAST_(1) << 7)
  531. #define MIPS_CONF3_DSP (_ULCAST_(1) << 10)
  532. #define MIPS_CONF3_ULRI (_ULCAST_(1) << 13)
  533. #define MIPS_CONF4_MMUSIZEEXT (_ULCAST_(255) << 0)
  534. #define MIPS_CONF4_MMUEXTDEF (_ULCAST_(3) << 14)
  535. #define MIPS_CONF4_MMUEXTDEF_MMUSIZEEXT (_ULCAST_(1) << 14)
  536. #define MIPS_CONF7_WII (_ULCAST_(1) << 31)
  537. #define MIPS_CONF7_RPS (_ULCAST_(1) << 2)
  538. /*
  539. * Bits in the MIPS32/64 coprocessor 1 (FPU) revision register.
  540. */
  541. #define MIPS_FPIR_S (_ULCAST_(1) << 16)
  542. #define MIPS_FPIR_D (_ULCAST_(1) << 17)
  543. #define MIPS_FPIR_PS (_ULCAST_(1) << 18)
  544. #define MIPS_FPIR_3D (_ULCAST_(1) << 19)
  545. #define MIPS_FPIR_W (_ULCAST_(1) << 20)
  546. #define MIPS_FPIR_L (_ULCAST_(1) << 21)
  547. #define MIPS_FPIR_F64 (_ULCAST_(1) << 22)
  548. #ifndef __ASSEMBLY__
  549. /*
  550. * Functions to access the R10000 performance counters. These are basically
  551. * mfc0 and mtc0 instructions from and to coprocessor register with a 5-bit
  552. * performance counter number encoded into bits 1 ... 5 of the instruction.
  553. * Only performance counters 0 to 1 actually exist, so for a non-R10000 aware
  554. * disassembler these will look like an access to sel 0 or 1.
  555. */
  556. #define read_r10k_perf_cntr(counter) \
  557. ({ \
  558. unsigned int __res; \
  559. __asm__ __volatile__( \
  560. "mfpc\t%0, %1" \
  561. : "=r" (__res) \
  562. : "i" (counter)); \
  563. \
  564. __res; \
  565. })
  566. #define write_r10k_perf_cntr(counter,val) \
  567. do { \
  568. __asm__ __volatile__( \
  569. "mtpc\t%0, %1" \
  570. : \
  571. : "r" (val), "i" (counter)); \
  572. } while (0)
  573. #define read_r10k_perf_event(counter) \
  574. ({ \
  575. unsigned int __res; \
  576. __asm__ __volatile__( \
  577. "mfps\t%0, %1" \
  578. : "=r" (__res) \
  579. : "i" (counter)); \
  580. \
  581. __res; \
  582. })
  583. #define write_r10k_perf_cntl(counter,val) \
  584. do { \
  585. __asm__ __volatile__( \
  586. "mtps\t%0, %1" \
  587. : \
  588. : "r" (val), "i" (counter)); \
  589. } while (0)
  590. /*
  591. * Macros to access the system control coprocessor
  592. */
  593. #define __read_32bit_c0_register(source, sel) \
  594. ({ int __res; \
  595. if (sel == 0) \
  596. __asm__ __volatile__( \
  597. "mfc0\t%0, " #source "\n\t" \
  598. : "=r" (__res)); \
  599. else \
  600. __asm__ __volatile__( \
  601. ".set\tmips32\n\t" \
  602. "mfc0\t%0, " #source ", " #sel "\n\t" \
  603. ".set\tmips0\n\t" \
  604. : "=r" (__res)); \
  605. __res; \
  606. })
  607. #define __read_64bit_c0_register(source, sel) \
  608. ({ unsigned long long __res; \
  609. if (sizeof(unsigned long) == 4) \
  610. __res = __read_64bit_c0_split(source, sel); \
  611. else if (sel == 0) \
  612. __asm__ __volatile__( \
  613. ".set\tmips3\n\t" \
  614. "dmfc0\t%0, " #source "\n\t" \
  615. ".set\tmips0" \
  616. : "=r" (__res)); \
  617. else \
  618. __asm__ __volatile__( \
  619. ".set\tmips64\n\t" \
  620. "dmfc0\t%0, " #source ", " #sel "\n\t" \
  621. ".set\tmips0" \
  622. : "=r" (__res)); \
  623. __res; \
  624. })
  625. #define __write_32bit_c0_register(register, sel, value) \
  626. do { \
  627. if (sel == 0) \
  628. __asm__ __volatile__( \
  629. "mtc0\t%z0, " #register "\n\t" \
  630. : : "Jr" ((unsigned int)(value))); \
  631. else \
  632. __asm__ __volatile__( \
  633. ".set\tmips32\n\t" \
  634. "mtc0\t%z0, " #register ", " #sel "\n\t" \
  635. ".set\tmips0" \
  636. : : "Jr" ((unsigned int)(value))); \
  637. } while (0)
  638. #define __write_64bit_c0_register(register, sel, value) \
  639. do { \
  640. if (sizeof(unsigned long) == 4) \
  641. __write_64bit_c0_split(register, sel, value); \
  642. else if (sel == 0) \
  643. __asm__ __volatile__( \
  644. ".set\tmips3\n\t" \
  645. "dmtc0\t%z0, " #register "\n\t" \
  646. ".set\tmips0" \
  647. : : "Jr" (value)); \
  648. else \
  649. __asm__ __volatile__( \
  650. ".set\tmips64\n\t" \
  651. "dmtc0\t%z0, " #register ", " #sel "\n\t" \
  652. ".set\tmips0" \
  653. : : "Jr" (value)); \
  654. } while (0)
  655. #define __read_ulong_c0_register(reg, sel) \
  656. ((sizeof(unsigned long) == 4) ? \
  657. (unsigned long) __read_32bit_c0_register(reg, sel) : \
  658. (unsigned long) __read_64bit_c0_register(reg, sel))
  659. #define __write_ulong_c0_register(reg, sel, val) \
  660. do { \
  661. if (sizeof(unsigned long) == 4) \
  662. __write_32bit_c0_register(reg, sel, val); \
  663. else \
  664. __write_64bit_c0_register(reg, sel, val); \
  665. } while (0)
  666. /*
  667. * On RM7000/RM9000 these are uses to access cop0 set 1 registers
  668. */
  669. #define __read_32bit_c0_ctrl_register(source) \
  670. ({ int __res; \
  671. __asm__ __volatile__( \
  672. "cfc0\t%0, " #source "\n\t" \
  673. : "=r" (__res)); \
  674. __res; \
  675. })
  676. #define __write_32bit_c0_ctrl_register(register, value) \
  677. do { \
  678. __asm__ __volatile__( \
  679. "ctc0\t%z0, " #register "\n\t" \
  680. : : "Jr" ((unsigned int)(value))); \
  681. } while (0)
  682. /*
  683. * These versions are only needed for systems with more than 38 bits of
  684. * physical address space running the 32-bit kernel. That's none atm :-)
  685. */
  686. #define __read_64bit_c0_split(source, sel) \
  687. ({ \
  688. unsigned long long __val; \
  689. unsigned long __flags; \
  690. \
  691. local_irq_save(__flags); \
  692. if (sel == 0) \
  693. __asm__ __volatile__( \
  694. ".set\tmips64\n\t" \
  695. "dmfc0\t%M0, " #source "\n\t" \
  696. "dsll\t%L0, %M0, 32\n\t" \
  697. "dsra\t%M0, %M0, 32\n\t" \
  698. "dsra\t%L0, %L0, 32\n\t" \
  699. ".set\tmips0" \
  700. : "=r" (__val)); \
  701. else \
  702. __asm__ __volatile__( \
  703. ".set\tmips64\n\t" \
  704. "dmfc0\t%M0, " #source ", " #sel "\n\t" \
  705. "dsll\t%L0, %M0, 32\n\t" \
  706. "dsra\t%M0, %M0, 32\n\t" \
  707. "dsra\t%L0, %L0, 32\n\t" \
  708. ".set\tmips0" \
  709. : "=r" (__val)); \
  710. local_irq_restore(__flags); \
  711. \
  712. __val; \
  713. })
  714. #define __write_64bit_c0_split(source, sel, val) \
  715. do { \
  716. unsigned long __flags; \
  717. \
  718. local_irq_save(__flags); \
  719. if (sel == 0) \
  720. __asm__ __volatile__( \
  721. ".set\tmips64\n\t" \
  722. "dsll\t%L0, %L0, 32\n\t" \
  723. "dsrl\t%L0, %L0, 32\n\t" \
  724. "dsll\t%M0, %M0, 32\n\t" \
  725. "or\t%L0, %L0, %M0\n\t" \
  726. "dmtc0\t%L0, " #source "\n\t" \
  727. ".set\tmips0" \
  728. : : "r" (val)); \
  729. else \
  730. __asm__ __volatile__( \
  731. ".set\tmips64\n\t" \
  732. "dsll\t%L0, %L0, 32\n\t" \
  733. "dsrl\t%L0, %L0, 32\n\t" \
  734. "dsll\t%M0, %M0, 32\n\t" \
  735. "or\t%L0, %L0, %M0\n\t" \
  736. "dmtc0\t%L0, " #source ", " #sel "\n\t" \
  737. ".set\tmips0" \
  738. : : "r" (val)); \
  739. local_irq_restore(__flags); \
  740. } while (0)
  741. #define read_c0_index() __read_32bit_c0_register($0, 0)
  742. #define write_c0_index(val) __write_32bit_c0_register($0, 0, val)
  743. #define read_c0_random() __read_32bit_c0_register($1, 0)
  744. #define write_c0_random(val) __write_32bit_c0_register($1, 0, val)
  745. #define read_c0_entrylo0() __read_ulong_c0_register($2, 0)
  746. #define write_c0_entrylo0(val) __write_ulong_c0_register($2, 0, val)
  747. #define read_c0_entrylo1() __read_ulong_c0_register($3, 0)
  748. #define write_c0_entrylo1(val) __write_ulong_c0_register($3, 0, val)
  749. #define read_c0_conf() __read_32bit_c0_register($3, 0)
  750. #define write_c0_conf(val) __write_32bit_c0_register($3, 0, val)
  751. #define read_c0_context() __read_ulong_c0_register($4, 0)
  752. #define write_c0_context(val) __write_ulong_c0_register($4, 0, val)
  753. #define read_c0_userlocal() __read_ulong_c0_register($4, 2)
  754. #define write_c0_userlocal(val) __write_ulong_c0_register($4, 2, val)
  755. #define read_c0_pagemask() __read_32bit_c0_register($5, 0)
  756. #define write_c0_pagemask(val) __write_32bit_c0_register($5, 0, val)
  757. #define read_c0_pagegrain() __read_32bit_c0_register($5, 1)
  758. #define write_c0_pagegrain(val) __write_32bit_c0_register($5, 1, val)
  759. #define read_c0_wired() __read_32bit_c0_register($6, 0)
  760. #define write_c0_wired(val) __write_32bit_c0_register($6, 0, val)
  761. #define read_c0_info() __read_32bit_c0_register($7, 0)
  762. #define read_c0_cache() __read_32bit_c0_register($7, 0) /* TX39xx */
  763. #define write_c0_cache(val) __write_32bit_c0_register($7, 0, val)
  764. #define read_c0_badvaddr() __read_ulong_c0_register($8, 0)
  765. #define write_c0_badvaddr(val) __write_ulong_c0_register($8, 0, val)
  766. #define read_c0_count() __read_32bit_c0_register($9, 0)
  767. #define write_c0_count(val) __write_32bit_c0_register($9, 0, val)
  768. #define read_c0_count2() __read_32bit_c0_register($9, 6) /* pnx8550 */
  769. #define write_c0_count2(val) __write_32bit_c0_register($9, 6, val)
  770. #define read_c0_count3() __read_32bit_c0_register($9, 7) /* pnx8550 */
  771. #define write_c0_count3(val) __write_32bit_c0_register($9, 7, val)
  772. #define read_c0_entryhi() __read_ulong_c0_register($10, 0)
  773. #define write_c0_entryhi(val) __write_ulong_c0_register($10, 0, val)
  774. #define read_c0_compare() __read_32bit_c0_register($11, 0)
  775. #define write_c0_compare(val) __write_32bit_c0_register($11, 0, val)
  776. #define read_c0_compare2() __read_32bit_c0_register($11, 6) /* pnx8550 */
  777. #define write_c0_compare2(val) __write_32bit_c0_register($11, 6, val)
  778. #define read_c0_compare3() __read_32bit_c0_register($11, 7) /* pnx8550 */
  779. #define write_c0_compare3(val) __write_32bit_c0_register($11, 7, val)
  780. #define read_c0_status() __read_32bit_c0_register($12, 0)
  781. #ifdef CONFIG_MIPS_MT_SMTC
  782. #define write_c0_status(val) \
  783. do { \
  784. __write_32bit_c0_register($12, 0, val); \
  785. __ehb(); \
  786. } while (0)
  787. #else
  788. /*
  789. * Legacy non-SMTC code, which may be hazardous
  790. * but which might not support EHB
  791. */
  792. #define write_c0_status(val) __write_32bit_c0_register($12, 0, val)
  793. #endif /* CONFIG_MIPS_MT_SMTC */
  794. #define read_c0_cause() __read_32bit_c0_register($13, 0)
  795. #define write_c0_cause(val) __write_32bit_c0_register($13, 0, val)
  796. #define read_c0_epc() __read_ulong_c0_register($14, 0)
  797. #define write_c0_epc(val) __write_ulong_c0_register($14, 0, val)
  798. #define read_c0_prid() __read_32bit_c0_register($15, 0)
  799. #define read_c0_config() __read_32bit_c0_register($16, 0)
  800. #define read_c0_config1() __read_32bit_c0_register($16, 1)
  801. #define read_c0_config2() __read_32bit_c0_register($16, 2)
  802. #define read_c0_config3() __read_32bit_c0_register($16, 3)
  803. #define read_c0_config4() __read_32bit_c0_register($16, 4)
  804. #define read_c0_config5() __read_32bit_c0_register($16, 5)
  805. #define read_c0_config6() __read_32bit_c0_register($16, 6)
  806. #define read_c0_config7() __read_32bit_c0_register($16, 7)
  807. #define write_c0_config(val) __write_32bit_c0_register($16, 0, val)
  808. #define write_c0_config1(val) __write_32bit_c0_register($16, 1, val)
  809. #define write_c0_config2(val) __write_32bit_c0_register($16, 2, val)
  810. #define write_c0_config3(val) __write_32bit_c0_register($16, 3, val)
  811. #define write_c0_config4(val) __write_32bit_c0_register($16, 4, val)
  812. #define write_c0_config5(val) __write_32bit_c0_register($16, 5, val)
  813. #define write_c0_config6(val) __write_32bit_c0_register($16, 6, val)
  814. #define write_c0_config7(val) __write_32bit_c0_register($16, 7, val)
  815. /*
  816. * The WatchLo register. There may be upto 8 of them.
  817. */
  818. #define read_c0_watchlo0() __read_ulong_c0_register($18, 0)
  819. #define read_c0_watchlo1() __read_ulong_c0_register($18, 1)
  820. #define read_c0_watchlo2() __read_ulong_c0_register($18, 2)
  821. #define read_c0_watchlo3() __read_ulong_c0_register($18, 3)
  822. #define read_c0_watchlo4() __read_ulong_c0_register($18, 4)
  823. #define read_c0_watchlo5() __read_ulong_c0_register($18, 5)
  824. #define read_c0_watchlo6() __read_ulong_c0_register($18, 6)
  825. #define read_c0_watchlo7() __read_ulong_c0_register($18, 7)
  826. #define write_c0_watchlo0(val) __write_ulong_c0_register($18, 0, val)
  827. #define write_c0_watchlo1(val) __write_ulong_c0_register($18, 1, val)
  828. #define write_c0_watchlo2(val) __write_ulong_c0_register($18, 2, val)
  829. #define write_c0_watchlo3(val) __write_ulong_c0_register($18, 3, val)
  830. #define write_c0_watchlo4(val) __write_ulong_c0_register($18, 4, val)
  831. #define write_c0_watchlo5(val) __write_ulong_c0_register($18, 5, val)
  832. #define write_c0_watchlo6(val) __write_ulong_c0_register($18, 6, val)
  833. #define write_c0_watchlo7(val) __write_ulong_c0_register($18, 7, val)
  834. /*
  835. * The WatchHi register. There may be upto 8 of them.
  836. */
  837. #define read_c0_watchhi0() __read_32bit_c0_register($19, 0)
  838. #define read_c0_watchhi1() __read_32bit_c0_register($19, 1)
  839. #define read_c0_watchhi2() __read_32bit_c0_register($19, 2)
  840. #define read_c0_watchhi3() __read_32bit_c0_register($19, 3)
  841. #define read_c0_watchhi4() __read_32bit_c0_register($19, 4)
  842. #define read_c0_watchhi5() __read_32bit_c0_register($19, 5)
  843. #define read_c0_watchhi6() __read_32bit_c0_register($19, 6)
  844. #define read_c0_watchhi7() __read_32bit_c0_register($19, 7)
  845. #define write_c0_watchhi0(val) __write_32bit_c0_register($19, 0, val)
  846. #define write_c0_watchhi1(val) __write_32bit_c0_register($19, 1, val)
  847. #define write_c0_watchhi2(val) __write_32bit_c0_register($19, 2, val)
  848. #define write_c0_watchhi3(val) __write_32bit_c0_register($19, 3, val)
  849. #define write_c0_watchhi4(val) __write_32bit_c0_register($19, 4, val)
  850. #define write_c0_watchhi5(val) __write_32bit_c0_register($19, 5, val)
  851. #define write_c0_watchhi6(val) __write_32bit_c0_register($19, 6, val)
  852. #define write_c0_watchhi7(val) __write_32bit_c0_register($19, 7, val)
  853. #define read_c0_xcontext() __read_ulong_c0_register($20, 0)
  854. #define write_c0_xcontext(val) __write_ulong_c0_register($20, 0, val)
  855. #define read_c0_intcontrol() __read_32bit_c0_ctrl_register($20)
  856. #define write_c0_intcontrol(val) __write_32bit_c0_ctrl_register($20, val)
  857. #define read_c0_framemask() __read_32bit_c0_register($21, 0)
  858. #define write_c0_framemask(val) __write_32bit_c0_register($21, 0, val)
  859. /* RM9000 PerfControl performance counter control register */
  860. #define read_c0_perfcontrol() __read_32bit_c0_register($22, 0)
  861. #define write_c0_perfcontrol(val) __write_32bit_c0_register($22, 0, val)
  862. #define read_c0_diag() __read_32bit_c0_register($22, 0)
  863. #define write_c0_diag(val) __write_32bit_c0_register($22, 0, val)
  864. #define read_c0_diag1() __read_32bit_c0_register($22, 1)
  865. #define write_c0_diag1(val) __write_32bit_c0_register($22, 1, val)
  866. #define read_c0_diag2() __read_32bit_c0_register($22, 2)
  867. #define write_c0_diag2(val) __write_32bit_c0_register($22, 2, val)
  868. #define read_c0_diag3() __read_32bit_c0_register($22, 3)
  869. #define write_c0_diag3(val) __write_32bit_c0_register($22, 3, val)
  870. #define read_c0_diag4() __read_32bit_c0_register($22, 4)
  871. #define write_c0_diag4(val) __write_32bit_c0_register($22, 4, val)
  872. #define read_c0_diag5() __read_32bit_c0_register($22, 5)
  873. #define write_c0_diag5(val) __write_32bit_c0_register($22, 5, val)
  874. #define read_c0_debug() __read_32bit_c0_register($23, 0)
  875. #define write_c0_debug(val) __write_32bit_c0_register($23, 0, val)
  876. #define read_c0_depc() __read_ulong_c0_register($24, 0)
  877. #define write_c0_depc(val) __write_ulong_c0_register($24, 0, val)
  878. /*
  879. * MIPS32 / MIPS64 performance counters
  880. */
  881. #define read_c0_perfctrl0() __read_32bit_c0_register($25, 0)
  882. #define write_c0_perfctrl0(val) __write_32bit_c0_register($25, 0, val)
  883. #define read_c0_perfcntr0() __read_32bit_c0_register($25, 1)
  884. #define write_c0_perfcntr0(val) __write_32bit_c0_register($25, 1, val)
  885. #define read_c0_perfctrl1() __read_32bit_c0_register($25, 2)
  886. #define write_c0_perfctrl1(val) __write_32bit_c0_register($25, 2, val)
  887. #define read_c0_perfcntr1() __read_32bit_c0_register($25, 3)
  888. #define write_c0_perfcntr1(val) __write_32bit_c0_register($25, 3, val)
  889. #define read_c0_perfctrl2() __read_32bit_c0_register($25, 4)
  890. #define write_c0_perfctrl2(val) __write_32bit_c0_register($25, 4, val)
  891. #define read_c0_perfcntr2() __read_32bit_c0_register($25, 5)
  892. #define write_c0_perfcntr2(val) __write_32bit_c0_register($25, 5, val)
  893. #define read_c0_perfctrl3() __read_32bit_c0_register($25, 6)
  894. #define write_c0_perfctrl3(val) __write_32bit_c0_register($25, 6, val)
  895. #define read_c0_perfcntr3() __read_32bit_c0_register($25, 7)
  896. #define write_c0_perfcntr3(val) __write_32bit_c0_register($25, 7, val)
  897. /* RM9000 PerfCount performance counter register */
  898. #define read_c0_perfcount() __read_64bit_c0_register($25, 0)
  899. #define write_c0_perfcount(val) __write_64bit_c0_register($25, 0, val)
  900. #define read_c0_ecc() __read_32bit_c0_register($26, 0)
  901. #define write_c0_ecc(val) __write_32bit_c0_register($26, 0, val)
  902. #define read_c0_derraddr0() __read_ulong_c0_register($26, 1)
  903. #define write_c0_derraddr0(val) __write_ulong_c0_register($26, 1, val)
  904. #define read_c0_cacheerr() __read_32bit_c0_register($27, 0)
  905. #define read_c0_derraddr1() __read_ulong_c0_register($27, 1)
  906. #define write_c0_derraddr1(val) __write_ulong_c0_register($27, 1, val)
  907. #define read_c0_taglo() __read_32bit_c0_register($28, 0)
  908. #define write_c0_taglo(val) __write_32bit_c0_register($28, 0, val)
  909. #define read_c0_dtaglo() __read_32bit_c0_register($28, 2)
  910. #define write_c0_dtaglo(val) __write_32bit_c0_register($28, 2, val)
  911. #define read_c0_taghi() __read_32bit_c0_register($29, 0)
  912. #define write_c0_taghi(val) __write_32bit_c0_register($29, 0, val)
  913. #define read_c0_errorepc() __read_ulong_c0_register($30, 0)
  914. #define write_c0_errorepc(val) __write_ulong_c0_register($30, 0, val)
  915. /* MIPSR2 */
  916. #define read_c0_hwrena() __read_32bit_c0_register($7, 0)
  917. #define write_c0_hwrena(val) __write_32bit_c0_register($7, 0, val)
  918. #define read_c0_intctl() __read_32bit_c0_register($12, 1)
  919. #define write_c0_intctl(val) __write_32bit_c0_register($12, 1, val)
  920. #define read_c0_srsctl() __read_32bit_c0_register($12, 2)
  921. #define write_c0_srsctl(val) __write_32bit_c0_register($12, 2, val)
  922. #define read_c0_srsmap() __read_32bit_c0_register($12, 3)
  923. #define write_c0_srsmap(val) __write_32bit_c0_register($12, 3, val)
  924. #define read_c0_ebase() __read_32bit_c0_register($15, 1)
  925. #define write_c0_ebase(val) __write_32bit_c0_register($15, 1, val)
  926. /* Cavium OCTEON (cnMIPS) */
  927. #define read_c0_cvmcount() __read_ulong_c0_register($9, 6)
  928. #define write_c0_cvmcount(val) __write_ulong_c0_register($9, 6, val)
  929. #define read_c0_cvmctl() __read_64bit_c0_register($9, 7)
  930. #define write_c0_cvmctl(val) __write_64bit_c0_register($9, 7, val)
  931. #define read_c0_cvmmemctl() __read_64bit_c0_register($11, 7)
  932. #define write_c0_cvmmemctl(val) __write_64bit_c0_register($11, 7, val)
  933. /*
  934. * The cacheerr registers are not standardized. On OCTEON, they are
  935. * 64 bits wide.
  936. */
  937. #define read_octeon_c0_icacheerr() __read_64bit_c0_register($27, 0)
  938. #define write_octeon_c0_icacheerr(val) __write_64bit_c0_register($27, 0, val)
  939. #define read_octeon_c0_dcacheerr() __read_64bit_c0_register($27, 1)
  940. #define write_octeon_c0_dcacheerr(val) __write_64bit_c0_register($27, 1, val)
  941. /*
  942. * Macros to access the floating point coprocessor control registers
  943. */
  944. #define read_32bit_cp1_register(source) \
  945. ({ int __res; \
  946. __asm__ __volatile__( \
  947. ".set\tpush\n\t" \
  948. ".set\treorder\n\t" \
  949. /* gas fails to assemble cfc1 for some archs (octeon).*/ \
  950. ".set\tmips1\n\t" \
  951. "cfc1\t%0,"STR(source)"\n\t" \
  952. ".set\tpop" \
  953. : "=r" (__res)); \
  954. __res;})
  955. #define rddsp(mask) \
  956. ({ \
  957. unsigned int __res; \
  958. \
  959. __asm__ __volatile__( \
  960. " .set push \n" \
  961. " .set noat \n" \
  962. " # rddsp $1, %x1 \n" \
  963. " .word 0x7c000cb8 | (%x1 << 16) \n" \
  964. " move %0, $1 \n" \
  965. " .set pop \n" \
  966. : "=r" (__res) \
  967. : "i" (mask)); \
  968. __res; \
  969. })
  970. #define wrdsp(val, mask) \
  971. do { \
  972. __asm__ __volatile__( \
  973. " .set push \n" \
  974. " .set noat \n" \
  975. " move $1, %0 \n" \
  976. " # wrdsp $1, %x1 \n" \
  977. " .word 0x7c2004f8 | (%x1 << 11) \n" \
  978. " .set pop \n" \
  979. : \
  980. : "r" (val), "i" (mask)); \
  981. } while (0)
  982. #if 0 /* Need DSP ASE capable assembler ... */
  983. #define mflo0() ({ long mflo0; __asm__("mflo %0, $ac0" : "=r" (mflo0)); mflo0;})
  984. #define mflo1() ({ long mflo1; __asm__("mflo %0, $ac1" : "=r" (mflo1)); mflo1;})
  985. #define mflo2() ({ long mflo2; __asm__("mflo %0, $ac2" : "=r" (mflo2)); mflo2;})
  986. #define mflo3() ({ long mflo3; __asm__("mflo %0, $ac3" : "=r" (mflo3)); mflo3;})
  987. #define mfhi0() ({ long mfhi0; __asm__("mfhi %0, $ac0" : "=r" (mfhi0)); mfhi0;})
  988. #define mfhi1() ({ long mfhi1; __asm__("mfhi %0, $ac1" : "=r" (mfhi1)); mfhi1;})
  989. #define mfhi2() ({ long mfhi2; __asm__("mfhi %0, $ac2" : "=r" (mfhi2)); mfhi2;})
  990. #define mfhi3() ({ long mfhi3; __asm__("mfhi %0, $ac3" : "=r" (mfhi3)); mfhi3;})
  991. #define mtlo0(x) __asm__("mtlo %0, $ac0" ::"r" (x))
  992. #define mtlo1(x) __asm__("mtlo %0, $ac1" ::"r" (x))
  993. #define mtlo2(x) __asm__("mtlo %0, $ac2" ::"r" (x))
  994. #define mtlo3(x) __asm__("mtlo %0, $ac3" ::"r" (x))
  995. #define mthi0(x) __asm__("mthi %0, $ac0" ::"r" (x))
  996. #define mthi1(x) __asm__("mthi %0, $ac1" ::"r" (x))
  997. #define mthi2(x) __asm__("mthi %0, $ac2" ::"r" (x))
  998. #define mthi3(x) __asm__("mthi %0, $ac3" ::"r" (x))
  999. #else
  1000. #define mfhi0() \
  1001. ({ \
  1002. unsigned long __treg; \
  1003. \
  1004. __asm__ __volatile__( \
  1005. " .set push \n" \
  1006. " .set noat \n" \
  1007. " # mfhi %0, $ac0 \n" \
  1008. " .word 0x00000810 \n" \
  1009. " move %0, $1 \n" \
  1010. " .set pop \n" \
  1011. : "=r" (__treg)); \
  1012. __treg; \
  1013. })
  1014. #define mfhi1() \
  1015. ({ \
  1016. unsigned long __treg; \
  1017. \
  1018. __asm__ __volatile__( \
  1019. " .set push \n" \
  1020. " .set noat \n" \
  1021. " # mfhi %0, $ac1 \n" \
  1022. " .word 0x00200810 \n" \
  1023. " move %0, $1 \n" \
  1024. " .set pop \n" \
  1025. : "=r" (__treg)); \
  1026. __treg; \
  1027. })
  1028. #define mfhi2() \
  1029. ({ \
  1030. unsigned long __treg; \
  1031. \
  1032. __asm__ __volatile__( \
  1033. " .set push \n" \
  1034. " .set noat \n" \
  1035. " # mfhi %0, $ac2 \n" \
  1036. " .word 0x00400810 \n" \
  1037. " move %0, $1 \n" \
  1038. " .set pop \n" \
  1039. : "=r" (__treg)); \
  1040. __treg; \
  1041. })
  1042. #define mfhi3() \
  1043. ({ \
  1044. unsigned long __treg; \
  1045. \
  1046. __asm__ __volatile__( \
  1047. " .set push \n" \
  1048. " .set noat \n" \
  1049. " # mfhi %0, $ac3 \n" \
  1050. " .word 0x00600810 \n" \
  1051. " move %0, $1 \n" \
  1052. " .set pop \n" \
  1053. : "=r" (__treg)); \
  1054. __treg; \
  1055. })
  1056. #define mflo0() \
  1057. ({ \
  1058. unsigned long __treg; \
  1059. \
  1060. __asm__ __volatile__( \
  1061. " .set push \n" \
  1062. " .set noat \n" \
  1063. " # mflo %0, $ac0 \n" \
  1064. " .word 0x00000812 \n" \
  1065. " move %0, $1 \n" \
  1066. " .set pop \n" \
  1067. : "=r" (__treg)); \
  1068. __treg; \
  1069. })
  1070. #define mflo1() \
  1071. ({ \
  1072. unsigned long __treg; \
  1073. \
  1074. __asm__ __volatile__( \
  1075. " .set push \n" \
  1076. " .set noat \n" \
  1077. " # mflo %0, $ac1 \n" \
  1078. " .word 0x00200812 \n" \
  1079. " move %0, $1 \n" \
  1080. " .set pop \n" \
  1081. : "=r" (__treg)); \
  1082. __treg; \
  1083. })
  1084. #define mflo2() \
  1085. ({ \
  1086. unsigned long __treg; \
  1087. \
  1088. __asm__ __volatile__( \
  1089. " .set push \n" \
  1090. " .set noat \n" \
  1091. " # mflo %0, $ac2 \n" \
  1092. " .word 0x00400812 \n" \
  1093. " move %0, $1 \n" \
  1094. " .set pop \n" \
  1095. : "=r" (__treg)); \
  1096. __treg; \
  1097. })
  1098. #define mflo3() \
  1099. ({ \
  1100. unsigned long __treg; \
  1101. \
  1102. __asm__ __volatile__( \
  1103. " .set push \n" \
  1104. " .set noat \n" \
  1105. " # mflo %0, $ac3 \n" \
  1106. " .word 0x00600812 \n" \
  1107. " move %0, $1 \n" \
  1108. " .set pop \n" \
  1109. : "=r" (__treg)); \
  1110. __treg; \
  1111. })
  1112. #define mthi0(x) \
  1113. do { \
  1114. __asm__ __volatile__( \
  1115. " .set push \n" \
  1116. " .set noat \n" \
  1117. " move $1, %0 \n" \
  1118. " # mthi $1, $ac0 \n" \
  1119. " .word 0x00200011 \n" \
  1120. " .set pop \n" \
  1121. : \
  1122. : "r" (x)); \
  1123. } while (0)
  1124. #define mthi1(x) \
  1125. do { \
  1126. __asm__ __volatile__( \
  1127. " .set push \n" \
  1128. " .set noat \n" \
  1129. " move $1, %0 \n" \
  1130. " # mthi $1, $ac1 \n" \
  1131. " .word 0x00200811 \n" \
  1132. " .set pop \n" \
  1133. : \
  1134. : "r" (x)); \
  1135. } while (0)
  1136. #define mthi2(x) \
  1137. do { \
  1138. __asm__ __volatile__( \
  1139. " .set push \n" \
  1140. " .set noat \n" \
  1141. " move $1, %0 \n" \
  1142. " # mthi $1, $ac2 \n" \
  1143. " .word 0x00201011 \n" \
  1144. " .set pop \n" \
  1145. : \
  1146. : "r" (x)); \
  1147. } while (0)
  1148. #define mthi3(x) \
  1149. do { \
  1150. __asm__ __volatile__( \
  1151. " .set push \n" \
  1152. " .set noat \n" \
  1153. " move $1, %0 \n" \
  1154. " # mthi $1, $ac3 \n" \
  1155. " .word 0x00201811 \n" \
  1156. " .set pop \n" \
  1157. : \
  1158. : "r" (x)); \
  1159. } while (0)
  1160. #define mtlo0(x) \
  1161. do { \
  1162. __asm__ __volatile__( \
  1163. " .set push \n" \
  1164. " .set noat \n" \
  1165. " move $1, %0 \n" \
  1166. " # mtlo $1, $ac0 \n" \
  1167. " .word 0x00200013 \n" \
  1168. " .set pop \n" \
  1169. : \
  1170. : "r" (x)); \
  1171. } while (0)
  1172. #define mtlo1(x) \
  1173. do { \
  1174. __asm__ __volatile__( \
  1175. " .set push \n" \
  1176. " .set noat \n" \
  1177. " move $1, %0 \n" \
  1178. " # mtlo $1, $ac1 \n" \
  1179. " .word 0x00200813 \n" \
  1180. " .set pop \n" \
  1181. : \
  1182. : "r" (x)); \
  1183. } while (0)
  1184. #define mtlo2(x) \
  1185. do { \
  1186. __asm__ __volatile__( \
  1187. " .set push \n" \
  1188. " .set noat \n" \
  1189. " move $1, %0 \n" \
  1190. " # mtlo $1, $ac2 \n" \
  1191. " .word 0x00201013 \n" \
  1192. " .set pop \n" \
  1193. : \
  1194. : "r" (x)); \
  1195. } while (0)
  1196. #define mtlo3(x) \
  1197. do { \
  1198. __asm__ __volatile__( \
  1199. " .set push \n" \
  1200. " .set noat \n" \
  1201. " move $1, %0 \n" \
  1202. " # mtlo $1, $ac3 \n" \
  1203. " .word 0x00201813 \n" \
  1204. " .set pop \n" \
  1205. : \
  1206. : "r" (x)); \
  1207. } while (0)
  1208. #endif
  1209. /*
  1210. * TLB operations.
  1211. *
  1212. * It is responsibility of the caller to take care of any TLB hazards.
  1213. */
  1214. static inline void tlb_probe(void)
  1215. {
  1216. __asm__ __volatile__(
  1217. ".set noreorder\n\t"
  1218. "tlbp\n\t"
  1219. ".set reorder");
  1220. }
  1221. static inline void tlb_read(void)
  1222. {
  1223. #if MIPS34K_MISSED_ITLB_WAR
  1224. int res = 0;
  1225. __asm__ __volatile__(
  1226. " .set push \n"
  1227. " .set noreorder \n"
  1228. " .set noat \n"
  1229. " .set mips32r2 \n"
  1230. " .word 0x41610001 # dvpe $1 \n"
  1231. " move %0, $1 \n"
  1232. " ehb \n"
  1233. " .set pop \n"
  1234. : "=r" (res));
  1235. instruction_hazard();
  1236. #endif
  1237. __asm__ __volatile__(
  1238. ".set noreorder\n\t"
  1239. "tlbr\n\t"
  1240. ".set reorder");
  1241. #if MIPS34K_MISSED_ITLB_WAR
  1242. if ((res & _ULCAST_(1)))
  1243. __asm__ __volatile__(
  1244. " .set push \n"
  1245. " .set noreorder \n"
  1246. " .set noat \n"
  1247. " .set mips32r2 \n"
  1248. " .word 0x41600021 # evpe \n"
  1249. " ehb \n"
  1250. " .set pop \n");
  1251. #endif
  1252. }
  1253. static inline void tlb_write_indexed(void)
  1254. {
  1255. __asm__ __volatile__(
  1256. ".set noreorder\n\t"
  1257. "tlbwi\n\t"
  1258. ".set reorder");
  1259. }
  1260. static inline void tlb_write_random(void)
  1261. {
  1262. __asm__ __volatile__(
  1263. ".set noreorder\n\t"
  1264. "tlbwr\n\t"
  1265. ".set reorder");
  1266. }
  1267. /*
  1268. * Manipulate bits in a c0 register.
  1269. */
  1270. #ifndef CONFIG_MIPS_MT_SMTC
  1271. /*
  1272. * SMTC Linux requires shutting-down microthread scheduling
  1273. * during CP0 register read-modify-write sequences.
  1274. */
  1275. #define __BUILD_SET_C0(name) \
  1276. static inline unsigned int \
  1277. set_c0_##name(unsigned int set) \
  1278. { \
  1279. unsigned int res, new; \
  1280. \
  1281. res = read_c0_##name(); \
  1282. new = res | set; \
  1283. write_c0_##name(new); \
  1284. \
  1285. return res; \
  1286. } \
  1287. \
  1288. static inline unsigned int \
  1289. clear_c0_##name(unsigned int clear) \
  1290. { \
  1291. unsigned int res, new; \
  1292. \
  1293. res = read_c0_##name(); \
  1294. new = res & ~clear; \
  1295. write_c0_##name(new); \
  1296. \
  1297. return res; \
  1298. } \
  1299. \
  1300. static inline unsigned int \
  1301. change_c0_##name(unsigned int change, unsigned int val) \
  1302. { \
  1303. unsigned int res, new; \
  1304. \
  1305. res = read_c0_##name(); \
  1306. new = res & ~change; \
  1307. new |= (val & change); \
  1308. write_c0_##name(new); \
  1309. \
  1310. return res; \
  1311. }
  1312. #else /* SMTC versions that manage MT scheduling */
  1313. #include <linux/irqflags.h>
  1314. /*
  1315. * This is a duplicate of dmt() in mipsmtregs.h to avoid problems with
  1316. * header file recursion.
  1317. */
  1318. static inline unsigned int __dmt(void)
  1319. {
  1320. int res;
  1321. __asm__ __volatile__(
  1322. " .set push \n"
  1323. " .set mips32r2 \n"
  1324. " .set noat \n"
  1325. " .word 0x41610BC1 # dmt $1 \n"
  1326. " ehb \n"
  1327. " move %0, $1 \n"
  1328. " .set pop \n"
  1329. : "=r" (res));
  1330. instruction_hazard();
  1331. return res;
  1332. }
  1333. #define __VPECONTROL_TE_SHIFT 15
  1334. #define __VPECONTROL_TE (1UL << __VPECONTROL_TE_SHIFT)
  1335. #define __EMT_ENABLE __VPECONTROL_TE
  1336. static inline void __emt(unsigned int previous)
  1337. {
  1338. if ((previous & __EMT_ENABLE))
  1339. __asm__ __volatile__(
  1340. " .set mips32r2 \n"
  1341. " .word 0x41600be1 # emt \n"
  1342. " ehb \n"
  1343. " .set mips0 \n");
  1344. }
  1345. static inline void __ehb(void)
  1346. {
  1347. __asm__ __volatile__(
  1348. " .set mips32r2 \n"
  1349. " ehb \n" " .set mips0 \n");
  1350. }
  1351. /*
  1352. * Note that local_irq_save/restore affect TC-specific IXMT state,
  1353. * not Status.IE as in non-SMTC kernel.
  1354. */
  1355. #define __BUILD_SET_C0(name) \
  1356. static inline unsigned int \
  1357. set_c0_##name(unsigned int set) \
  1358. { \
  1359. unsigned int res; \
  1360. unsigned int new; \
  1361. unsigned int omt; \
  1362. unsigned long flags; \
  1363. \
  1364. local_irq_save(flags); \
  1365. omt = __dmt(); \
  1366. res = read_c0_##name(); \
  1367. new = res | set; \
  1368. write_c0_##name(new); \
  1369. __emt(omt); \
  1370. local_irq_restore(flags); \
  1371. \
  1372. return res; \
  1373. } \
  1374. \
  1375. static inline unsigned int \
  1376. clear_c0_##name(unsigned int clear) \
  1377. { \
  1378. unsigned int res; \
  1379. unsigned int new; \
  1380. unsigned int omt; \
  1381. unsigned long flags; \
  1382. \
  1383. local_irq_save(flags); \
  1384. omt = __dmt(); \
  1385. res = read_c0_##name(); \
  1386. new = res & ~clear; \
  1387. write_c0_##name(new); \
  1388. __emt(omt); \
  1389. local_irq_restore(flags); \
  1390. \
  1391. return res; \
  1392. } \
  1393. \
  1394. static inline unsigned int \
  1395. change_c0_##name(unsigned int change, unsigned int newbits) \
  1396. { \
  1397. unsigned int res; \
  1398. unsigned int new; \
  1399. unsigned int omt; \
  1400. unsigned long flags; \
  1401. \
  1402. local_irq_save(flags); \
  1403. \
  1404. omt = __dmt(); \
  1405. res = read_c0_##name(); \
  1406. new = res & ~change; \
  1407. new |= (newbits & change); \
  1408. write_c0_##name(new); \
  1409. __emt(omt); \
  1410. local_irq_restore(flags); \
  1411. \
  1412. return res; \
  1413. }
  1414. #endif
  1415. __BUILD_SET_C0(status)
  1416. __BUILD_SET_C0(cause)
  1417. __BUILD_SET_C0(config)
  1418. __BUILD_SET_C0(intcontrol)
  1419. __BUILD_SET_C0(intctl)
  1420. __BUILD_SET_C0(srsmap)
  1421. #endif /* !__ASSEMBLY__ */
  1422. #endif /* _ASM_MIPSREGS_H */