assembly.h 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586
  1. /* SPDX-License-Identifier: GPL-2.0-or-later */
  2. /*
  3. * Copyright (C) 1999 Hewlett-Packard (Frank Rowand)
  4. * Copyright (C) 1999 Philipp Rumpf <prumpf@tux.org>
  5. * Copyright (C) 1999 SuSE GmbH
  6. * Copyright (C) 2021 Helge Deller <deller@gmx.de>
  7. */
  8. #ifndef _PARISC_ASSEMBLY_H
  9. #define _PARISC_ASSEMBLY_H
  10. #ifdef CONFIG_64BIT
  11. #define RP_OFFSET 16
  12. #define FRAME_SIZE 128
  13. #define CALLEE_REG_FRAME_SIZE 144
  14. #define REG_SZ 8
  15. #define ASM_ULONG_INSN .dword
  16. #else /* CONFIG_64BIT */
  17. #define RP_OFFSET 20
  18. #define FRAME_SIZE 64
  19. #define CALLEE_REG_FRAME_SIZE 128
  20. #define REG_SZ 4
  21. #define ASM_ULONG_INSN .word
  22. #endif
  23. /* Frame alignment for 32- and 64-bit */
  24. #define FRAME_ALIGN 64
  25. #define CALLEE_FLOAT_FRAME_SIZE 80
  26. #define CALLEE_SAVE_FRAME_SIZE (CALLEE_REG_FRAME_SIZE + CALLEE_FLOAT_FRAME_SIZE)
  27. #ifdef CONFIG_PA20
  28. #define LDCW ldcw,co
  29. #define BL b,l
  30. # ifdef CONFIG_64BIT
  31. # define PA_ASM_LEVEL 2.0w
  32. # else
  33. # define PA_ASM_LEVEL 2.0
  34. # endif
  35. #else
  36. #define LDCW ldcw
  37. #define BL bl
  38. #define PA_ASM_LEVEL 1.1
  39. #endif
  40. /* Privilege level field in the rightmost two bits of the IA queues */
  41. #define PRIV_USER 3
  42. #define PRIV_KERNEL 0
  43. /* Space register used inside kernel */
  44. #define SR_KERNEL 0
  45. #define SR_TEMP1 1
  46. #define SR_TEMP2 2
  47. #define SR_USER 3
  48. #ifdef __ASSEMBLER__
  49. #ifdef CONFIG_64BIT
  50. #define LDREG ldd
  51. #define STREG std
  52. #define LDREGX ldd,s
  53. #define LDREGM ldd,mb
  54. #define STREGM std,ma
  55. #define SHRREG shrd
  56. #define SHLREG shld
  57. #define ANDCM andcm,*
  58. #define COND(x) * ## x
  59. #else /* CONFIG_64BIT */
  60. #define LDREG ldw
  61. #define STREG stw
  62. #define LDREGX ldwx,s
  63. #define LDREGM ldwm
  64. #define STREGM stwm
  65. #define SHRREG shr
  66. #define SHLREG shlw
  67. #define ANDCM andcm
  68. #define COND(x) x
  69. #endif
  70. #ifdef CONFIG_64BIT
  71. /* the 64-bit pa gnu assembler unfortunately defaults to .level 1.1 or 2.0 so
  72. * work around that for now... */
  73. .level 2.0w
  74. #endif
  75. #include <asm/asm-offsets.h>
  76. #include <asm/page.h>
  77. #include <asm/types.h>
  78. #include <asm/asmregs.h>
  79. #include <asm/psw.h>
  80. /*
  81. * We provide two versions of each macro to convert from physical
  82. * to virtual and vice versa. The "_r1" versions take one argument
  83. * register, but trashes r1 to do the conversion. The other
  84. * version takes two arguments: a src and destination register.
  85. * However, the source and destination registers can not be
  86. * the same register.
  87. *
  88. * We use add,l to avoid clobbering the C/B bits in the PSW.
  89. */
  90. .macro tophys grvirt, grphys
  91. ldil L%(-__PAGE_OFFSET), \grphys
  92. addl \grvirt, \grphys, \grphys
  93. .endm
  94. .macro tovirt grphys, grvirt
  95. ldil L%(__PAGE_OFFSET), \grvirt
  96. addl \grphys, \grvirt, \grvirt
  97. .endm
  98. .macro tophys_r1 gr
  99. ldil L%(-__PAGE_OFFSET), %r1
  100. addl \gr, %r1, \gr
  101. .endm
  102. .macro tovirt_r1 gr
  103. ldil L%(__PAGE_OFFSET), %r1
  104. addl \gr, %r1, \gr
  105. .endm
  106. .macro delay value
  107. ldil L%\value, 1
  108. ldo R%\value(1), 1
  109. addib,UV,n -1,1,.
  110. addib,NUV,n -1,1,.+8
  111. nop
  112. .endm
  113. .macro debug value
  114. .endm
  115. .macro shlw r, sa, t
  116. zdep \r, 31-(\sa), 32-(\sa), \t
  117. .endm
  118. /* And the PA 2.0W shift left */
  119. .macro shld r, sa, t
  120. depd,z \r, 63-(\sa), 64-(\sa), \t
  121. .endm
  122. /* Shift Right for 32-bit. Clobbers upper 32-bit on PA2.0. */
  123. .macro shr r, sa, t
  124. extru \r, 31-(\sa), 32-(\sa), \t
  125. .endm
  126. /* pa20w version of shift right */
  127. .macro shrd r, sa, t
  128. extrd,u \r, 63-(\sa), 64-(\sa), \t
  129. .endm
  130. /* Extract unsigned for 32- and 64-bit
  131. * The extru instruction leaves the most significant 32 bits of the
  132. * target register in an undefined state on PA 2.0 systems. */
  133. .macro extru_safe r, p, len, t
  134. #ifdef CONFIG_64BIT
  135. extrd,u \r, 32+(\p), \len, \t
  136. #else
  137. extru \r, \p, \len, \t
  138. #endif
  139. .endm
  140. /* The depi instruction leaves the most significant 32 bits of the
  141. * target register in an undefined state on PA 2.0 systems. */
  142. .macro depi_safe i, p, len, t
  143. #ifdef CONFIG_64BIT
  144. depdi \i, 32+(\p), \len, \t
  145. #else
  146. depi \i, \p, \len, \t
  147. #endif
  148. .endm
  149. /* The depw instruction leaves the most significant 32 bits of the
  150. * target register in an undefined state on PA 2.0 systems. */
  151. .macro dep_safe i, p, len, t
  152. #ifdef CONFIG_64BIT
  153. depd \i, 32+(\p), \len, \t
  154. #else
  155. depw \i, \p, \len, \t
  156. #endif
  157. .endm
  158. /* load 32-bit 'value' into 'reg' compensating for the ldil
  159. * sign-extension when running in wide mode.
  160. * WARNING!! neither 'value' nor 'reg' can be expressions
  161. * containing '.'!!!! */
  162. .macro load32 value, reg
  163. ldil L%\value, \reg
  164. ldo R%\value(\reg), \reg
  165. .endm
  166. .macro loadgp
  167. #ifdef CONFIG_64BIT
  168. ldil L%__gp, %r27
  169. ldo R%__gp(%r27), %r27
  170. #else
  171. ldil L%$global$, %r27
  172. ldo R%$global$(%r27), %r27
  173. #endif
  174. .endm
  175. #define SAVE_SP(r, where) mfsp r, %r1 ! STREG %r1, where
  176. #define REST_SP(r, where) LDREG where, %r1 ! mtsp %r1, r
  177. #define SAVE_CR(r, where) mfctl r, %r1 ! STREG %r1, where
  178. #define REST_CR(r, where) LDREG where, %r1 ! mtctl %r1, r
  179. .macro save_general regs
  180. STREG %r1, PT_GR1 (\regs)
  181. STREG %r2, PT_GR2 (\regs)
  182. STREG %r3, PT_GR3 (\regs)
  183. STREG %r4, PT_GR4 (\regs)
  184. STREG %r5, PT_GR5 (\regs)
  185. STREG %r6, PT_GR6 (\regs)
  186. STREG %r7, PT_GR7 (\regs)
  187. STREG %r8, PT_GR8 (\regs)
  188. STREG %r9, PT_GR9 (\regs)
  189. STREG %r10, PT_GR10(\regs)
  190. STREG %r11, PT_GR11(\regs)
  191. STREG %r12, PT_GR12(\regs)
  192. STREG %r13, PT_GR13(\regs)
  193. STREG %r14, PT_GR14(\regs)
  194. STREG %r15, PT_GR15(\regs)
  195. STREG %r16, PT_GR16(\regs)
  196. STREG %r17, PT_GR17(\regs)
  197. STREG %r18, PT_GR18(\regs)
  198. STREG %r19, PT_GR19(\regs)
  199. STREG %r20, PT_GR20(\regs)
  200. STREG %r21, PT_GR21(\regs)
  201. STREG %r22, PT_GR22(\regs)
  202. STREG %r23, PT_GR23(\regs)
  203. STREG %r24, PT_GR24(\regs)
  204. STREG %r25, PT_GR25(\regs)
  205. /* r26 is saved in get_stack and used to preserve a value across virt_map */
  206. STREG %r27, PT_GR27(\regs)
  207. STREG %r28, PT_GR28(\regs)
  208. /* r29 is saved in get_stack and used to point to saved registers */
  209. /* r30 stack pointer saved in get_stack */
  210. STREG %r31, PT_GR31(\regs)
  211. .endm
  212. .macro rest_general regs
  213. /* r1 used as a temp in rest_stack and is restored there */
  214. LDREG PT_GR2 (\regs), %r2
  215. LDREG PT_GR3 (\regs), %r3
  216. LDREG PT_GR4 (\regs), %r4
  217. LDREG PT_GR5 (\regs), %r5
  218. LDREG PT_GR6 (\regs), %r6
  219. LDREG PT_GR7 (\regs), %r7
  220. LDREG PT_GR8 (\regs), %r8
  221. LDREG PT_GR9 (\regs), %r9
  222. LDREG PT_GR10(\regs), %r10
  223. LDREG PT_GR11(\regs), %r11
  224. LDREG PT_GR12(\regs), %r12
  225. LDREG PT_GR13(\regs), %r13
  226. LDREG PT_GR14(\regs), %r14
  227. LDREG PT_GR15(\regs), %r15
  228. LDREG PT_GR16(\regs), %r16
  229. LDREG PT_GR17(\regs), %r17
  230. LDREG PT_GR18(\regs), %r18
  231. LDREG PT_GR19(\regs), %r19
  232. LDREG PT_GR20(\regs), %r20
  233. LDREG PT_GR21(\regs), %r21
  234. LDREG PT_GR22(\regs), %r22
  235. LDREG PT_GR23(\regs), %r23
  236. LDREG PT_GR24(\regs), %r24
  237. LDREG PT_GR25(\regs), %r25
  238. LDREG PT_GR26(\regs), %r26
  239. LDREG PT_GR27(\regs), %r27
  240. LDREG PT_GR28(\regs), %r28
  241. /* r29 points to register save area, and is restored in rest_stack */
  242. /* r30 stack pointer restored in rest_stack */
  243. LDREG PT_GR31(\regs), %r31
  244. .endm
  245. .macro save_fp regs
  246. fstd,ma %fr0, 8(\regs)
  247. fstd,ma %fr1, 8(\regs)
  248. fstd,ma %fr2, 8(\regs)
  249. fstd,ma %fr3, 8(\regs)
  250. fstd,ma %fr4, 8(\regs)
  251. fstd,ma %fr5, 8(\regs)
  252. fstd,ma %fr6, 8(\regs)
  253. fstd,ma %fr7, 8(\regs)
  254. fstd,ma %fr8, 8(\regs)
  255. fstd,ma %fr9, 8(\regs)
  256. fstd,ma %fr10, 8(\regs)
  257. fstd,ma %fr11, 8(\regs)
  258. fstd,ma %fr12, 8(\regs)
  259. fstd,ma %fr13, 8(\regs)
  260. fstd,ma %fr14, 8(\regs)
  261. fstd,ma %fr15, 8(\regs)
  262. fstd,ma %fr16, 8(\regs)
  263. fstd,ma %fr17, 8(\regs)
  264. fstd,ma %fr18, 8(\regs)
  265. fstd,ma %fr19, 8(\regs)
  266. fstd,ma %fr20, 8(\regs)
  267. fstd,ma %fr21, 8(\regs)
  268. fstd,ma %fr22, 8(\regs)
  269. fstd,ma %fr23, 8(\regs)
  270. fstd,ma %fr24, 8(\regs)
  271. fstd,ma %fr25, 8(\regs)
  272. fstd,ma %fr26, 8(\regs)
  273. fstd,ma %fr27, 8(\regs)
  274. fstd,ma %fr28, 8(\regs)
  275. fstd,ma %fr29, 8(\regs)
  276. fstd,ma %fr30, 8(\regs)
  277. fstd %fr31, 0(\regs)
  278. .endm
  279. .macro rest_fp regs
  280. fldd 0(\regs), %fr31
  281. fldd,mb -8(\regs), %fr30
  282. fldd,mb -8(\regs), %fr29
  283. fldd,mb -8(\regs), %fr28
  284. fldd,mb -8(\regs), %fr27
  285. fldd,mb -8(\regs), %fr26
  286. fldd,mb -8(\regs), %fr25
  287. fldd,mb -8(\regs), %fr24
  288. fldd,mb -8(\regs), %fr23
  289. fldd,mb -8(\regs), %fr22
  290. fldd,mb -8(\regs), %fr21
  291. fldd,mb -8(\regs), %fr20
  292. fldd,mb -8(\regs), %fr19
  293. fldd,mb -8(\regs), %fr18
  294. fldd,mb -8(\regs), %fr17
  295. fldd,mb -8(\regs), %fr16
  296. fldd,mb -8(\regs), %fr15
  297. fldd,mb -8(\regs), %fr14
  298. fldd,mb -8(\regs), %fr13
  299. fldd,mb -8(\regs), %fr12
  300. fldd,mb -8(\regs), %fr11
  301. fldd,mb -8(\regs), %fr10
  302. fldd,mb -8(\regs), %fr9
  303. fldd,mb -8(\regs), %fr8
  304. fldd,mb -8(\regs), %fr7
  305. fldd,mb -8(\regs), %fr6
  306. fldd,mb -8(\regs), %fr5
  307. fldd,mb -8(\regs), %fr4
  308. fldd,mb -8(\regs), %fr3
  309. fldd,mb -8(\regs), %fr2
  310. fldd,mb -8(\regs), %fr1
  311. fldd,mb -8(\regs), %fr0
  312. .endm
  313. .macro callee_save_float
  314. fstd,ma %fr12, 8(%r30)
  315. fstd,ma %fr13, 8(%r30)
  316. fstd,ma %fr14, 8(%r30)
  317. fstd,ma %fr15, 8(%r30)
  318. fstd,ma %fr16, 8(%r30)
  319. fstd,ma %fr17, 8(%r30)
  320. fstd,ma %fr18, 8(%r30)
  321. fstd,ma %fr19, 8(%r30)
  322. fstd,ma %fr20, 8(%r30)
  323. fstd,ma %fr21, 8(%r30)
  324. .endm
  325. .macro callee_rest_float
  326. fldd,mb -8(%r30), %fr21
  327. fldd,mb -8(%r30), %fr20
  328. fldd,mb -8(%r30), %fr19
  329. fldd,mb -8(%r30), %fr18
  330. fldd,mb -8(%r30), %fr17
  331. fldd,mb -8(%r30), %fr16
  332. fldd,mb -8(%r30), %fr15
  333. fldd,mb -8(%r30), %fr14
  334. fldd,mb -8(%r30), %fr13
  335. fldd,mb -8(%r30), %fr12
  336. .endm
  337. #ifdef CONFIG_64BIT
  338. .macro callee_save
  339. std,ma %r3, CALLEE_REG_FRAME_SIZE(%r30)
  340. mfctl %cr27, %r3
  341. std %r4, -136(%r30)
  342. std %r5, -128(%r30)
  343. std %r6, -120(%r30)
  344. std %r7, -112(%r30)
  345. std %r8, -104(%r30)
  346. std %r9, -96(%r30)
  347. std %r10, -88(%r30)
  348. std %r11, -80(%r30)
  349. std %r12, -72(%r30)
  350. std %r13, -64(%r30)
  351. std %r14, -56(%r30)
  352. std %r15, -48(%r30)
  353. std %r16, -40(%r30)
  354. std %r17, -32(%r30)
  355. std %r18, -24(%r30)
  356. std %r3, -16(%r30)
  357. .endm
  358. .macro callee_rest
  359. ldd -16(%r30), %r3
  360. ldd -24(%r30), %r18
  361. ldd -32(%r30), %r17
  362. ldd -40(%r30), %r16
  363. ldd -48(%r30), %r15
  364. ldd -56(%r30), %r14
  365. ldd -64(%r30), %r13
  366. ldd -72(%r30), %r12
  367. ldd -80(%r30), %r11
  368. ldd -88(%r30), %r10
  369. ldd -96(%r30), %r9
  370. ldd -104(%r30), %r8
  371. ldd -112(%r30), %r7
  372. ldd -120(%r30), %r6
  373. ldd -128(%r30), %r5
  374. ldd -136(%r30), %r4
  375. mtctl %r3, %cr27
  376. ldd,mb -CALLEE_REG_FRAME_SIZE(%r30), %r3
  377. .endm
  378. #else /* ! CONFIG_64BIT */
  379. .macro callee_save
  380. stw,ma %r3, CALLEE_REG_FRAME_SIZE(%r30)
  381. mfctl %cr27, %r3
  382. stw %r4, -124(%r30)
  383. stw %r5, -120(%r30)
  384. stw %r6, -116(%r30)
  385. stw %r7, -112(%r30)
  386. stw %r8, -108(%r30)
  387. stw %r9, -104(%r30)
  388. stw %r10, -100(%r30)
  389. stw %r11, -96(%r30)
  390. stw %r12, -92(%r30)
  391. stw %r13, -88(%r30)
  392. stw %r14, -84(%r30)
  393. stw %r15, -80(%r30)
  394. stw %r16, -76(%r30)
  395. stw %r17, -72(%r30)
  396. stw %r18, -68(%r30)
  397. stw %r3, -64(%r30)
  398. .endm
  399. .macro callee_rest
  400. ldw -64(%r30), %r3
  401. ldw -68(%r30), %r18
  402. ldw -72(%r30), %r17
  403. ldw -76(%r30), %r16
  404. ldw -80(%r30), %r15
  405. ldw -84(%r30), %r14
  406. ldw -88(%r30), %r13
  407. ldw -92(%r30), %r12
  408. ldw -96(%r30), %r11
  409. ldw -100(%r30), %r10
  410. ldw -104(%r30), %r9
  411. ldw -108(%r30), %r8
  412. ldw -112(%r30), %r7
  413. ldw -116(%r30), %r6
  414. ldw -120(%r30), %r5
  415. ldw -124(%r30), %r4
  416. mtctl %r3, %cr27
  417. ldw,mb -CALLEE_REG_FRAME_SIZE(%r30), %r3
  418. .endm
  419. #endif /* ! CONFIG_64BIT */
  420. .macro save_specials regs
  421. SAVE_SP (%sr0, PT_SR0 (\regs))
  422. SAVE_SP (%sr1, PT_SR1 (\regs))
  423. SAVE_SP (%sr2, PT_SR2 (\regs))
  424. SAVE_SP (%sr3, PT_SR3 (\regs))
  425. SAVE_SP (%sr4, PT_SR4 (\regs))
  426. SAVE_SP (%sr5, PT_SR5 (\regs))
  427. SAVE_SP (%sr6, PT_SR6 (\regs))
  428. SAVE_CR (%cr17, PT_IASQ0(\regs))
  429. mtctl %r0, %cr17
  430. SAVE_CR (%cr17, PT_IASQ1(\regs))
  431. SAVE_CR (%cr18, PT_IAOQ0(\regs))
  432. mtctl %r0, %cr18
  433. SAVE_CR (%cr18, PT_IAOQ1(\regs))
  434. #ifdef CONFIG_64BIT
  435. /* cr11 (sar) is a funny one. 5 bits on PA1.1 and 6 bit on PA2.0
  436. * For PA2.0 mtsar or mtctl always write 6 bits, but mfctl only
  437. * reads 5 bits. Use mfctl,w to read all six bits. Otherwise
  438. * we lose the 6th bit on a save/restore over interrupt.
  439. */
  440. mfctl,w %cr11, %r1
  441. STREG %r1, PT_SAR (\regs)
  442. #else
  443. SAVE_CR (%cr11, PT_SAR (\regs))
  444. #endif
  445. SAVE_CR (%cr19, PT_IIR (\regs))
  446. /*
  447. * Code immediately following this macro (in intr_save) relies
  448. * on r8 containing ipsw.
  449. */
  450. mfctl %cr22, %r8
  451. STREG %r8, PT_PSW(\regs)
  452. .endm
  453. .macro rest_specials regs
  454. REST_SP (%sr0, PT_SR0 (\regs))
  455. REST_SP (%sr1, PT_SR1 (\regs))
  456. REST_SP (%sr2, PT_SR2 (\regs))
  457. REST_SP (%sr3, PT_SR3 (\regs))
  458. REST_SP (%sr4, PT_SR4 (\regs))
  459. REST_SP (%sr5, PT_SR5 (\regs))
  460. REST_SP (%sr6, PT_SR6 (\regs))
  461. REST_SP (%sr7, PT_SR7 (\regs))
  462. REST_CR (%cr17, PT_IASQ0(\regs))
  463. REST_CR (%cr17, PT_IASQ1(\regs))
  464. REST_CR (%cr18, PT_IAOQ0(\regs))
  465. REST_CR (%cr18, PT_IAOQ1(\regs))
  466. REST_CR (%cr11, PT_SAR (\regs))
  467. REST_CR (%cr22, PT_PSW (\regs))
  468. .endm
  469. /* First step to create a "relied upon translation"
  470. * See PA 2.0 Arch. page F-4 and F-5.
  471. *
  472. * The ssm was originally necessary due to a "PCxT bug".
  473. * But someone decided it needed to be added to the architecture
  474. * and this "feature" went into rev3 of PA-RISC 1.1 Arch Manual.
  475. * It's been carried forward into PA 2.0 Arch as well. :^(
  476. *
  477. * "ssm 0,%r0" is a NOP with side effects (prefetch barrier).
  478. * rsm/ssm prevents the ifetch unit from speculatively fetching
  479. * instructions past this line in the code stream.
  480. * PA 2.0 processor will single step all insn in the same QUAD (4 insn).
  481. */
  482. .macro pcxt_ssm_bug
  483. rsm PSW_SM_I,%r0
  484. nop /* 1 */
  485. nop /* 2 */
  486. nop /* 3 */
  487. nop /* 4 */
  488. nop /* 5 */
  489. nop /* 6 */
  490. nop /* 7 */
  491. .endm
  492. /* Switch to virtual mapping, trashing only %r1 */
  493. .macro virt_map
  494. /* pcxt_ssm_bug */
  495. rsm PSW_SM_I, %r0 /* barrier for "Relied upon Translation */
  496. mtsp %r0, %sr4
  497. mtsp %r0, %sr5
  498. mtsp %r0, %sr6
  499. tovirt_r1 %r29
  500. load32 KERNEL_PSW, %r1
  501. rsm PSW_SM_QUIET,%r0 /* second "heavy weight" ctl op */
  502. mtctl %r0, %cr17 /* Clear IIASQ tail */
  503. mtctl %r0, %cr17 /* Clear IIASQ head */
  504. mtctl %r1, %ipsw
  505. load32 4f, %r1
  506. mtctl %r1, %cr18 /* Set IIAOQ tail */
  507. ldo 4(%r1), %r1
  508. mtctl %r1, %cr18 /* Set IIAOQ head */
  509. rfir
  510. nop
  511. 4:
  512. .endm
  513. /*
  514. * ASM_EXCEPTIONTABLE_ENTRY
  515. *
  516. * Creates an exception table entry.
  517. * Do not convert to a assembler macro. This won't work.
  518. */
  519. #define ASM_EXCEPTIONTABLE_ENTRY(fault_addr, except_addr) \
  520. .section __ex_table,"aw" ! \
  521. .align 4 ! \
  522. .word (fault_addr - .), (except_addr - .) ! \
  523. or %r0,%r0,%r0 ! \
  524. .previous
  525. #endif /* __ASSEMBLER__ */
  526. #endif