entry-armv.S 30 KB

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