entry-armv.S 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221
  1. /*
  2. * linux/arch/arm/kernel/entry-armv.S
  3. *
  4. * Copyright (C) 1996,1997,1998 Russell King.
  5. * ARM700 fix by Matthew Godbolt (linux-user@willothewisp.demon.co.uk)
  6. * nommu support by Hyok S. Choi (hyok.choi@samsung.com)
  7. *
  8. * This program is free software; you can redistribute it and/or modify
  9. * it under the terms of the GNU General Public License version 2 as
  10. * published by the Free Software Foundation.
  11. *
  12. * Low-level vector interface routines
  13. *
  14. * Note: there is a StrongARM bug in the STMIA rn, {regs}^ instruction
  15. * that causes it to save wrong values... Be aware!
  16. */
  17. #include <linux/init.h>
  18. #include <asm/assembler.h>
  19. #include <asm/memory.h>
  20. #include <asm/glue-df.h>
  21. #include <asm/glue-pf.h>
  22. #include <asm/vfpmacros.h>
  23. #ifndef CONFIG_GENERIC_IRQ_MULTI_HANDLER
  24. #include <mach/entry-macro.S>
  25. #endif
  26. #include <asm/thread_notify.h>
  27. #include <asm/unwind.h>
  28. #include <asm/unistd.h>
  29. #include <asm/tls.h>
  30. #include <asm/system_info.h>
  31. #include <asm/uaccess-asm.h>
  32. #include "entry-header.S"
  33. #include <asm/entry-macro-multi.S>
  34. #include <asm/probes.h>
  35. /*
  36. * Interrupt handling.
  37. */
  38. .macro irq_handler
  39. #ifdef CONFIG_GENERIC_IRQ_MULTI_HANDLER
  40. ldr r1, =handle_arch_irq
  41. mov r0, sp
  42. badr lr, 9997f
  43. ldr pc, [r1]
  44. #else
  45. arch_irq_handler_default
  46. #endif
  47. 9997:
  48. .endm
  49. .macro pabt_helper
  50. @ PABORT handler takes pt_regs in r2, fault address in r4 and psr in r5
  51. #ifdef MULTI_PABORT
  52. ldr ip, .LCprocfns
  53. mov lr, pc
  54. ldr pc, [ip, #PROCESSOR_PABT_FUNC]
  55. #else
  56. bl CPU_PABORT_HANDLER
  57. #endif
  58. .endm
  59. .macro dabt_helper
  60. @
  61. @ Call the processor-specific abort handler:
  62. @
  63. @ r2 - pt_regs
  64. @ r4 - aborted context pc
  65. @ r5 - aborted context psr
  66. @
  67. @ The abort handler must return the aborted address in r0, and
  68. @ the fault status register in r1. r9 must be preserved.
  69. @
  70. #ifdef MULTI_DABORT
  71. ldr ip, .LCprocfns
  72. mov lr, pc
  73. ldr pc, [ip, #PROCESSOR_DABT_FUNC]
  74. #else
  75. bl CPU_DABORT_HANDLER
  76. #endif
  77. .endm
  78. .section .entry.text,"ax",%progbits
  79. /*
  80. * Invalid mode handlers
  81. */
  82. .macro inv_entry, reason
  83. sub sp, sp, #PT_REGS_SIZE
  84. ARM( stmib sp, {r1 - lr} )
  85. THUMB( stmia sp, {r0 - r12} )
  86. THUMB( str sp, [sp, #S_SP] )
  87. THUMB( str lr, [sp, #S_LR] )
  88. mov r1, #\reason
  89. .endm
  90. __pabt_invalid:
  91. inv_entry BAD_PREFETCH
  92. b common_invalid
  93. ENDPROC(__pabt_invalid)
  94. __dabt_invalid:
  95. inv_entry BAD_DATA
  96. b common_invalid
  97. ENDPROC(__dabt_invalid)
  98. __irq_invalid:
  99. inv_entry BAD_IRQ
  100. b common_invalid
  101. ENDPROC(__irq_invalid)
  102. __und_invalid:
  103. inv_entry BAD_UNDEFINSTR
  104. @
  105. @ XXX fall through to common_invalid
  106. @
  107. @
  108. @ common_invalid - generic code for failed exception (re-entrant version of handlers)
  109. @
  110. common_invalid:
  111. zero_fp
  112. ldmia r0, {r4 - r6}
  113. add r0, sp, #S_PC @ here for interlock avoidance
  114. mov r7, #-1 @ "" "" "" ""
  115. str r4, [sp] @ save preserved r0
  116. stmia r0, {r5 - r7} @ lr_<exception>,
  117. @ cpsr_<exception>, "old_r0"
  118. mov r0, sp
  119. b bad_mode
  120. ENDPROC(__und_invalid)
  121. /*
  122. * SVC mode handlers
  123. */
  124. #if defined(CONFIG_AEABI) && (__LINUX_ARM_ARCH__ >= 5)
  125. #define SPFIX(code...) code
  126. #else
  127. #define SPFIX(code...)
  128. #endif
  129. .macro svc_entry, stack_hole=0, trace=1, uaccess=1
  130. UNWIND(.fnstart )
  131. UNWIND(.save {r0 - pc} )
  132. sub sp, sp, #(SVC_REGS_SIZE + \stack_hole - 4)
  133. #ifdef CONFIG_THUMB2_KERNEL
  134. SPFIX( str r0, [sp] ) @ temporarily saved
  135. SPFIX( mov r0, sp )
  136. SPFIX( tst r0, #4 ) @ test original stack alignment
  137. SPFIX( ldr r0, [sp] ) @ restored
  138. #else
  139. SPFIX( tst sp, #4 )
  140. #endif
  141. SPFIX( subeq sp, sp, #4 )
  142. stmia sp, {r1 - r12}
  143. ldmia r0, {r3 - r5}
  144. add r7, sp, #S_SP - 4 @ here for interlock avoidance
  145. mov r6, #-1 @ "" "" "" ""
  146. add r2, sp, #(SVC_REGS_SIZE + \stack_hole - 4)
  147. SPFIX( addeq r2, r2, #4 )
  148. str r3, [sp, #-4]! @ save the "real" r0 copied
  149. @ from the exception stack
  150. mov r3, lr
  151. @
  152. @ We are now ready to fill in the remaining blanks on the stack:
  153. @
  154. @ r2 - sp_svc
  155. @ r3 - lr_svc
  156. @ r4 - lr_<exception>, already fixed up for correct return/restart
  157. @ r5 - spsr_<exception>
  158. @ r6 - orig_r0 (see pt_regs definition in ptrace.h)
  159. @
  160. stmia r7, {r2 - r6}
  161. get_thread_info tsk
  162. uaccess_entry tsk, r0, r1, r2, \uaccess
  163. .if \trace
  164. #ifdef CONFIG_TRACE_IRQFLAGS
  165. bl trace_hardirqs_off
  166. #endif
  167. .endif
  168. .endm
  169. .align 5
  170. __dabt_svc:
  171. svc_entry uaccess=0
  172. mov r2, sp
  173. dabt_helper
  174. THUMB( ldr r5, [sp, #S_PSR] ) @ potentially updated CPSR
  175. svc_exit r5 @ return from exception
  176. UNWIND(.fnend )
  177. ENDPROC(__dabt_svc)
  178. .align 5
  179. __irq_svc:
  180. svc_entry
  181. irq_handler
  182. #ifdef CONFIG_PREEMPT
  183. ldr r8, [tsk, #TI_PREEMPT] @ get preempt count
  184. ldr r0, [tsk, #TI_FLAGS] @ get flags
  185. teq r8, #0 @ if preempt count != 0
  186. movne r0, #0 @ force flags to 0
  187. tst r0, #_TIF_NEED_RESCHED
  188. blne svc_preempt
  189. #endif
  190. svc_exit r5, irq = 1 @ return from exception
  191. UNWIND(.fnend )
  192. ENDPROC(__irq_svc)
  193. .ltorg
  194. #ifdef CONFIG_PREEMPT
  195. svc_preempt:
  196. mov r8, lr
  197. 1: bl preempt_schedule_irq @ irq en/disable is done inside
  198. ldr r0, [tsk, #TI_FLAGS] @ get new tasks TI_FLAGS
  199. tst r0, #_TIF_NEED_RESCHED
  200. reteq r8 @ go again
  201. b 1b
  202. #endif
  203. __und_fault:
  204. @ Correct the PC such that it is pointing at the instruction
  205. @ which caused the fault. If the faulting instruction was ARM
  206. @ the PC will be pointing at the next instruction, and have to
  207. @ subtract 4. Otherwise, it is Thumb, and the PC will be
  208. @ pointing at the second half of the Thumb instruction. We
  209. @ have to subtract 2.
  210. ldr r2, [r0, #S_PC]
  211. sub r2, r2, r1
  212. str r2, [r0, #S_PC]
  213. b do_undefinstr
  214. ENDPROC(__und_fault)
  215. .align 5
  216. __und_svc:
  217. #ifdef CONFIG_KPROBES
  218. @ If a kprobe is about to simulate a "stmdb sp..." instruction,
  219. @ it obviously needs free stack space which then will belong to
  220. @ the saved context.
  221. svc_entry MAX_STACK_SIZE
  222. #else
  223. svc_entry
  224. #endif
  225. @
  226. @ call emulation code, which returns using r9 if it has emulated
  227. @ the instruction, or the more conventional lr if we are to treat
  228. @ this as a real undefined instruction
  229. @
  230. @ r0 - instruction
  231. @
  232. #ifndef CONFIG_THUMB2_KERNEL
  233. ldr r0, [r4, #-4]
  234. #else
  235. mov r1, #2
  236. ldrh r0, [r4, #-2] @ Thumb instruction at LR - 2
  237. cmp r0, #0xe800 @ 32-bit instruction if xx >= 0
  238. blo __und_svc_fault
  239. ldrh r9, [r4] @ bottom 16 bits
  240. add r4, r4, #2
  241. str r4, [sp, #S_PC]
  242. orr r0, r9, r0, lsl #16
  243. #endif
  244. badr r9, __und_svc_finish
  245. mov r2, r4
  246. bl call_fpe
  247. mov r1, #4 @ PC correction to apply
  248. __und_svc_fault:
  249. mov r0, sp @ struct pt_regs *regs
  250. bl __und_fault
  251. __und_svc_finish:
  252. get_thread_info tsk
  253. ldr r5, [sp, #S_PSR] @ Get SVC cpsr
  254. svc_exit r5 @ return from exception
  255. UNWIND(.fnend )
  256. ENDPROC(__und_svc)
  257. .align 5
  258. __pabt_svc:
  259. svc_entry
  260. mov r2, sp @ regs
  261. pabt_helper
  262. svc_exit r5 @ return from exception
  263. UNWIND(.fnend )
  264. ENDPROC(__pabt_svc)
  265. .align 5
  266. __fiq_svc:
  267. svc_entry trace=0
  268. mov r0, sp @ struct pt_regs *regs
  269. bl handle_fiq_as_nmi
  270. svc_exit_via_fiq
  271. UNWIND(.fnend )
  272. ENDPROC(__fiq_svc)
  273. .align 5
  274. .LCcralign:
  275. .word cr_alignment
  276. #ifdef MULTI_DABORT
  277. .LCprocfns:
  278. .word processor
  279. #endif
  280. .LCfp:
  281. .word fp_enter
  282. /*
  283. * Abort mode handlers
  284. */
  285. @
  286. @ Taking a FIQ in abort mode is similar to taking a FIQ in SVC mode
  287. @ and reuses the same macros. However in abort mode we must also
  288. @ save/restore lr_abt and spsr_abt to make nested aborts safe.
  289. @
  290. .align 5
  291. __fiq_abt:
  292. svc_entry trace=0
  293. ARM( msr cpsr_c, #ABT_MODE | PSR_I_BIT | PSR_F_BIT )
  294. THUMB( mov r0, #ABT_MODE | PSR_I_BIT | PSR_F_BIT )
  295. THUMB( msr cpsr_c, r0 )
  296. mov r1, lr @ Save lr_abt
  297. mrs r2, spsr @ Save spsr_abt, abort is now safe
  298. ARM( msr cpsr_c, #SVC_MODE | PSR_I_BIT | PSR_F_BIT )
  299. THUMB( mov r0, #SVC_MODE | PSR_I_BIT | PSR_F_BIT )
  300. THUMB( msr cpsr_c, r0 )
  301. stmfd sp!, {r1 - r2}
  302. add r0, sp, #8 @ struct pt_regs *regs
  303. bl handle_fiq_as_nmi
  304. ldmfd sp!, {r1 - r2}
  305. ARM( msr cpsr_c, #ABT_MODE | PSR_I_BIT | PSR_F_BIT )
  306. THUMB( mov r0, #ABT_MODE | PSR_I_BIT | PSR_F_BIT )
  307. THUMB( msr cpsr_c, r0 )
  308. mov lr, r1 @ Restore lr_abt, abort is unsafe
  309. msr spsr_cxsf, r2 @ Restore spsr_abt
  310. ARM( msr cpsr_c, #SVC_MODE | PSR_I_BIT | PSR_F_BIT )
  311. THUMB( mov r0, #SVC_MODE | PSR_I_BIT | PSR_F_BIT )
  312. THUMB( msr cpsr_c, r0 )
  313. svc_exit_via_fiq
  314. UNWIND(.fnend )
  315. ENDPROC(__fiq_abt)
  316. /*
  317. * User mode handlers
  318. *
  319. * EABI note: sp_svc is always 64-bit aligned here, so should PT_REGS_SIZE
  320. */
  321. #if defined(CONFIG_AEABI) && (__LINUX_ARM_ARCH__ >= 5) && (PT_REGS_SIZE & 7)
  322. #error "sizeof(struct pt_regs) must be a multiple of 8"
  323. #endif
  324. .macro usr_entry, trace=1, uaccess=1
  325. UNWIND(.fnstart )
  326. UNWIND(.cantunwind ) @ don't unwind the user space
  327. sub sp, sp, #PT_REGS_SIZE
  328. ARM( stmib sp, {r1 - r12} )
  329. THUMB( stmia sp, {r0 - r12} )
  330. ATRAP( mrc p15, 0, r7, c1, c0, 0)
  331. ATRAP( ldr r8, .LCcralign)
  332. ldmia r0, {r3 - r5}
  333. add r0, sp, #S_PC @ here for interlock avoidance
  334. mov r6, #-1 @ "" "" "" ""
  335. str r3, [sp] @ save the "real" r0 copied
  336. @ from the exception stack
  337. ATRAP( ldr r8, [r8, #0])
  338. @
  339. @ We are now ready to fill in the remaining blanks on the stack:
  340. @
  341. @ r4 - lr_<exception>, already fixed up for correct return/restart
  342. @ r5 - spsr_<exception>
  343. @ r6 - orig_r0 (see pt_regs definition in ptrace.h)
  344. @
  345. @ Also, separately save sp_usr and lr_usr
  346. @
  347. stmia r0, {r4 - r6}
  348. ARM( stmdb r0, {sp, lr}^ )
  349. THUMB( store_user_sp_lr r0, r1, S_SP - S_PC )
  350. .if \uaccess
  351. uaccess_disable ip
  352. .endif
  353. @ Enable the alignment trap while in kernel mode
  354. ATRAP( teq r8, r7)
  355. ATRAP( mcrne p15, 0, r8, c1, c0, 0)
  356. @
  357. @ Clear FP to mark the first stack frame
  358. @
  359. zero_fp
  360. .if \trace
  361. #ifdef CONFIG_TRACE_IRQFLAGS
  362. bl trace_hardirqs_off
  363. #endif
  364. ct_user_exit save = 0
  365. .endif
  366. .endm
  367. .macro kuser_cmpxchg_check
  368. #if !defined(CONFIG_CPU_32v6K) && defined(CONFIG_KUSER_HELPERS)
  369. #ifndef CONFIG_MMU
  370. #warning "NPTL on non MMU needs fixing"
  371. #else
  372. @ Make sure our user space atomic helper is restarted
  373. @ if it was interrupted in a critical region. Here we
  374. @ perform a quick test inline since it should be false
  375. @ 99.9999% of the time. The rest is done out of line.
  376. cmp r4, #TASK_SIZE
  377. blhs kuser_cmpxchg64_fixup
  378. #endif
  379. #endif
  380. .endm
  381. .align 5
  382. __dabt_usr:
  383. usr_entry uaccess=0
  384. kuser_cmpxchg_check
  385. mov r2, sp
  386. dabt_helper
  387. b ret_from_exception
  388. UNWIND(.fnend )
  389. ENDPROC(__dabt_usr)
  390. .align 5
  391. __irq_usr:
  392. usr_entry
  393. kuser_cmpxchg_check
  394. irq_handler
  395. get_thread_info tsk
  396. mov why, #0
  397. b ret_to_user_from_irq
  398. UNWIND(.fnend )
  399. ENDPROC(__irq_usr)
  400. .ltorg
  401. .align 5
  402. __und_usr:
  403. usr_entry uaccess=0
  404. mov r2, r4
  405. mov r3, r5
  406. @ r2 = regs->ARM_pc, which is either 2 or 4 bytes ahead of the
  407. @ faulting instruction depending on Thumb mode.
  408. @ r3 = regs->ARM_cpsr
  409. @
  410. @ The emulation code returns using r9 if it has emulated the
  411. @ instruction, or the more conventional lr if we are to treat
  412. @ this as a real undefined instruction
  413. @
  414. badr r9, ret_from_exception
  415. @ IRQs must be enabled before attempting to read the instruction from
  416. @ user space since that could cause a page/translation fault if the
  417. @ page table was modified by another CPU.
  418. enable_irq
  419. tst r3, #PSR_T_BIT @ Thumb mode?
  420. bne __und_usr_thumb
  421. sub r4, r2, #4 @ ARM instr at LR - 4
  422. 1: ldrt r0, [r4]
  423. ARM_BE8(rev r0, r0) @ little endian instruction
  424. uaccess_disable ip
  425. @ r0 = 32-bit ARM instruction which caused the exception
  426. @ r2 = PC value for the following instruction (:= regs->ARM_pc)
  427. @ r4 = PC value for the faulting instruction
  428. @ lr = 32-bit undefined instruction function
  429. badr lr, __und_usr_fault_32
  430. b call_fpe
  431. __und_usr_thumb:
  432. @ Thumb instruction
  433. sub r4, r2, #2 @ First half of thumb instr at LR - 2
  434. #if CONFIG_ARM_THUMB && __LINUX_ARM_ARCH__ >= 6 && CONFIG_CPU_V7
  435. /*
  436. * Thumb-2 instruction handling. Note that because pre-v6 and >= v6 platforms
  437. * can never be supported in a single kernel, this code is not applicable at
  438. * all when __LINUX_ARM_ARCH__ < 6. This allows simplifying assumptions to be
  439. * made about .arch directives.
  440. */
  441. #if __LINUX_ARM_ARCH__ < 7
  442. /* If the target CPU may not be Thumb-2-capable, a run-time check is needed: */
  443. #define NEED_CPU_ARCHITECTURE
  444. ldr r5, .LCcpu_architecture
  445. ldr r5, [r5]
  446. cmp r5, #CPU_ARCH_ARMv7
  447. blo __und_usr_fault_16 @ 16bit undefined instruction
  448. /*
  449. * The following code won't get run unless the running CPU really is v7, so
  450. * coding round the lack of ldrht on older arches is pointless. Temporarily
  451. * override the assembler target arch with the minimum required instead:
  452. */
  453. .arch armv6t2
  454. #endif
  455. 2: ldrht r5, [r4]
  456. ARM_BE8(rev16 r5, r5) @ little endian instruction
  457. cmp r5, #0xe800 @ 32bit instruction if xx != 0
  458. blo __und_usr_fault_16_pan @ 16bit undefined instruction
  459. 3: ldrht r0, [r2]
  460. ARM_BE8(rev16 r0, r0) @ little endian instruction
  461. uaccess_disable ip
  462. add r2, r2, #2 @ r2 is PC + 2, make it PC + 4
  463. str r2, [sp, #S_PC] @ it's a 2x16bit instr, update
  464. orr r0, r0, r5, lsl #16
  465. badr lr, __und_usr_fault_32
  466. @ r0 = the two 16-bit Thumb instructions which caused the exception
  467. @ r2 = PC value for the following Thumb instruction (:= regs->ARM_pc)
  468. @ r4 = PC value for the first 16-bit Thumb instruction
  469. @ lr = 32bit undefined instruction function
  470. #if __LINUX_ARM_ARCH__ < 7
  471. /* If the target arch was overridden, change it back: */
  472. #ifdef CONFIG_CPU_32v6K
  473. .arch armv6k
  474. #else
  475. .arch armv6
  476. #endif
  477. #endif /* __LINUX_ARM_ARCH__ < 7 */
  478. #else /* !(CONFIG_ARM_THUMB && __LINUX_ARM_ARCH__ >= 6 && CONFIG_CPU_V7) */
  479. b __und_usr_fault_16
  480. #endif
  481. UNWIND(.fnend)
  482. ENDPROC(__und_usr)
  483. /*
  484. * The out of line fixup for the ldrt instructions above.
  485. */
  486. .pushsection .text.fixup, "ax"
  487. .align 2
  488. 4: str r4, [sp, #S_PC] @ retry current instruction
  489. ret r9
  490. .popsection
  491. .pushsection __ex_table,"a"
  492. .long 1b, 4b
  493. #if CONFIG_ARM_THUMB && __LINUX_ARM_ARCH__ >= 6 && CONFIG_CPU_V7
  494. .long 2b, 4b
  495. .long 3b, 4b
  496. #endif
  497. .popsection
  498. /*
  499. * Check whether the instruction is a co-processor instruction.
  500. * If yes, we need to call the relevant co-processor handler.
  501. *
  502. * Note that we don't do a full check here for the co-processor
  503. * instructions; all instructions with bit 27 set are well
  504. * defined. The only instructions that should fault are the
  505. * co-processor instructions. However, we have to watch out
  506. * for the ARM6/ARM7 SWI bug.
  507. *
  508. * NEON is a special case that has to be handled here. Not all
  509. * NEON instructions are co-processor instructions, so we have
  510. * to make a special case of checking for them. Plus, there's
  511. * five groups of them, so we have a table of mask/opcode pairs
  512. * to check against, and if any match then we branch off into the
  513. * NEON handler code.
  514. *
  515. * Emulators may wish to make use of the following registers:
  516. * r0 = instruction opcode (32-bit ARM or two 16-bit Thumb)
  517. * r2 = PC value to resume execution after successful emulation
  518. * r9 = normal "successful" return address
  519. * r10 = this threads thread_info structure
  520. * lr = unrecognised instruction return address
  521. * IRQs enabled, FIQs enabled.
  522. */
  523. @
  524. @ Fall-through from Thumb-2 __und_usr
  525. @
  526. #ifdef CONFIG_NEON
  527. get_thread_info r10 @ get current thread
  528. adr r6, .LCneon_thumb_opcodes
  529. b 2f
  530. #endif
  531. call_fpe:
  532. get_thread_info r10 @ get current thread
  533. #ifdef CONFIG_NEON
  534. adr r6, .LCneon_arm_opcodes
  535. 2: ldr r5, [r6], #4 @ mask value
  536. ldr r7, [r6], #4 @ opcode bits matching in mask
  537. cmp r5, #0 @ end mask?
  538. beq 1f
  539. and r8, r0, r5
  540. cmp r8, r7 @ NEON instruction?
  541. bne 2b
  542. mov r7, #1
  543. strb r7, [r10, #TI_USED_CP + 10] @ mark CP#10 as used
  544. strb r7, [r10, #TI_USED_CP + 11] @ mark CP#11 as used
  545. b do_vfp @ let VFP handler handle this
  546. 1:
  547. #endif
  548. tst r0, #0x08000000 @ only CDP/CPRT/LDC/STC have bit 27
  549. tstne r0, #0x04000000 @ bit 26 set on both ARM and Thumb-2
  550. reteq lr
  551. and r8, r0, #0x00000f00 @ mask out CP number
  552. THUMB( lsr r8, r8, #8 )
  553. mov r7, #1
  554. add r6, r10, #TI_USED_CP
  555. ARM( strb r7, [r6, r8, lsr #8] ) @ set appropriate used_cp[]
  556. THUMB( strb r7, [r6, r8] ) @ set appropriate used_cp[]
  557. #ifdef CONFIG_IWMMXT
  558. @ Test if we need to give access to iWMMXt coprocessors
  559. ldr r5, [r10, #TI_FLAGS]
  560. rsbs r7, r8, #(1 << 8) @ CP 0 or 1 only
  561. movcss r7, r5, lsr #(TIF_USING_IWMMXT + 1)
  562. bcs iwmmxt_task_enable
  563. #endif
  564. ARM( add pc, pc, r8, lsr #6 )
  565. THUMB( lsl r8, r8, #2 )
  566. THUMB( add pc, r8 )
  567. nop
  568. ret.w lr @ CP#0
  569. W(b) do_fpe @ CP#1 (FPE)
  570. W(b) do_fpe @ CP#2 (FPE)
  571. ret.w lr @ CP#3
  572. #ifdef CONFIG_CRUNCH
  573. b crunch_task_enable @ CP#4 (MaverickCrunch)
  574. b crunch_task_enable @ CP#5 (MaverickCrunch)
  575. b crunch_task_enable @ CP#6 (MaverickCrunch)
  576. #else
  577. ret.w lr @ CP#4
  578. ret.w lr @ CP#5
  579. ret.w lr @ CP#6
  580. #endif
  581. ret.w lr @ CP#7
  582. ret.w lr @ CP#8
  583. ret.w lr @ CP#9
  584. #ifdef CONFIG_VFP
  585. W(b) do_vfp @ CP#10 (VFP)
  586. W(b) do_vfp @ CP#11 (VFP)
  587. #else
  588. ret.w lr @ CP#10 (VFP)
  589. ret.w lr @ CP#11 (VFP)
  590. #endif
  591. ret.w lr @ CP#12
  592. ret.w lr @ CP#13
  593. ret.w lr @ CP#14 (Debug)
  594. ret.w lr @ CP#15 (Control)
  595. #ifdef NEED_CPU_ARCHITECTURE
  596. .align 2
  597. .LCcpu_architecture:
  598. .word __cpu_architecture
  599. #endif
  600. #ifdef CONFIG_NEON
  601. .align 6
  602. .LCneon_arm_opcodes:
  603. .word 0xfe000000 @ mask
  604. .word 0xf2000000 @ opcode
  605. .word 0xff100000 @ mask
  606. .word 0xf4000000 @ opcode
  607. .word 0x00000000 @ mask
  608. .word 0x00000000 @ opcode
  609. .LCneon_thumb_opcodes:
  610. .word 0xef000000 @ mask
  611. .word 0xef000000 @ opcode
  612. .word 0xff100000 @ mask
  613. .word 0xf9000000 @ opcode
  614. .word 0x00000000 @ mask
  615. .word 0x00000000 @ opcode
  616. #endif
  617. do_fpe:
  618. ldr r4, .LCfp
  619. add r10, r10, #TI_FPSTATE @ r10 = workspace
  620. ldr pc, [r4] @ Call FP module USR entry point
  621. /*
  622. * The FP module is called with these registers set:
  623. * r0 = instruction
  624. * r2 = PC+4
  625. * r9 = normal "successful" return address
  626. * r10 = FP workspace
  627. * lr = unrecognised FP instruction return address
  628. */
  629. .pushsection .data
  630. .align 2
  631. ENTRY(fp_enter)
  632. .word no_fp
  633. .popsection
  634. ENTRY(no_fp)
  635. ret lr
  636. ENDPROC(no_fp)
  637. __und_usr_fault_32:
  638. mov r1, #4
  639. b 1f
  640. __und_usr_fault_16_pan:
  641. uaccess_disable ip
  642. __und_usr_fault_16:
  643. mov r1, #2
  644. 1: mov r0, sp
  645. badr lr, ret_from_exception
  646. b __und_fault
  647. ENDPROC(__und_usr_fault_32)
  648. ENDPROC(__und_usr_fault_16)
  649. .align 5
  650. __pabt_usr:
  651. usr_entry
  652. mov r2, sp @ regs
  653. pabt_helper
  654. UNWIND(.fnend )
  655. /* fall through */
  656. /*
  657. * This is the return code to user mode for abort handlers
  658. */
  659. ENTRY(ret_from_exception)
  660. UNWIND(.fnstart )
  661. UNWIND(.cantunwind )
  662. get_thread_info tsk
  663. mov why, #0
  664. b ret_to_user
  665. UNWIND(.fnend )
  666. ENDPROC(__pabt_usr)
  667. ENDPROC(ret_from_exception)
  668. .align 5
  669. __fiq_usr:
  670. usr_entry trace=0
  671. kuser_cmpxchg_check
  672. mov r0, sp @ struct pt_regs *regs
  673. bl handle_fiq_as_nmi
  674. get_thread_info tsk
  675. restore_user_regs fast = 0, offset = 0
  676. UNWIND(.fnend )
  677. ENDPROC(__fiq_usr)
  678. /*
  679. * Register switch for ARMv3 and ARMv4 processors
  680. * r0 = previous task_struct, r1 = previous thread_info, r2 = next thread_info
  681. * previous and next are guaranteed not to be the same.
  682. */
  683. ENTRY(__switch_to)
  684. UNWIND(.fnstart )
  685. UNWIND(.cantunwind )
  686. add ip, r1, #TI_CPU_SAVE
  687. ARM( stmia ip!, {r4 - sl, fp, sp, lr} ) @ Store most regs on stack
  688. THUMB( stmia ip!, {r4 - sl, fp} ) @ Store most regs on stack
  689. THUMB( str sp, [ip], #4 )
  690. THUMB( str lr, [ip], #4 )
  691. ldr r4, [r2, #TI_TP_VALUE]
  692. ldr r5, [r2, #TI_TP_VALUE + 4]
  693. #ifdef CONFIG_CPU_USE_DOMAINS
  694. mrc p15, 0, r6, c3, c0, 0 @ Get domain register
  695. str r6, [r1, #TI_CPU_DOMAIN] @ Save old domain register
  696. ldr r6, [r2, #TI_CPU_DOMAIN]
  697. #endif
  698. switch_tls r1, r4, r5, r3, r7
  699. #if defined(CONFIG_STACKPROTECTOR) && !defined(CONFIG_SMP)
  700. ldr r7, [r2, #TI_TASK]
  701. ldr r8, =__stack_chk_guard
  702. .if (TSK_STACK_CANARY > IMM12_MASK)
  703. add r7, r7, #TSK_STACK_CANARY & ~IMM12_MASK
  704. .endif
  705. ldr r7, [r7, #TSK_STACK_CANARY & IMM12_MASK]
  706. #endif
  707. #ifdef CONFIG_CPU_USE_DOMAINS
  708. mcr p15, 0, r6, c3, c0, 0 @ Set domain register
  709. #endif
  710. mov r5, r0
  711. add r4, r2, #TI_CPU_SAVE
  712. ldr r0, =thread_notify_head
  713. mov r1, #THREAD_NOTIFY_SWITCH
  714. bl atomic_notifier_call_chain
  715. #if defined(CONFIG_STACKPROTECTOR) && !defined(CONFIG_SMP)
  716. str r7, [r8]
  717. #endif
  718. THUMB( mov ip, r4 )
  719. mov r0, r5
  720. ARM( ldmia r4, {r4 - sl, fp, sp, pc} ) @ Load all regs saved previously
  721. THUMB( ldmia ip!, {r4 - sl, fp} ) @ Load all regs saved previously
  722. THUMB( ldr sp, [ip], #4 )
  723. THUMB( ldr pc, [ip] )
  724. UNWIND(.fnend )
  725. ENDPROC(__switch_to)
  726. __INIT
  727. /*
  728. * User helpers.
  729. *
  730. * Each segment is 32-byte aligned and will be moved to the top of the high
  731. * vector page. New segments (if ever needed) must be added in front of
  732. * existing ones. This mechanism should be used only for things that are
  733. * really small and justified, and not be abused freely.
  734. *
  735. * See Documentation/arm/kernel_user_helpers.txt for formal definitions.
  736. */
  737. THUMB( .arm )
  738. .macro usr_ret, reg
  739. #ifdef CONFIG_ARM_THUMB
  740. bx \reg
  741. #else
  742. ret \reg
  743. #endif
  744. .endm
  745. .macro kuser_pad, sym, size
  746. .if (. - \sym) & 3
  747. .rept 4 - (. - \sym) & 3
  748. .byte 0
  749. .endr
  750. .endif
  751. .rept (\size - (. - \sym)) / 4
  752. .word 0xe7fddef1
  753. .endr
  754. .endm
  755. #ifdef CONFIG_KUSER_HELPERS
  756. .align 5
  757. .globl __kuser_helper_start
  758. __kuser_helper_start:
  759. /*
  760. * Due to the length of some sequences, __kuser_cmpxchg64 spans 2 regular
  761. * kuser "slots", therefore 0xffff0f80 is not used as a valid entry point.
  762. */
  763. __kuser_cmpxchg64: @ 0xffff0f60
  764. #if defined(CONFIG_CPU_32v6K)
  765. stmfd sp!, {r4, r5, r6, r7}
  766. ldrd r4, r5, [r0] @ load old val
  767. ldrd r6, r7, [r1] @ load new val
  768. smp_dmb arm
  769. 1: ldrexd r0, r1, [r2] @ load current val
  770. eors r3, r0, r4 @ compare with oldval (1)
  771. eoreqs r3, r1, r5 @ compare with oldval (2)
  772. strexdeq r3, r6, r7, [r2] @ store newval if eq
  773. teqeq r3, #1 @ success?
  774. beq 1b @ if no then retry
  775. smp_dmb arm
  776. rsbs r0, r3, #0 @ set returned val and C flag
  777. ldmfd sp!, {r4, r5, r6, r7}
  778. usr_ret lr
  779. #elif !defined(CONFIG_SMP)
  780. #ifdef CONFIG_MMU
  781. /*
  782. * The only thing that can break atomicity in this cmpxchg64
  783. * implementation is either an IRQ or a data abort exception
  784. * causing another process/thread to be scheduled in the middle of
  785. * the critical sequence. The same strategy as for cmpxchg is used.
  786. */
  787. stmfd sp!, {r4, r5, r6, lr}
  788. ldmia r0, {r4, r5} @ load old val
  789. ldmia r1, {r6, lr} @ load new val
  790. 1: ldmia r2, {r0, r1} @ load current val
  791. eors r3, r0, r4 @ compare with oldval (1)
  792. eoreqs r3, r1, r5 @ compare with oldval (2)
  793. 2: stmeqia r2, {r6, lr} @ store newval if eq
  794. rsbs r0, r3, #0 @ set return val and C flag
  795. ldmfd sp!, {r4, r5, r6, pc}
  796. .text
  797. kuser_cmpxchg64_fixup:
  798. @ Called from kuser_cmpxchg_fixup.
  799. @ r4 = address of interrupted insn (must be preserved).
  800. @ sp = saved regs. r7 and r8 are clobbered.
  801. @ 1b = first critical insn, 2b = last critical insn.
  802. @ If r4 >= 1b and r4 <= 2b then saved pc_usr is set to 1b.
  803. mov r7, #0xffff0fff
  804. sub r7, r7, #(0xffff0fff - (0xffff0f60 + (1b - __kuser_cmpxchg64)))
  805. subs r8, r4, r7
  806. rsbcss r8, r8, #(2b - 1b)
  807. strcs r7, [sp, #S_PC]
  808. #if __LINUX_ARM_ARCH__ < 6
  809. bcc kuser_cmpxchg32_fixup
  810. #endif
  811. ret lr
  812. .previous
  813. #else
  814. #warning "NPTL on non MMU needs fixing"
  815. mov r0, #-1
  816. adds r0, r0, #0
  817. usr_ret lr
  818. #endif
  819. #else
  820. #error "incoherent kernel configuration"
  821. #endif
  822. kuser_pad __kuser_cmpxchg64, 64
  823. __kuser_memory_barrier: @ 0xffff0fa0
  824. smp_dmb arm
  825. usr_ret lr
  826. kuser_pad __kuser_memory_barrier, 32
  827. __kuser_cmpxchg: @ 0xffff0fc0
  828. #if __LINUX_ARM_ARCH__ < 6
  829. #ifdef CONFIG_MMU
  830. /*
  831. * The only thing that can break atomicity in this cmpxchg
  832. * implementation is either an IRQ or a data abort exception
  833. * causing another process/thread to be scheduled in the middle
  834. * of the critical sequence. To prevent this, code is added to
  835. * the IRQ and data abort exception handlers to set the pc back
  836. * to the beginning of the critical section if it is found to be
  837. * within that critical section (see kuser_cmpxchg_fixup).
  838. */
  839. 1: ldr r3, [r2] @ load current val
  840. subs r3, r3, r0 @ compare with oldval
  841. 2: streq r1, [r2] @ store newval if eq
  842. rsbs r0, r3, #0 @ set return val and C flag
  843. usr_ret lr
  844. .text
  845. kuser_cmpxchg32_fixup:
  846. @ Called from kuser_cmpxchg_check macro.
  847. @ r4 = address of interrupted insn (must be preserved).
  848. @ sp = saved regs. r7 and r8 are clobbered.
  849. @ 1b = first critical insn, 2b = last critical insn.
  850. @ If r4 >= 1b and r4 <= 2b then saved pc_usr is set to 1b.
  851. mov r7, #0xffff0fff
  852. sub r7, r7, #(0xffff0fff - (0xffff0fc0 + (1b - __kuser_cmpxchg)))
  853. subs r8, r4, r7
  854. rsbcss r8, r8, #(2b - 1b)
  855. strcs r7, [sp, #S_PC]
  856. ret lr
  857. .previous
  858. #else
  859. #warning "NPTL on non MMU needs fixing"
  860. mov r0, #-1
  861. adds r0, r0, #0
  862. usr_ret lr
  863. #endif
  864. #else
  865. smp_dmb arm
  866. 1: ldrex r3, [r2]
  867. subs r3, r3, r0
  868. strexeq r3, r1, [r2]
  869. teqeq r3, #1
  870. beq 1b
  871. rsbs r0, r3, #0
  872. /* beware -- each __kuser slot must be 8 instructions max */
  873. ALT_SMP(b __kuser_memory_barrier)
  874. ALT_UP(usr_ret lr)
  875. #endif
  876. kuser_pad __kuser_cmpxchg, 32
  877. __kuser_get_tls: @ 0xffff0fe0
  878. ldr r0, [pc, #(16 - 8)] @ read TLS, set in kuser_get_tls_init
  879. usr_ret lr
  880. mrc p15, 0, r0, c13, c0, 3 @ 0xffff0fe8 hardware TLS code
  881. kuser_pad __kuser_get_tls, 16
  882. .rep 3
  883. .word 0 @ 0xffff0ff0 software TLS value, then
  884. .endr @ pad up to __kuser_helper_version
  885. __kuser_helper_version: @ 0xffff0ffc
  886. .word ((__kuser_helper_end - __kuser_helper_start) >> 5)
  887. .globl __kuser_helper_end
  888. __kuser_helper_end:
  889. #endif
  890. THUMB( .thumb )
  891. /*
  892. * Vector stubs.
  893. *
  894. * This code is copied to 0xffff1000 so we can use branches in the
  895. * vectors, rather than ldr's. Note that this code must not exceed
  896. * a page size.
  897. *
  898. * Common stub entry macro:
  899. * Enter in IRQ mode, spsr = SVC/USR CPSR, lr = SVC/USR PC
  900. *
  901. * SP points to a minimal amount of processor-private memory, the address
  902. * of which is copied into r0 for the mode specific abort handler.
  903. */
  904. .macro vector_stub, name, mode, correction=0
  905. .align 5
  906. vector_\name:
  907. .if \correction
  908. sub lr, lr, #\correction
  909. .endif
  910. @
  911. @ Save r0, lr_<exception> (parent PC) and spsr_<exception>
  912. @ (parent CPSR)
  913. @
  914. stmia sp, {r0, lr} @ save r0, lr
  915. mrs lr, spsr
  916. str lr, [sp, #8] @ save spsr
  917. @
  918. @ Prepare for SVC32 mode. IRQs remain disabled.
  919. @
  920. mrs r0, cpsr
  921. eor r0, r0, #(\mode ^ SVC_MODE | PSR_ISETSTATE)
  922. msr spsr_cxsf, r0
  923. @
  924. @ the branch table must immediately follow this code
  925. @
  926. and lr, lr, #0x0f
  927. THUMB( adr r0, 1f )
  928. THUMB( ldr lr, [r0, lr, lsl #2] )
  929. mov r0, sp
  930. ARM( ldr lr, [pc, lr, lsl #2] )
  931. movs pc, lr @ branch to handler in SVC mode
  932. ENDPROC(vector_\name)
  933. .align 2
  934. @ handler addresses follow this label
  935. 1:
  936. .endm
  937. .section .stubs, "ax", %progbits
  938. @ This must be the first word
  939. .word vector_swi
  940. vector_rst:
  941. ARM( swi SYS_ERROR0 )
  942. THUMB( svc #0 )
  943. THUMB( nop )
  944. b vector_und
  945. /*
  946. * Interrupt dispatcher
  947. */
  948. vector_stub irq, IRQ_MODE, 4
  949. .long __irq_usr @ 0 (USR_26 / USR_32)
  950. .long __irq_invalid @ 1 (FIQ_26 / FIQ_32)
  951. .long __irq_invalid @ 2 (IRQ_26 / IRQ_32)
  952. .long __irq_svc @ 3 (SVC_26 / SVC_32)
  953. .long __irq_invalid @ 4
  954. .long __irq_invalid @ 5
  955. .long __irq_invalid @ 6
  956. .long __irq_invalid @ 7
  957. .long __irq_invalid @ 8
  958. .long __irq_invalid @ 9
  959. .long __irq_invalid @ a
  960. .long __irq_invalid @ b
  961. .long __irq_invalid @ c
  962. .long __irq_invalid @ d
  963. .long __irq_invalid @ e
  964. .long __irq_invalid @ f
  965. /*
  966. * Data abort dispatcher
  967. * Enter in ABT mode, spsr = USR CPSR, lr = USR PC
  968. */
  969. vector_stub dabt, ABT_MODE, 8
  970. .long __dabt_usr @ 0 (USR_26 / USR_32)
  971. .long __dabt_invalid @ 1 (FIQ_26 / FIQ_32)
  972. .long __dabt_invalid @ 2 (IRQ_26 / IRQ_32)
  973. .long __dabt_svc @ 3 (SVC_26 / SVC_32)
  974. .long __dabt_invalid @ 4
  975. .long __dabt_invalid @ 5
  976. .long __dabt_invalid @ 6
  977. .long __dabt_invalid @ 7
  978. .long __dabt_invalid @ 8
  979. .long __dabt_invalid @ 9
  980. .long __dabt_invalid @ a
  981. .long __dabt_invalid @ b
  982. .long __dabt_invalid @ c
  983. .long __dabt_invalid @ d
  984. .long __dabt_invalid @ e
  985. .long __dabt_invalid @ f
  986. /*
  987. * Prefetch abort dispatcher
  988. * Enter in ABT mode, spsr = USR CPSR, lr = USR PC
  989. */
  990. vector_stub pabt, ABT_MODE, 4
  991. .long __pabt_usr @ 0 (USR_26 / USR_32)
  992. .long __pabt_invalid @ 1 (FIQ_26 / FIQ_32)
  993. .long __pabt_invalid @ 2 (IRQ_26 / IRQ_32)
  994. .long __pabt_svc @ 3 (SVC_26 / SVC_32)
  995. .long __pabt_invalid @ 4
  996. .long __pabt_invalid @ 5
  997. .long __pabt_invalid @ 6
  998. .long __pabt_invalid @ 7
  999. .long __pabt_invalid @ 8
  1000. .long __pabt_invalid @ 9
  1001. .long __pabt_invalid @ a
  1002. .long __pabt_invalid @ b
  1003. .long __pabt_invalid @ c
  1004. .long __pabt_invalid @ d
  1005. .long __pabt_invalid @ e
  1006. .long __pabt_invalid @ f
  1007. /*
  1008. * Undef instr entry dispatcher
  1009. * Enter in UND mode, spsr = SVC/USR CPSR, lr = SVC/USR PC
  1010. */
  1011. vector_stub und, UND_MODE
  1012. .long __und_usr @ 0 (USR_26 / USR_32)
  1013. .long __und_invalid @ 1 (FIQ_26 / FIQ_32)
  1014. .long __und_invalid @ 2 (IRQ_26 / IRQ_32)
  1015. .long __und_svc @ 3 (SVC_26 / SVC_32)
  1016. .long __und_invalid @ 4
  1017. .long __und_invalid @ 5
  1018. .long __und_invalid @ 6
  1019. .long __und_invalid @ 7
  1020. .long __und_invalid @ 8
  1021. .long __und_invalid @ 9
  1022. .long __und_invalid @ a
  1023. .long __und_invalid @ b
  1024. .long __und_invalid @ c
  1025. .long __und_invalid @ d
  1026. .long __und_invalid @ e
  1027. .long __und_invalid @ f
  1028. .align 5
  1029. /*=============================================================================
  1030. * Address exception handler
  1031. *-----------------------------------------------------------------------------
  1032. * These aren't too critical.
  1033. * (they're not supposed to happen, and won't happen in 32-bit data mode).
  1034. */
  1035. vector_addrexcptn:
  1036. b vector_addrexcptn
  1037. /*=============================================================================
  1038. * FIQ "NMI" handler
  1039. *-----------------------------------------------------------------------------
  1040. * Handle a FIQ using the SVC stack allowing FIQ act like NMI on x86
  1041. * systems.
  1042. */
  1043. vector_stub fiq, FIQ_MODE, 4
  1044. .long __fiq_usr @ 0 (USR_26 / USR_32)
  1045. .long __fiq_svc @ 1 (FIQ_26 / FIQ_32)
  1046. .long __fiq_svc @ 2 (IRQ_26 / IRQ_32)
  1047. .long __fiq_svc @ 3 (SVC_26 / SVC_32)
  1048. .long __fiq_svc @ 4
  1049. .long __fiq_svc @ 5
  1050. .long __fiq_svc @ 6
  1051. .long __fiq_abt @ 7
  1052. .long __fiq_svc @ 8
  1053. .long __fiq_svc @ 9
  1054. .long __fiq_svc @ a
  1055. .long __fiq_svc @ b
  1056. .long __fiq_svc @ c
  1057. .long __fiq_svc @ d
  1058. .long __fiq_svc @ e
  1059. .long __fiq_svc @ f
  1060. .globl vector_fiq
  1061. .section .vectors, "ax", %progbits
  1062. .L__vectors_start:
  1063. W(b) vector_rst
  1064. W(b) vector_und
  1065. W(ldr) pc, .L__vectors_start + 0x1000
  1066. W(b) vector_pabt
  1067. W(b) vector_dabt
  1068. W(b) vector_addrexcptn
  1069. W(b) vector_irq
  1070. W(b) vector_fiq
  1071. .data
  1072. .align 2
  1073. .globl cr_alignment
  1074. cr_alignment:
  1075. .space 4