cherrs.S 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576
  1. /* These get patched into the trap table at boot time
  2. * once we know we have a cheetah processor.
  3. */
  4. .globl cheetah_fecc_trap_vector
  5. .type cheetah_fecc_trap_vector,#function
  6. cheetah_fecc_trap_vector:
  7. membar #Sync
  8. ldxa [%g0] ASI_DCU_CONTROL_REG, %g1
  9. andn %g1, DCU_DC | DCU_IC, %g1
  10. stxa %g1, [%g0] ASI_DCU_CONTROL_REG
  11. membar #Sync
  12. sethi %hi(cheetah_fast_ecc), %g2
  13. jmpl %g2 + %lo(cheetah_fast_ecc), %g0
  14. mov 0, %g1
  15. .size cheetah_fecc_trap_vector,.-cheetah_fecc_trap_vector
  16. .globl cheetah_fecc_trap_vector_tl1
  17. .type cheetah_fecc_trap_vector_tl1,#function
  18. cheetah_fecc_trap_vector_tl1:
  19. membar #Sync
  20. ldxa [%g0] ASI_DCU_CONTROL_REG, %g1
  21. andn %g1, DCU_DC | DCU_IC, %g1
  22. stxa %g1, [%g0] ASI_DCU_CONTROL_REG
  23. membar #Sync
  24. sethi %hi(cheetah_fast_ecc), %g2
  25. jmpl %g2 + %lo(cheetah_fast_ecc), %g0
  26. mov 1, %g1
  27. .size cheetah_fecc_trap_vector_tl1,.-cheetah_fecc_trap_vector_tl1
  28. .globl cheetah_cee_trap_vector
  29. .type cheetah_cee_trap_vector,#function
  30. cheetah_cee_trap_vector:
  31. membar #Sync
  32. ldxa [%g0] ASI_DCU_CONTROL_REG, %g1
  33. andn %g1, DCU_IC, %g1
  34. stxa %g1, [%g0] ASI_DCU_CONTROL_REG
  35. membar #Sync
  36. sethi %hi(cheetah_cee), %g2
  37. jmpl %g2 + %lo(cheetah_cee), %g0
  38. mov 0, %g1
  39. .size cheetah_cee_trap_vector,.-cheetah_cee_trap_vector
  40. .globl cheetah_cee_trap_vector_tl1
  41. .type cheetah_cee_trap_vector_tl1,#function
  42. cheetah_cee_trap_vector_tl1:
  43. membar #Sync
  44. ldxa [%g0] ASI_DCU_CONTROL_REG, %g1
  45. andn %g1, DCU_IC, %g1
  46. stxa %g1, [%g0] ASI_DCU_CONTROL_REG
  47. membar #Sync
  48. sethi %hi(cheetah_cee), %g2
  49. jmpl %g2 + %lo(cheetah_cee), %g0
  50. mov 1, %g1
  51. .size cheetah_cee_trap_vector_tl1,.-cheetah_cee_trap_vector_tl1
  52. .globl cheetah_deferred_trap_vector
  53. .type cheetah_deferred_trap_vector,#function
  54. cheetah_deferred_trap_vector:
  55. membar #Sync
  56. ldxa [%g0] ASI_DCU_CONTROL_REG, %g1;
  57. andn %g1, DCU_DC | DCU_IC, %g1;
  58. stxa %g1, [%g0] ASI_DCU_CONTROL_REG;
  59. membar #Sync;
  60. sethi %hi(cheetah_deferred_trap), %g2
  61. jmpl %g2 + %lo(cheetah_deferred_trap), %g0
  62. mov 0, %g1
  63. .size cheetah_deferred_trap_vector,.-cheetah_deferred_trap_vector
  64. .globl cheetah_deferred_trap_vector_tl1
  65. .type cheetah_deferred_trap_vector_tl1,#function
  66. cheetah_deferred_trap_vector_tl1:
  67. membar #Sync;
  68. ldxa [%g0] ASI_DCU_CONTROL_REG, %g1;
  69. andn %g1, DCU_DC | DCU_IC, %g1;
  70. stxa %g1, [%g0] ASI_DCU_CONTROL_REG;
  71. membar #Sync;
  72. sethi %hi(cheetah_deferred_trap), %g2
  73. jmpl %g2 + %lo(cheetah_deferred_trap), %g0
  74. mov 1, %g1
  75. .size cheetah_deferred_trap_vector_tl1,.-cheetah_deferred_trap_vector_tl1
  76. /* Cheetah+ specific traps. These are for the new I/D cache parity
  77. * error traps. The first argument to cheetah_plus_parity_handler
  78. * is encoded as follows:
  79. *
  80. * Bit0: 0=dcache,1=icache
  81. * Bit1: 0=recoverable,1=unrecoverable
  82. */
  83. .globl cheetah_plus_dcpe_trap_vector
  84. .type cheetah_plus_dcpe_trap_vector,#function
  85. cheetah_plus_dcpe_trap_vector:
  86. membar #Sync
  87. sethi %hi(do_cheetah_plus_data_parity), %g7
  88. jmpl %g7 + %lo(do_cheetah_plus_data_parity), %g0
  89. nop
  90. nop
  91. nop
  92. nop
  93. nop
  94. .size cheetah_plus_dcpe_trap_vector,.-cheetah_plus_dcpe_trap_vector
  95. .type do_cheetah_plus_data_parity,#function
  96. do_cheetah_plus_data_parity:
  97. rdpr %pil, %g2
  98. wrpr %g0, PIL_NORMAL_MAX, %pil
  99. ba,pt %xcc, etrap_irq
  100. rd %pc, %g7
  101. #ifdef CONFIG_TRACE_IRQFLAGS
  102. call trace_hardirqs_off
  103. nop
  104. #endif
  105. mov 0x0, %o0
  106. call cheetah_plus_parity_error
  107. add %sp, PTREGS_OFF, %o1
  108. ba,a,pt %xcc, rtrap_irq
  109. .size do_cheetah_plus_data_parity,.-do_cheetah_plus_data_parity
  110. .globl cheetah_plus_dcpe_trap_vector_tl1
  111. .type cheetah_plus_dcpe_trap_vector_tl1,#function
  112. cheetah_plus_dcpe_trap_vector_tl1:
  113. membar #Sync
  114. wrpr PSTATE_IG | PSTATE_PEF | PSTATE_PRIV, %pstate
  115. sethi %hi(do_dcpe_tl1), %g3
  116. jmpl %g3 + %lo(do_dcpe_tl1), %g0
  117. nop
  118. nop
  119. nop
  120. nop
  121. .size cheetah_plus_dcpe_trap_vector_tl1,.-cheetah_plus_dcpe_trap_vector_tl1
  122. .globl cheetah_plus_icpe_trap_vector
  123. .type cheetah_plus_icpe_trap_vector,#function
  124. cheetah_plus_icpe_trap_vector:
  125. membar #Sync
  126. sethi %hi(do_cheetah_plus_insn_parity), %g7
  127. jmpl %g7 + %lo(do_cheetah_plus_insn_parity), %g0
  128. nop
  129. nop
  130. nop
  131. nop
  132. nop
  133. .size cheetah_plus_icpe_trap_vector,.-cheetah_plus_icpe_trap_vector
  134. .type do_cheetah_plus_insn_parity,#function
  135. do_cheetah_plus_insn_parity:
  136. rdpr %pil, %g2
  137. wrpr %g0, PIL_NORMAL_MAX, %pil
  138. ba,pt %xcc, etrap_irq
  139. rd %pc, %g7
  140. #ifdef CONFIG_TRACE_IRQFLAGS
  141. call trace_hardirqs_off
  142. nop
  143. #endif
  144. mov 0x1, %o0
  145. call cheetah_plus_parity_error
  146. add %sp, PTREGS_OFF, %o1
  147. ba,a,pt %xcc, rtrap_irq
  148. .size do_cheetah_plus_insn_parity,.-do_cheetah_plus_insn_parity
  149. .globl cheetah_plus_icpe_trap_vector_tl1
  150. .type cheetah_plus_icpe_trap_vector_tl1,#function
  151. cheetah_plus_icpe_trap_vector_tl1:
  152. membar #Sync
  153. wrpr PSTATE_IG | PSTATE_PEF | PSTATE_PRIV, %pstate
  154. sethi %hi(do_icpe_tl1), %g3
  155. jmpl %g3 + %lo(do_icpe_tl1), %g0
  156. nop
  157. nop
  158. nop
  159. nop
  160. .size cheetah_plus_icpe_trap_vector_tl1,.-cheetah_plus_icpe_trap_vector_tl1
  161. /* If we take one of these traps when tl >= 1, then we
  162. * jump to interrupt globals. If some trap level above us
  163. * was also using interrupt globals, we cannot recover.
  164. * We may use all interrupt global registers except %g6.
  165. */
  166. .globl do_dcpe_tl1
  167. .type do_dcpe_tl1,#function
  168. do_dcpe_tl1:
  169. rdpr %tl, %g1 ! Save original trap level
  170. mov 1, %g2 ! Setup TSTATE checking loop
  171. sethi %hi(TSTATE_IG), %g3 ! TSTATE mask bit
  172. 1: wrpr %g2, %tl ! Set trap level to check
  173. rdpr %tstate, %g4 ! Read TSTATE for this level
  174. andcc %g4, %g3, %g0 ! Interrupt globals in use?
  175. bne,a,pn %xcc, do_dcpe_tl1_fatal ! Yep, irrecoverable
  176. wrpr %g1, %tl ! Restore original trap level
  177. add %g2, 1, %g2 ! Next trap level
  178. cmp %g2, %g1 ! Hit them all yet?
  179. ble,pt %icc, 1b ! Not yet
  180. nop
  181. wrpr %g1, %tl ! Restore original trap level
  182. do_dcpe_tl1_nonfatal: /* Ok we may use interrupt globals safely. */
  183. sethi %hi(dcache_parity_tl1_occurred), %g2
  184. lduw [%g2 + %lo(dcache_parity_tl1_occurred)], %g1
  185. add %g1, 1, %g1
  186. stw %g1, [%g2 + %lo(dcache_parity_tl1_occurred)]
  187. /* Reset D-cache parity */
  188. sethi %hi(1 << 16), %g1 ! D-cache size
  189. mov (1 << 5), %g2 ! D-cache line size
  190. sub %g1, %g2, %g1 ! Move down 1 cacheline
  191. 1: srl %g1, 14, %g3 ! Compute UTAG
  192. membar #Sync
  193. stxa %g3, [%g1] ASI_DCACHE_UTAG
  194. membar #Sync
  195. sub %g2, 8, %g3 ! 64-bit data word within line
  196. 2: membar #Sync
  197. stxa %g0, [%g1 + %g3] ASI_DCACHE_DATA
  198. membar #Sync
  199. subcc %g3, 8, %g3 ! Next 64-bit data word
  200. bge,pt %icc, 2b
  201. nop
  202. subcc %g1, %g2, %g1 ! Next cacheline
  203. bge,pt %icc, 1b
  204. nop
  205. ba,a,pt %xcc, dcpe_icpe_tl1_common
  206. do_dcpe_tl1_fatal:
  207. sethi %hi(1f), %g7
  208. ba,pt %xcc, etraptl1
  209. 1: or %g7, %lo(1b), %g7
  210. mov 0x2, %o0
  211. call cheetah_plus_parity_error
  212. add %sp, PTREGS_OFF, %o1
  213. ba,a,pt %xcc, rtrap
  214. .size do_dcpe_tl1,.-do_dcpe_tl1
  215. .globl do_icpe_tl1
  216. .type do_icpe_tl1,#function
  217. do_icpe_tl1:
  218. rdpr %tl, %g1 ! Save original trap level
  219. mov 1, %g2 ! Setup TSTATE checking loop
  220. sethi %hi(TSTATE_IG), %g3 ! TSTATE mask bit
  221. 1: wrpr %g2, %tl ! Set trap level to check
  222. rdpr %tstate, %g4 ! Read TSTATE for this level
  223. andcc %g4, %g3, %g0 ! Interrupt globals in use?
  224. bne,a,pn %xcc, do_icpe_tl1_fatal ! Yep, irrecoverable
  225. wrpr %g1, %tl ! Restore original trap level
  226. add %g2, 1, %g2 ! Next trap level
  227. cmp %g2, %g1 ! Hit them all yet?
  228. ble,pt %icc, 1b ! Not yet
  229. nop
  230. wrpr %g1, %tl ! Restore original trap level
  231. do_icpe_tl1_nonfatal: /* Ok we may use interrupt globals safely. */
  232. sethi %hi(icache_parity_tl1_occurred), %g2
  233. lduw [%g2 + %lo(icache_parity_tl1_occurred)], %g1
  234. add %g1, 1, %g1
  235. stw %g1, [%g2 + %lo(icache_parity_tl1_occurred)]
  236. /* Flush I-cache */
  237. sethi %hi(1 << 15), %g1 ! I-cache size
  238. mov (1 << 5), %g2 ! I-cache line size
  239. sub %g1, %g2, %g1
  240. 1: or %g1, (2 << 3), %g3
  241. stxa %g0, [%g3] ASI_IC_TAG
  242. membar #Sync
  243. subcc %g1, %g2, %g1
  244. bge,pt %icc, 1b
  245. nop
  246. ba,a,pt %xcc, dcpe_icpe_tl1_common
  247. do_icpe_tl1_fatal:
  248. sethi %hi(1f), %g7
  249. ba,pt %xcc, etraptl1
  250. 1: or %g7, %lo(1b), %g7
  251. mov 0x3, %o0
  252. call cheetah_plus_parity_error
  253. add %sp, PTREGS_OFF, %o1
  254. ba,a,pt %xcc, rtrap
  255. .size do_icpe_tl1,.-do_icpe_tl1
  256. .type dcpe_icpe_tl1_common,#function
  257. dcpe_icpe_tl1_common:
  258. /* Flush D-cache, re-enable D/I caches in DCU and finally
  259. * retry the trapping instruction.
  260. */
  261. sethi %hi(1 << 16), %g1 ! D-cache size
  262. mov (1 << 5), %g2 ! D-cache line size
  263. sub %g1, %g2, %g1
  264. 1: stxa %g0, [%g1] ASI_DCACHE_TAG
  265. membar #Sync
  266. subcc %g1, %g2, %g1
  267. bge,pt %icc, 1b
  268. nop
  269. ldxa [%g0] ASI_DCU_CONTROL_REG, %g1
  270. or %g1, (DCU_DC | DCU_IC), %g1
  271. stxa %g1, [%g0] ASI_DCU_CONTROL_REG
  272. membar #Sync
  273. retry
  274. .size dcpe_icpe_tl1_common,.-dcpe_icpe_tl1_common
  275. /* Capture I/D/E-cache state into per-cpu error scoreboard.
  276. *
  277. * %g1: (TL>=0) ? 1 : 0
  278. * %g2: scratch
  279. * %g3: scratch
  280. * %g4: AFSR
  281. * %g5: AFAR
  282. * %g6: unused, will have current thread ptr after etrap
  283. * %g7: scratch
  284. */
  285. .type __cheetah_log_error,#function
  286. __cheetah_log_error:
  287. /* Put "TL1" software bit into AFSR. */
  288. and %g1, 0x1, %g1
  289. sllx %g1, 63, %g2
  290. or %g4, %g2, %g4
  291. /* Get log entry pointer for this cpu at this trap level. */
  292. BRANCH_IF_JALAPENO(g2,g3,50f)
  293. ldxa [%g0] ASI_SAFARI_CONFIG, %g2
  294. srlx %g2, 17, %g2
  295. ba,pt %xcc, 60f
  296. and %g2, 0x3ff, %g2
  297. 50: ldxa [%g0] ASI_JBUS_CONFIG, %g2
  298. srlx %g2, 17, %g2
  299. and %g2, 0x1f, %g2
  300. 60: sllx %g2, 9, %g2
  301. sethi %hi(cheetah_error_log), %g3
  302. ldx [%g3 + %lo(cheetah_error_log)], %g3
  303. brz,pn %g3, 80f
  304. nop
  305. add %g3, %g2, %g3
  306. sllx %g1, 8, %g1
  307. add %g3, %g1, %g1
  308. /* %g1 holds pointer to the top of the logging scoreboard */
  309. ldx [%g1 + 0x0], %g7
  310. cmp %g7, -1
  311. bne,pn %xcc, 80f
  312. nop
  313. stx %g4, [%g1 + 0x0]
  314. stx %g5, [%g1 + 0x8]
  315. add %g1, 0x10, %g1
  316. /* %g1 now points to D-cache logging area */
  317. set 0x3ff8, %g2 /* DC_addr mask */
  318. and %g5, %g2, %g2 /* DC_addr bits of AFAR */
  319. srlx %g5, 12, %g3
  320. or %g3, 1, %g3 /* PHYS tag + valid */
  321. 10: ldxa [%g2] ASI_DCACHE_TAG, %g7
  322. cmp %g3, %g7 /* TAG match? */
  323. bne,pt %xcc, 13f
  324. nop
  325. /* Yep, what we want, capture state. */
  326. stx %g2, [%g1 + 0x20]
  327. stx %g7, [%g1 + 0x28]
  328. /* A membar Sync is required before and after utag access. */
  329. membar #Sync
  330. ldxa [%g2] ASI_DCACHE_UTAG, %g7
  331. membar #Sync
  332. stx %g7, [%g1 + 0x30]
  333. ldxa [%g2] ASI_DCACHE_SNOOP_TAG, %g7
  334. stx %g7, [%g1 + 0x38]
  335. clr %g3
  336. 12: ldxa [%g2 + %g3] ASI_DCACHE_DATA, %g7
  337. stx %g7, [%g1]
  338. add %g3, (1 << 5), %g3
  339. cmp %g3, (4 << 5)
  340. bl,pt %xcc, 12b
  341. add %g1, 0x8, %g1
  342. ba,pt %xcc, 20f
  343. add %g1, 0x20, %g1
  344. 13: sethi %hi(1 << 14), %g7
  345. add %g2, %g7, %g2
  346. srlx %g2, 14, %g7
  347. cmp %g7, 4
  348. bl,pt %xcc, 10b
  349. nop
  350. add %g1, 0x40, %g1
  351. /* %g1 now points to I-cache logging area */
  352. 20: set 0x1fe0, %g2 /* IC_addr mask */
  353. and %g5, %g2, %g2 /* IC_addr bits of AFAR */
  354. sllx %g2, 1, %g2 /* IC_addr[13:6]==VA[12:5] */
  355. srlx %g5, (13 - 8), %g3 /* Make PTAG */
  356. andn %g3, 0xff, %g3 /* Mask off undefined bits */
  357. 21: ldxa [%g2] ASI_IC_TAG, %g7
  358. andn %g7, 0xff, %g7
  359. cmp %g3, %g7
  360. bne,pt %xcc, 23f
  361. nop
  362. /* Yep, what we want, capture state. */
  363. stx %g2, [%g1 + 0x40]
  364. stx %g7, [%g1 + 0x48]
  365. add %g2, (1 << 3), %g2
  366. ldxa [%g2] ASI_IC_TAG, %g7
  367. add %g2, (1 << 3), %g2
  368. stx %g7, [%g1 + 0x50]
  369. ldxa [%g2] ASI_IC_TAG, %g7
  370. add %g2, (1 << 3), %g2
  371. stx %g7, [%g1 + 0x60]
  372. ldxa [%g2] ASI_IC_TAG, %g7
  373. stx %g7, [%g1 + 0x68]
  374. sub %g2, (3 << 3), %g2
  375. ldxa [%g2] ASI_IC_STAG, %g7
  376. stx %g7, [%g1 + 0x58]
  377. clr %g3
  378. srlx %g2, 2, %g2
  379. 22: ldxa [%g2 + %g3] ASI_IC_INSTR, %g7
  380. stx %g7, [%g1]
  381. add %g3, (1 << 3), %g3
  382. cmp %g3, (8 << 3)
  383. bl,pt %xcc, 22b
  384. add %g1, 0x8, %g1
  385. ba,pt %xcc, 30f
  386. add %g1, 0x30, %g1
  387. 23: sethi %hi(1 << 14), %g7
  388. add %g2, %g7, %g2
  389. srlx %g2, 14, %g7
  390. cmp %g7, 4
  391. bl,pt %xcc, 21b
  392. nop
  393. add %g1, 0x70, %g1
  394. /* %g1 now points to E-cache logging area */
  395. 30: andn %g5, (32 - 1), %g2
  396. stx %g2, [%g1 + 0x20]
  397. ldxa [%g2] ASI_EC_TAG_DATA, %g7
  398. stx %g7, [%g1 + 0x28]
  399. ldxa [%g2] ASI_EC_R, %g0
  400. clr %g3
  401. 31: ldxa [%g3] ASI_EC_DATA, %g7
  402. stx %g7, [%g1 + %g3]
  403. add %g3, 0x8, %g3
  404. cmp %g3, 0x20
  405. bl,pt %xcc, 31b
  406. nop
  407. 80:
  408. rdpr %tt, %g2
  409. cmp %g2, 0x70
  410. be c_fast_ecc
  411. cmp %g2, 0x63
  412. be c_cee
  413. nop
  414. ba,a,pt %xcc, c_deferred
  415. .size __cheetah_log_error,.-__cheetah_log_error
  416. /* Cheetah FECC trap handling, we get here from tl{0,1}_fecc
  417. * in the trap table. That code has done a memory barrier
  418. * and has disabled both the I-cache and D-cache in the DCU
  419. * control register. The I-cache is disabled so that we may
  420. * capture the corrupted cache line, and the D-cache is disabled
  421. * because corrupt data may have been placed there and we don't
  422. * want to reference it.
  423. *
  424. * %g1 is one if this trap occurred at %tl >= 1.
  425. *
  426. * Next, we turn off error reporting so that we don't recurse.
  427. */
  428. .globl cheetah_fast_ecc
  429. .type cheetah_fast_ecc,#function
  430. cheetah_fast_ecc:
  431. ldxa [%g0] ASI_ESTATE_ERROR_EN, %g2
  432. andn %g2, ESTATE_ERROR_NCEEN | ESTATE_ERROR_CEEN, %g2
  433. stxa %g2, [%g0] ASI_ESTATE_ERROR_EN
  434. membar #Sync
  435. /* Fetch and clear AFSR/AFAR */
  436. ldxa [%g0] ASI_AFSR, %g4
  437. ldxa [%g0] ASI_AFAR, %g5
  438. stxa %g4, [%g0] ASI_AFSR
  439. membar #Sync
  440. ba,pt %xcc, __cheetah_log_error
  441. nop
  442. .size cheetah_fast_ecc,.-cheetah_fast_ecc
  443. .type c_fast_ecc,#function
  444. c_fast_ecc:
  445. rdpr %pil, %g2
  446. wrpr %g0, PIL_NORMAL_MAX, %pil
  447. ba,pt %xcc, etrap_irq
  448. rd %pc, %g7
  449. #ifdef CONFIG_TRACE_IRQFLAGS
  450. call trace_hardirqs_off
  451. nop
  452. #endif
  453. mov %l4, %o1
  454. mov %l5, %o2
  455. call cheetah_fecc_handler
  456. add %sp, PTREGS_OFF, %o0
  457. ba,a,pt %xcc, rtrap_irq
  458. .size c_fast_ecc,.-c_fast_ecc
  459. /* Our caller has disabled I-cache and performed membar Sync. */
  460. .globl cheetah_cee
  461. .type cheetah_cee,#function
  462. cheetah_cee:
  463. ldxa [%g0] ASI_ESTATE_ERROR_EN, %g2
  464. andn %g2, ESTATE_ERROR_CEEN, %g2
  465. stxa %g2, [%g0] ASI_ESTATE_ERROR_EN
  466. membar #Sync
  467. /* Fetch and clear AFSR/AFAR */
  468. ldxa [%g0] ASI_AFSR, %g4
  469. ldxa [%g0] ASI_AFAR, %g5
  470. stxa %g4, [%g0] ASI_AFSR
  471. membar #Sync
  472. ba,pt %xcc, __cheetah_log_error
  473. nop
  474. .size cheetah_cee,.-cheetah_cee
  475. .type c_cee,#function
  476. c_cee:
  477. rdpr %pil, %g2
  478. wrpr %g0, PIL_NORMAL_MAX, %pil
  479. ba,pt %xcc, etrap_irq
  480. rd %pc, %g7
  481. #ifdef CONFIG_TRACE_IRQFLAGS
  482. call trace_hardirqs_off
  483. nop
  484. #endif
  485. mov %l4, %o1
  486. mov %l5, %o2
  487. call cheetah_cee_handler
  488. add %sp, PTREGS_OFF, %o0
  489. ba,a,pt %xcc, rtrap_irq
  490. .size c_cee,.-c_cee
  491. /* Our caller has disabled I-cache+D-cache and performed membar Sync. */
  492. .globl cheetah_deferred_trap
  493. .type cheetah_deferred_trap,#function
  494. cheetah_deferred_trap:
  495. ldxa [%g0] ASI_ESTATE_ERROR_EN, %g2
  496. andn %g2, ESTATE_ERROR_NCEEN | ESTATE_ERROR_CEEN, %g2
  497. stxa %g2, [%g0] ASI_ESTATE_ERROR_EN
  498. membar #Sync
  499. /* Fetch and clear AFSR/AFAR */
  500. ldxa [%g0] ASI_AFSR, %g4
  501. ldxa [%g0] ASI_AFAR, %g5
  502. stxa %g4, [%g0] ASI_AFSR
  503. membar #Sync
  504. ba,pt %xcc, __cheetah_log_error
  505. nop
  506. .size cheetah_deferred_trap,.-cheetah_deferred_trap
  507. .type c_deferred,#function
  508. c_deferred:
  509. rdpr %pil, %g2
  510. wrpr %g0, PIL_NORMAL_MAX, %pil
  511. ba,pt %xcc, etrap_irq
  512. rd %pc, %g7
  513. #ifdef CONFIG_TRACE_IRQFLAGS
  514. call trace_hardirqs_off
  515. nop
  516. #endif
  517. mov %l4, %o1
  518. mov %l5, %o2
  519. call cheetah_deferred_handler
  520. add %sp, PTREGS_OFF, %o0
  521. ba,a,pt %xcc, rtrap_irq
  522. .size c_deferred,.-c_deferred