cherrs.S 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580
  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,pt %xcc, dcpe_icpe_tl1_common
  206. nop
  207. do_dcpe_tl1_fatal:
  208. sethi %hi(1f), %g7
  209. ba,pt %xcc, etraptl1
  210. 1: or %g7, %lo(1b), %g7
  211. mov 0x2, %o0
  212. call cheetah_plus_parity_error
  213. add %sp, PTREGS_OFF, %o1
  214. ba,pt %xcc, rtrap
  215. nop
  216. .size do_dcpe_tl1,.-do_dcpe_tl1
  217. .globl do_icpe_tl1
  218. .type do_icpe_tl1,#function
  219. do_icpe_tl1:
  220. rdpr %tl, %g1 ! Save original trap level
  221. mov 1, %g2 ! Setup TSTATE checking loop
  222. sethi %hi(TSTATE_IG), %g3 ! TSTATE mask bit
  223. 1: wrpr %g2, %tl ! Set trap level to check
  224. rdpr %tstate, %g4 ! Read TSTATE for this level
  225. andcc %g4, %g3, %g0 ! Interrupt globals in use?
  226. bne,a,pn %xcc, do_icpe_tl1_fatal ! Yep, irrecoverable
  227. wrpr %g1, %tl ! Restore original trap level
  228. add %g2, 1, %g2 ! Next trap level
  229. cmp %g2, %g1 ! Hit them all yet?
  230. ble,pt %icc, 1b ! Not yet
  231. nop
  232. wrpr %g1, %tl ! Restore original trap level
  233. do_icpe_tl1_nonfatal: /* Ok we may use interrupt globals safely. */
  234. sethi %hi(icache_parity_tl1_occurred), %g2
  235. lduw [%g2 + %lo(icache_parity_tl1_occurred)], %g1
  236. add %g1, 1, %g1
  237. stw %g1, [%g2 + %lo(icache_parity_tl1_occurred)]
  238. /* Flush I-cache */
  239. sethi %hi(1 << 15), %g1 ! I-cache size
  240. mov (1 << 5), %g2 ! I-cache line size
  241. sub %g1, %g2, %g1
  242. 1: or %g1, (2 << 3), %g3
  243. stxa %g0, [%g3] ASI_IC_TAG
  244. membar #Sync
  245. subcc %g1, %g2, %g1
  246. bge,pt %icc, 1b
  247. nop
  248. ba,pt %xcc, dcpe_icpe_tl1_common
  249. nop
  250. do_icpe_tl1_fatal:
  251. sethi %hi(1f), %g7
  252. ba,pt %xcc, etraptl1
  253. 1: or %g7, %lo(1b), %g7
  254. mov 0x3, %o0
  255. call cheetah_plus_parity_error
  256. add %sp, PTREGS_OFF, %o1
  257. ba,pt %xcc, rtrap
  258. nop
  259. .size do_icpe_tl1,.-do_icpe_tl1
  260. .type dcpe_icpe_tl1_common,#function
  261. dcpe_icpe_tl1_common:
  262. /* Flush D-cache, re-enable D/I caches in DCU and finally
  263. * retry the trapping instruction.
  264. */
  265. sethi %hi(1 << 16), %g1 ! D-cache size
  266. mov (1 << 5), %g2 ! D-cache line size
  267. sub %g1, %g2, %g1
  268. 1: stxa %g0, [%g1] ASI_DCACHE_TAG
  269. membar #Sync
  270. subcc %g1, %g2, %g1
  271. bge,pt %icc, 1b
  272. nop
  273. ldxa [%g0] ASI_DCU_CONTROL_REG, %g1
  274. or %g1, (DCU_DC | DCU_IC), %g1
  275. stxa %g1, [%g0] ASI_DCU_CONTROL_REG
  276. membar #Sync
  277. retry
  278. .size dcpe_icpe_tl1_common,.-dcpe_icpe_tl1_common
  279. /* Capture I/D/E-cache state into per-cpu error scoreboard.
  280. *
  281. * %g1: (TL>=0) ? 1 : 0
  282. * %g2: scratch
  283. * %g3: scratch
  284. * %g4: AFSR
  285. * %g5: AFAR
  286. * %g6: unused, will have current thread ptr after etrap
  287. * %g7: scratch
  288. */
  289. .type __cheetah_log_error,#function
  290. __cheetah_log_error:
  291. /* Put "TL1" software bit into AFSR. */
  292. and %g1, 0x1, %g1
  293. sllx %g1, 63, %g2
  294. or %g4, %g2, %g4
  295. /* Get log entry pointer for this cpu at this trap level. */
  296. BRANCH_IF_JALAPENO(g2,g3,50f)
  297. ldxa [%g0] ASI_SAFARI_CONFIG, %g2
  298. srlx %g2, 17, %g2
  299. ba,pt %xcc, 60f
  300. and %g2, 0x3ff, %g2
  301. 50: ldxa [%g0] ASI_JBUS_CONFIG, %g2
  302. srlx %g2, 17, %g2
  303. and %g2, 0x1f, %g2
  304. 60: sllx %g2, 9, %g2
  305. sethi %hi(cheetah_error_log), %g3
  306. ldx [%g3 + %lo(cheetah_error_log)], %g3
  307. brz,pn %g3, 80f
  308. nop
  309. add %g3, %g2, %g3
  310. sllx %g1, 8, %g1
  311. add %g3, %g1, %g1
  312. /* %g1 holds pointer to the top of the logging scoreboard */
  313. ldx [%g1 + 0x0], %g7
  314. cmp %g7, -1
  315. bne,pn %xcc, 80f
  316. nop
  317. stx %g4, [%g1 + 0x0]
  318. stx %g5, [%g1 + 0x8]
  319. add %g1, 0x10, %g1
  320. /* %g1 now points to D-cache logging area */
  321. set 0x3ff8, %g2 /* DC_addr mask */
  322. and %g5, %g2, %g2 /* DC_addr bits of AFAR */
  323. srlx %g5, 12, %g3
  324. or %g3, 1, %g3 /* PHYS tag + valid */
  325. 10: ldxa [%g2] ASI_DCACHE_TAG, %g7
  326. cmp %g3, %g7 /* TAG match? */
  327. bne,pt %xcc, 13f
  328. nop
  329. /* Yep, what we want, capture state. */
  330. stx %g2, [%g1 + 0x20]
  331. stx %g7, [%g1 + 0x28]
  332. /* A membar Sync is required before and after utag access. */
  333. membar #Sync
  334. ldxa [%g2] ASI_DCACHE_UTAG, %g7
  335. membar #Sync
  336. stx %g7, [%g1 + 0x30]
  337. ldxa [%g2] ASI_DCACHE_SNOOP_TAG, %g7
  338. stx %g7, [%g1 + 0x38]
  339. clr %g3
  340. 12: ldxa [%g2 + %g3] ASI_DCACHE_DATA, %g7
  341. stx %g7, [%g1]
  342. add %g3, (1 << 5), %g3
  343. cmp %g3, (4 << 5)
  344. bl,pt %xcc, 12b
  345. add %g1, 0x8, %g1
  346. ba,pt %xcc, 20f
  347. add %g1, 0x20, %g1
  348. 13: sethi %hi(1 << 14), %g7
  349. add %g2, %g7, %g2
  350. srlx %g2, 14, %g7
  351. cmp %g7, 4
  352. bl,pt %xcc, 10b
  353. nop
  354. add %g1, 0x40, %g1
  355. /* %g1 now points to I-cache logging area */
  356. 20: set 0x1fe0, %g2 /* IC_addr mask */
  357. and %g5, %g2, %g2 /* IC_addr bits of AFAR */
  358. sllx %g2, 1, %g2 /* IC_addr[13:6]==VA[12:5] */
  359. srlx %g5, (13 - 8), %g3 /* Make PTAG */
  360. andn %g3, 0xff, %g3 /* Mask off undefined bits */
  361. 21: ldxa [%g2] ASI_IC_TAG, %g7
  362. andn %g7, 0xff, %g7
  363. cmp %g3, %g7
  364. bne,pt %xcc, 23f
  365. nop
  366. /* Yep, what we want, capture state. */
  367. stx %g2, [%g1 + 0x40]
  368. stx %g7, [%g1 + 0x48]
  369. add %g2, (1 << 3), %g2
  370. ldxa [%g2] ASI_IC_TAG, %g7
  371. add %g2, (1 << 3), %g2
  372. stx %g7, [%g1 + 0x50]
  373. ldxa [%g2] ASI_IC_TAG, %g7
  374. add %g2, (1 << 3), %g2
  375. stx %g7, [%g1 + 0x60]
  376. ldxa [%g2] ASI_IC_TAG, %g7
  377. stx %g7, [%g1 + 0x68]
  378. sub %g2, (3 << 3), %g2
  379. ldxa [%g2] ASI_IC_STAG, %g7
  380. stx %g7, [%g1 + 0x58]
  381. clr %g3
  382. srlx %g2, 2, %g2
  383. 22: ldxa [%g2 + %g3] ASI_IC_INSTR, %g7
  384. stx %g7, [%g1]
  385. add %g3, (1 << 3), %g3
  386. cmp %g3, (8 << 3)
  387. bl,pt %xcc, 22b
  388. add %g1, 0x8, %g1
  389. ba,pt %xcc, 30f
  390. add %g1, 0x30, %g1
  391. 23: sethi %hi(1 << 14), %g7
  392. add %g2, %g7, %g2
  393. srlx %g2, 14, %g7
  394. cmp %g7, 4
  395. bl,pt %xcc, 21b
  396. nop
  397. add %g1, 0x70, %g1
  398. /* %g1 now points to E-cache logging area */
  399. 30: andn %g5, (32 - 1), %g2
  400. stx %g2, [%g1 + 0x20]
  401. ldxa [%g2] ASI_EC_TAG_DATA, %g7
  402. stx %g7, [%g1 + 0x28]
  403. ldxa [%g2] ASI_EC_R, %g0
  404. clr %g3
  405. 31: ldxa [%g3] ASI_EC_DATA, %g7
  406. stx %g7, [%g1 + %g3]
  407. add %g3, 0x8, %g3
  408. cmp %g3, 0x20
  409. bl,pt %xcc, 31b
  410. nop
  411. 80:
  412. rdpr %tt, %g2
  413. cmp %g2, 0x70
  414. be c_fast_ecc
  415. cmp %g2, 0x63
  416. be c_cee
  417. nop
  418. ba,pt %xcc, c_deferred
  419. .size __cheetah_log_error,.-__cheetah_log_error
  420. /* Cheetah FECC trap handling, we get here from tl{0,1}_fecc
  421. * in the trap table. That code has done a memory barrier
  422. * and has disabled both the I-cache and D-cache in the DCU
  423. * control register. The I-cache is disabled so that we may
  424. * capture the corrupted cache line, and the D-cache is disabled
  425. * because corrupt data may have been placed there and we don't
  426. * want to reference it.
  427. *
  428. * %g1 is one if this trap occurred at %tl >= 1.
  429. *
  430. * Next, we turn off error reporting so that we don't recurse.
  431. */
  432. .globl cheetah_fast_ecc
  433. .type cheetah_fast_ecc,#function
  434. cheetah_fast_ecc:
  435. ldxa [%g0] ASI_ESTATE_ERROR_EN, %g2
  436. andn %g2, ESTATE_ERROR_NCEEN | ESTATE_ERROR_CEEN, %g2
  437. stxa %g2, [%g0] ASI_ESTATE_ERROR_EN
  438. membar #Sync
  439. /* Fetch and clear AFSR/AFAR */
  440. ldxa [%g0] ASI_AFSR, %g4
  441. ldxa [%g0] ASI_AFAR, %g5
  442. stxa %g4, [%g0] ASI_AFSR
  443. membar #Sync
  444. ba,pt %xcc, __cheetah_log_error
  445. nop
  446. .size cheetah_fast_ecc,.-cheetah_fast_ecc
  447. .type c_fast_ecc,#function
  448. c_fast_ecc:
  449. rdpr %pil, %g2
  450. wrpr %g0, PIL_NORMAL_MAX, %pil
  451. ba,pt %xcc, etrap_irq
  452. rd %pc, %g7
  453. #ifdef CONFIG_TRACE_IRQFLAGS
  454. call trace_hardirqs_off
  455. nop
  456. #endif
  457. mov %l4, %o1
  458. mov %l5, %o2
  459. call cheetah_fecc_handler
  460. add %sp, PTREGS_OFF, %o0
  461. ba,a,pt %xcc, rtrap_irq
  462. .size c_fast_ecc,.-c_fast_ecc
  463. /* Our caller has disabled I-cache and performed membar Sync. */
  464. .globl cheetah_cee
  465. .type cheetah_cee,#function
  466. cheetah_cee:
  467. ldxa [%g0] ASI_ESTATE_ERROR_EN, %g2
  468. andn %g2, ESTATE_ERROR_CEEN, %g2
  469. stxa %g2, [%g0] ASI_ESTATE_ERROR_EN
  470. membar #Sync
  471. /* Fetch and clear AFSR/AFAR */
  472. ldxa [%g0] ASI_AFSR, %g4
  473. ldxa [%g0] ASI_AFAR, %g5
  474. stxa %g4, [%g0] ASI_AFSR
  475. membar #Sync
  476. ba,pt %xcc, __cheetah_log_error
  477. nop
  478. .size cheetah_cee,.-cheetah_cee
  479. .type c_cee,#function
  480. c_cee:
  481. rdpr %pil, %g2
  482. wrpr %g0, PIL_NORMAL_MAX, %pil
  483. ba,pt %xcc, etrap_irq
  484. rd %pc, %g7
  485. #ifdef CONFIG_TRACE_IRQFLAGS
  486. call trace_hardirqs_off
  487. nop
  488. #endif
  489. mov %l4, %o1
  490. mov %l5, %o2
  491. call cheetah_cee_handler
  492. add %sp, PTREGS_OFF, %o0
  493. ba,a,pt %xcc, rtrap_irq
  494. .size c_cee,.-c_cee
  495. /* Our caller has disabled I-cache+D-cache and performed membar Sync. */
  496. .globl cheetah_deferred_trap
  497. .type cheetah_deferred_trap,#function
  498. cheetah_deferred_trap:
  499. ldxa [%g0] ASI_ESTATE_ERROR_EN, %g2
  500. andn %g2, ESTATE_ERROR_NCEEN | ESTATE_ERROR_CEEN, %g2
  501. stxa %g2, [%g0] ASI_ESTATE_ERROR_EN
  502. membar #Sync
  503. /* Fetch and clear AFSR/AFAR */
  504. ldxa [%g0] ASI_AFSR, %g4
  505. ldxa [%g0] ASI_AFAR, %g5
  506. stxa %g4, [%g0] ASI_AFSR
  507. membar #Sync
  508. ba,pt %xcc, __cheetah_log_error
  509. nop
  510. .size cheetah_deferred_trap,.-cheetah_deferred_trap
  511. .type c_deferred,#function
  512. c_deferred:
  513. rdpr %pil, %g2
  514. wrpr %g0, PIL_NORMAL_MAX, %pil
  515. ba,pt %xcc, etrap_irq
  516. rd %pc, %g7
  517. #ifdef CONFIG_TRACE_IRQFLAGS
  518. call trace_hardirqs_off
  519. nop
  520. #endif
  521. mov %l4, %o1
  522. mov %l5, %o2
  523. call cheetah_deferred_handler
  524. add %sp, PTREGS_OFF, %o0
  525. ba,a,pt %xcc, rtrap_irq
  526. .size c_deferred,.-c_deferred