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. #ifdef CONFIG_KPROBES
  78. .section .kprobes.text,"ax",%progbits
  79. #else
  80. .text
  81. #endif
  82. /*
  83. * Invalid mode handlers
  84. */
  85. .macro inv_entry, reason
  86. sub sp, sp, #PT_REGS_SIZE
  87. ARM( stmib sp, {r1 - lr} )
  88. THUMB( stmia sp, {r0 - r12} )
  89. THUMB( str sp, [sp, #S_SP] )
  90. THUMB( str lr, [sp, #S_LR] )
  91. mov r1, #\reason
  92. .endm
  93. __pabt_invalid:
  94. inv_entry BAD_PREFETCH
  95. b common_invalid
  96. ENDPROC(__pabt_invalid)
  97. __dabt_invalid:
  98. inv_entry BAD_DATA
  99. b common_invalid
  100. ENDPROC(__dabt_invalid)
  101. __irq_invalid:
  102. inv_entry BAD_IRQ
  103. b common_invalid
  104. ENDPROC(__irq_invalid)
  105. __und_invalid:
  106. inv_entry BAD_UNDEFINSTR
  107. @
  108. @ XXX fall through to common_invalid
  109. @
  110. @
  111. @ common_invalid - generic code for failed exception (re-entrant version of handlers)
  112. @
  113. common_invalid:
  114. zero_fp
  115. ldmia r0, {r4 - r6}
  116. add r0, sp, #S_PC @ here for interlock avoidance
  117. mov r7, #-1 @ "" "" "" ""
  118. str r4, [sp] @ save preserved r0
  119. stmia r0, {r5 - r7} @ lr_<exception>,
  120. @ cpsr_<exception>, "old_r0"
  121. mov r0, sp
  122. b bad_mode
  123. ENDPROC(__und_invalid)
  124. /*
  125. * SVC mode handlers
  126. */
  127. #if defined(CONFIG_AEABI) && (__LINUX_ARM_ARCH__ >= 5)
  128. #define SPFIX(code...) code
  129. #else
  130. #define SPFIX(code...)
  131. #endif
  132. .macro svc_entry, stack_hole=0, trace=1, uaccess=1
  133. UNWIND(.fnstart )
  134. UNWIND(.save {r0 - pc} )
  135. sub sp, sp, #(SVC_REGS_SIZE + \stack_hole - 4)
  136. #ifdef CONFIG_THUMB2_KERNEL
  137. SPFIX( str r0, [sp] ) @ temporarily saved
  138. SPFIX( mov r0, sp )
  139. SPFIX( tst r0, #4 ) @ test original stack alignment
  140. SPFIX( ldr r0, [sp] ) @ restored
  141. #else
  142. SPFIX( tst sp, #4 )
  143. #endif
  144. SPFIX( subeq sp, sp, #4 )
  145. stmia sp, {r1 - r12}
  146. ldmia r0, {r3 - r5}
  147. add r7, sp, #S_SP - 4 @ here for interlock avoidance
  148. mov r6, #-1 @ "" "" "" ""
  149. add r2, sp, #(SVC_REGS_SIZE + \stack_hole - 4)
  150. SPFIX( addeq r2, r2, #4 )
  151. str r3, [sp, #-4]! @ save the "real" r0 copied
  152. @ from the exception stack
  153. mov r3, lr
  154. @
  155. @ We are now ready to fill in the remaining blanks on the stack:
  156. @
  157. @ r2 - sp_svc
  158. @ r3 - lr_svc
  159. @ r4 - lr_<exception>, already fixed up for correct return/restart
  160. @ r5 - spsr_<exception>
  161. @ r6 - orig_r0 (see pt_regs definition in ptrace.h)
  162. @
  163. stmia r7, {r2 - r6}
  164. get_thread_info tsk
  165. ldr r0, [tsk, #TI_ADDR_LIMIT]
  166. mov r1, #TASK_SIZE
  167. str r1, [tsk, #TI_ADDR_LIMIT]
  168. str r0, [sp, #SVC_ADDR_LIMIT]
  169. uaccess_save r0
  170. .if \uaccess
  171. uaccess_disable r0
  172. .endif
  173. .if \trace
  174. #ifdef CONFIG_TRACE_IRQFLAGS
  175. bl trace_hardirqs_off
  176. #endif
  177. .endif
  178. .endm
  179. .align 5
  180. __dabt_svc:
  181. svc_entry uaccess=0
  182. mov r2, sp
  183. dabt_helper
  184. THUMB( ldr r5, [sp, #S_PSR] ) @ potentially updated CPSR
  185. svc_exit r5 @ return from exception
  186. UNWIND(.fnend )
  187. ENDPROC(__dabt_svc)
  188. .align 5
  189. __irq_svc:
  190. svc_entry
  191. irq_handler
  192. #ifdef CONFIG_PREEMPT
  193. ldr r8, [tsk, #TI_PREEMPT] @ get preempt count
  194. ldr r0, [tsk, #TI_FLAGS] @ get flags
  195. teq r8, #0 @ if preempt count != 0
  196. movne r0, #0 @ force flags to 0
  197. tst r0, #_TIF_NEED_RESCHED
  198. blne svc_preempt
  199. #endif
  200. svc_exit r5, irq = 1 @ return from exception
  201. UNWIND(.fnend )
  202. ENDPROC(__irq_svc)
  203. .ltorg
  204. #ifdef CONFIG_PREEMPT
  205. svc_preempt:
  206. mov r8, lr
  207. 1: bl preempt_schedule_irq @ irq en/disable is done inside
  208. ldr r0, [tsk, #TI_FLAGS] @ get new tasks TI_FLAGS
  209. tst r0, #_TIF_NEED_RESCHED
  210. reteq r8 @ go again
  211. b 1b
  212. #endif
  213. __und_fault:
  214. @ Correct the PC such that it is pointing at the instruction
  215. @ which caused the fault. If the faulting instruction was ARM
  216. @ the PC will be pointing at the next instruction, and have to
  217. @ subtract 4. Otherwise, it is Thumb, and the PC will be
  218. @ pointing at the second half of the Thumb instruction. We
  219. @ have to subtract 2.
  220. ldr r2, [r0, #S_PC]
  221. sub r2, r2, r1
  222. str r2, [r0, #S_PC]
  223. b do_undefinstr
  224. ENDPROC(__und_fault)
  225. .align 5
  226. __und_svc:
  227. #ifdef CONFIG_KPROBES
  228. @ If a kprobe is about to simulate a "stmdb sp..." instruction,
  229. @ it obviously needs free stack space which then will belong to
  230. @ the saved context.
  231. svc_entry MAX_STACK_SIZE
  232. #else
  233. svc_entry
  234. #endif
  235. @
  236. @ call emulation code, which returns using r9 if it has emulated
  237. @ the instruction, or the more conventional lr if we are to treat
  238. @ this as a real undefined instruction
  239. @
  240. @ r0 - instruction
  241. @
  242. #ifndef CONFIG_THUMB2_KERNEL
  243. ldr r0, [r4, #-4]
  244. #else
  245. mov r1, #2
  246. ldrh r0, [r4, #-2] @ Thumb instruction at LR - 2
  247. cmp r0, #0xe800 @ 32-bit instruction if xx >= 0
  248. blo __und_svc_fault
  249. ldrh r9, [r4] @ bottom 16 bits
  250. add r4, r4, #2
  251. str r4, [sp, #S_PC]
  252. orr r0, r9, r0, lsl #16
  253. #endif
  254. badr r9, __und_svc_finish
  255. mov r2, r4
  256. bl call_fpe
  257. mov r1, #4 @ PC correction to apply
  258. __und_svc_fault:
  259. mov r0, sp @ struct pt_regs *regs
  260. bl __und_fault
  261. __und_svc_finish:
  262. get_thread_info tsk
  263. ldr r5, [sp, #S_PSR] @ Get SVC cpsr
  264. svc_exit r5 @ return from exception
  265. UNWIND(.fnend )
  266. ENDPROC(__und_svc)
  267. .align 5
  268. __pabt_svc:
  269. svc_entry
  270. mov r2, sp @ regs
  271. pabt_helper
  272. svc_exit r5 @ return from exception
  273. UNWIND(.fnend )
  274. ENDPROC(__pabt_svc)
  275. .align 5
  276. __fiq_svc:
  277. svc_entry trace=0
  278. mov r0, sp @ struct pt_regs *regs
  279. bl handle_fiq_as_nmi
  280. svc_exit_via_fiq
  281. UNWIND(.fnend )
  282. ENDPROC(__fiq_svc)
  283. .align 5
  284. .LCcralign:
  285. .word cr_alignment
  286. #ifdef MULTI_DABORT
  287. .LCprocfns:
  288. .word processor
  289. #endif
  290. .LCfp:
  291. .word fp_enter
  292. /*
  293. * Abort mode handlers
  294. */
  295. @
  296. @ Taking a FIQ in abort mode is similar to taking a FIQ in SVC mode
  297. @ and reuses the same macros. However in abort mode we must also
  298. @ save/restore lr_abt and spsr_abt to make nested aborts safe.
  299. @
  300. .align 5
  301. __fiq_abt:
  302. svc_entry trace=0
  303. ARM( msr cpsr_c, #ABT_MODE | PSR_I_BIT | PSR_F_BIT )
  304. THUMB( mov r0, #ABT_MODE | PSR_I_BIT | PSR_F_BIT )
  305. THUMB( msr cpsr_c, r0 )
  306. mov r1, lr @ Save lr_abt
  307. mrs r2, spsr @ Save spsr_abt, abort is now safe
  308. ARM( msr cpsr_c, #SVC_MODE | PSR_I_BIT | PSR_F_BIT )
  309. THUMB( mov r0, #SVC_MODE | PSR_I_BIT | PSR_F_BIT )
  310. THUMB( msr cpsr_c, r0 )
  311. stmfd sp!, {r1 - r2}
  312. add r0, sp, #8 @ struct pt_regs *regs
  313. bl handle_fiq_as_nmi
  314. ldmfd sp!, {r1 - r2}
  315. ARM( msr cpsr_c, #ABT_MODE | PSR_I_BIT | PSR_F_BIT )
  316. THUMB( mov r0, #ABT_MODE | PSR_I_BIT | PSR_F_BIT )
  317. THUMB( msr cpsr_c, r0 )
  318. mov lr, r1 @ Restore lr_abt, abort is unsafe
  319. msr spsr_cxsf, r2 @ Restore spsr_abt
  320. ARM( msr cpsr_c, #SVC_MODE | PSR_I_BIT | PSR_F_BIT )
  321. THUMB( mov r0, #SVC_MODE | PSR_I_BIT | PSR_F_BIT )
  322. THUMB( msr cpsr_c, r0 )
  323. svc_exit_via_fiq
  324. UNWIND(.fnend )
  325. ENDPROC(__fiq_abt)
  326. /*
  327. * User mode handlers
  328. *
  329. * EABI note: sp_svc is always 64-bit aligned here, so should PT_REGS_SIZE
  330. */
  331. #if defined(CONFIG_AEABI) && (__LINUX_ARM_ARCH__ >= 5) && (PT_REGS_SIZE & 7)
  332. #error "sizeof(struct pt_regs) must be a multiple of 8"
  333. #endif
  334. .macro usr_entry, trace=1, uaccess=1
  335. UNWIND(.fnstart )
  336. UNWIND(.cantunwind ) @ don't unwind the user space
  337. sub sp, sp, #PT_REGS_SIZE
  338. ARM( stmib sp, {r1 - r12} )
  339. THUMB( stmia sp, {r0 - r12} )
  340. ATRAP( mrc p15, 0, r7, c1, c0, 0)
  341. ATRAP( ldr r8, .LCcralign)
  342. ldmia r0, {r3 - r5}
  343. add r0, sp, #S_PC @ here for interlock avoidance
  344. mov r6, #-1 @ "" "" "" ""
  345. str r3, [sp] @ save the "real" r0 copied
  346. @ from the exception stack
  347. ATRAP( ldr r8, [r8, #0])
  348. @
  349. @ We are now ready to fill in the remaining blanks on the stack:
  350. @
  351. @ r4 - lr_<exception>, already fixed up for correct return/restart
  352. @ r5 - spsr_<exception>
  353. @ r6 - orig_r0 (see pt_regs definition in ptrace.h)
  354. @
  355. @ Also, separately save sp_usr and lr_usr
  356. @
  357. stmia r0, {r4 - r6}
  358. ARM( stmdb r0, {sp, lr}^ )
  359. THUMB( store_user_sp_lr r0, r1, S_SP - S_PC )
  360. .if \uaccess
  361. uaccess_disable ip
  362. .endif
  363. @ Enable the alignment trap while in kernel mode
  364. ATRAP( teq r8, r7)
  365. ATRAP( mcrne p15, 0, r8, c1, c0, 0)
  366. @
  367. @ Clear FP to mark the first stack frame
  368. @
  369. zero_fp
  370. .if \trace
  371. #ifdef CONFIG_TRACE_IRQFLAGS
  372. bl trace_hardirqs_off
  373. #endif
  374. ct_user_exit save = 0
  375. .endif
  376. .endm
  377. .macro kuser_cmpxchg_check
  378. #if !defined(CONFIG_CPU_32v6K) && defined(CONFIG_KUSER_HELPERS)
  379. #ifndef CONFIG_MMU
  380. #warning "NPTL on non MMU needs fixing"
  381. #else
  382. @ Make sure our user space atomic helper is restarted
  383. @ if it was interrupted in a critical region. Here we
  384. @ perform a quick test inline since it should be false
  385. @ 99.9999% of the time. The rest is done out of line.
  386. cmp r4, #TASK_SIZE
  387. blhs kuser_cmpxchg64_fixup
  388. #endif
  389. #endif
  390. .endm
  391. .align 5
  392. __dabt_usr:
  393. usr_entry uaccess=0
  394. kuser_cmpxchg_check
  395. mov r2, sp
  396. dabt_helper
  397. b ret_from_exception
  398. UNWIND(.fnend )
  399. ENDPROC(__dabt_usr)
  400. .align 5
  401. __irq_usr:
  402. usr_entry
  403. kuser_cmpxchg_check
  404. irq_handler
  405. get_thread_info tsk
  406. mov why, #0
  407. b ret_to_user_from_irq
  408. UNWIND(.fnend )
  409. ENDPROC(__irq_usr)
  410. .ltorg
  411. .align 5
  412. __und_usr:
  413. usr_entry uaccess=0
  414. mov r2, r4
  415. mov r3, r5
  416. @ r2 = regs->ARM_pc, which is either 2 or 4 bytes ahead of the
  417. @ faulting instruction depending on Thumb mode.
  418. @ r3 = regs->ARM_cpsr
  419. @
  420. @ The emulation code returns using r9 if it has emulated the
  421. @ instruction, or the more conventional lr if we are to treat
  422. @ this as a real undefined instruction
  423. @
  424. badr r9, ret_from_exception
  425. @ IRQs must be enabled before attempting to read the instruction from
  426. @ user space since that could cause a page/translation fault if the
  427. @ page table was modified by another CPU.
  428. enable_irq
  429. tst r3, #PSR_T_BIT @ Thumb mode?
  430. bne __und_usr_thumb
  431. sub r4, r2, #4 @ ARM instr at LR - 4
  432. 1: ldrt r0, [r4]
  433. ARM_BE8(rev r0, r0) @ little endian instruction
  434. uaccess_disable ip
  435. @ r0 = 32-bit ARM instruction which caused the exception
  436. @ r2 = PC value for the following instruction (:= regs->ARM_pc)
  437. @ r4 = PC value for the faulting instruction
  438. @ lr = 32-bit undefined instruction function
  439. badr lr, __und_usr_fault_32
  440. b call_fpe
  441. __und_usr_thumb:
  442. @ Thumb instruction
  443. sub r4, r2, #2 @ First half of thumb instr at LR - 2
  444. #if CONFIG_ARM_THUMB && __LINUX_ARM_ARCH__ >= 6 && CONFIG_CPU_V7
  445. /*
  446. * Thumb-2 instruction handling. Note that because pre-v6 and >= v6 platforms
  447. * can never be supported in a single kernel, this code is not applicable at
  448. * all when __LINUX_ARM_ARCH__ < 6. This allows simplifying assumptions to be
  449. * made about .arch directives.
  450. */
  451. #if __LINUX_ARM_ARCH__ < 7
  452. /* If the target CPU may not be Thumb-2-capable, a run-time check is needed: */
  453. #define NEED_CPU_ARCHITECTURE
  454. ldr r5, .LCcpu_architecture
  455. ldr r5, [r5]
  456. cmp r5, #CPU_ARCH_ARMv7
  457. blo __und_usr_fault_16 @ 16bit undefined instruction
  458. /*
  459. * The following code won't get run unless the running CPU really is v7, so
  460. * coding round the lack of ldrht on older arches is pointless. Temporarily
  461. * override the assembler target arch with the minimum required instead:
  462. */
  463. .arch armv6t2
  464. #endif
  465. 2: ldrht r5, [r4]
  466. ARM_BE8(rev16 r5, r5) @ little endian instruction
  467. cmp r5, #0xe800 @ 32bit instruction if xx != 0
  468. blo __und_usr_fault_16_pan @ 16bit undefined instruction
  469. 3: ldrht r0, [r2]
  470. ARM_BE8(rev16 r0, r0) @ little endian instruction
  471. uaccess_disable ip
  472. add r2, r2, #2 @ r2 is PC + 2, make it PC + 4
  473. str r2, [sp, #S_PC] @ it's a 2x16bit instr, update
  474. orr r0, r0, r5, lsl #16
  475. badr lr, __und_usr_fault_32
  476. @ r0 = the two 16-bit Thumb instructions which caused the exception
  477. @ r2 = PC value for the following Thumb instruction (:= regs->ARM_pc)
  478. @ r4 = PC value for the first 16-bit Thumb instruction
  479. @ lr = 32bit undefined instruction function
  480. #if __LINUX_ARM_ARCH__ < 7
  481. /* If the target arch was overridden, change it back: */
  482. #ifdef CONFIG_CPU_32v6K
  483. .arch armv6k
  484. #else
  485. .arch armv6
  486. #endif
  487. #endif /* __LINUX_ARM_ARCH__ < 7 */
  488. #else /* !(CONFIG_ARM_THUMB && __LINUX_ARM_ARCH__ >= 6 && CONFIG_CPU_V7) */
  489. b __und_usr_fault_16
  490. #endif
  491. UNWIND(.fnend)
  492. ENDPROC(__und_usr)
  493. /*
  494. * The out of line fixup for the ldrt instructions above.
  495. */
  496. .pushsection .text.fixup, "ax"
  497. .align 2
  498. 4: str r4, [sp, #S_PC] @ retry current instruction
  499. ret r9
  500. .popsection
  501. .pushsection __ex_table,"a"
  502. .long 1b, 4b
  503. #if CONFIG_ARM_THUMB && __LINUX_ARM_ARCH__ >= 6 && CONFIG_CPU_V7
  504. .long 2b, 4b
  505. .long 3b, 4b
  506. #endif
  507. .popsection
  508. /*
  509. * Check whether the instruction is a co-processor instruction.
  510. * If yes, we need to call the relevant co-processor handler.
  511. *
  512. * Note that we don't do a full check here for the co-processor
  513. * instructions; all instructions with bit 27 set are well
  514. * defined. The only instructions that should fault are the
  515. * co-processor instructions. However, we have to watch out
  516. * for the ARM6/ARM7 SWI bug.
  517. *
  518. * NEON is a special case that has to be handled here. Not all
  519. * NEON instructions are co-processor instructions, so we have
  520. * to make a special case of checking for them. Plus, there's
  521. * five groups of them, so we have a table of mask/opcode pairs
  522. * to check against, and if any match then we branch off into the
  523. * NEON handler code.
  524. *
  525. * Emulators may wish to make use of the following registers:
  526. * r0 = instruction opcode (32-bit ARM or two 16-bit Thumb)
  527. * r2 = PC value to resume execution after successful emulation
  528. * r9 = normal "successful" return address
  529. * r10 = this threads thread_info structure
  530. * lr = unrecognised instruction return address
  531. * IRQs enabled, FIQs enabled.
  532. */
  533. @
  534. @ Fall-through from Thumb-2 __und_usr
  535. @
  536. #ifdef CONFIG_NEON
  537. get_thread_info r10 @ get current thread
  538. adr r6, .LCneon_thumb_opcodes
  539. b 2f
  540. #endif
  541. call_fpe:
  542. get_thread_info r10 @ get current thread
  543. #ifdef CONFIG_NEON
  544. adr r6, .LCneon_arm_opcodes
  545. 2: ldr r5, [r6], #4 @ mask value
  546. ldr r7, [r6], #4 @ opcode bits matching in mask
  547. cmp r5, #0 @ end mask?
  548. beq 1f
  549. and r8, r0, r5
  550. cmp r8, r7 @ NEON instruction?
  551. bne 2b
  552. mov r7, #1
  553. strb r7, [r10, #TI_USED_CP + 10] @ mark CP#10 as used
  554. strb r7, [r10, #TI_USED_CP + 11] @ mark CP#11 as used
  555. b do_vfp @ let VFP handler handle this
  556. 1:
  557. #endif
  558. tst r0, #0x08000000 @ only CDP/CPRT/LDC/STC have bit 27
  559. tstne r0, #0x04000000 @ bit 26 set on both ARM and Thumb-2
  560. reteq lr
  561. and r8, r0, #0x00000f00 @ mask out CP number
  562. THUMB( lsr r8, r8, #8 )
  563. mov r7, #1
  564. add r6, r10, #TI_USED_CP
  565. ARM( strb r7, [r6, r8, lsr #8] ) @ set appropriate used_cp[]
  566. THUMB( strb r7, [r6, r8] ) @ set appropriate used_cp[]
  567. #ifdef CONFIG_IWMMXT
  568. @ Test if we need to give access to iWMMXt coprocessors
  569. ldr r5, [r10, #TI_FLAGS]
  570. rsbs r7, r8, #(1 << 8) @ CP 0 or 1 only
  571. movcss r7, r5, lsr #(TIF_USING_IWMMXT + 1)
  572. bcs iwmmxt_task_enable
  573. #endif
  574. ARM( add pc, pc, r8, lsr #6 )
  575. THUMB( lsl r8, r8, #2 )
  576. THUMB( add pc, r8 )
  577. nop
  578. ret.w lr @ CP#0
  579. W(b) do_fpe @ CP#1 (FPE)
  580. W(b) do_fpe @ CP#2 (FPE)
  581. ret.w lr @ CP#3
  582. #ifdef CONFIG_CRUNCH
  583. b crunch_task_enable @ CP#4 (MaverickCrunch)
  584. b crunch_task_enable @ CP#5 (MaverickCrunch)
  585. b crunch_task_enable @ CP#6 (MaverickCrunch)
  586. #else
  587. ret.w lr @ CP#4
  588. ret.w lr @ CP#5
  589. ret.w lr @ CP#6
  590. #endif
  591. ret.w lr @ CP#7
  592. ret.w lr @ CP#8
  593. ret.w lr @ CP#9
  594. #ifdef CONFIG_VFP
  595. W(b) do_vfp @ CP#10 (VFP)
  596. W(b) do_vfp @ CP#11 (VFP)
  597. #else
  598. ret.w lr @ CP#10 (VFP)
  599. ret.w lr @ CP#11 (VFP)
  600. #endif
  601. ret.w lr @ CP#12
  602. ret.w lr @ CP#13
  603. ret.w lr @ CP#14 (Debug)
  604. ret.w lr @ CP#15 (Control)
  605. #ifdef NEED_CPU_ARCHITECTURE
  606. .align 2
  607. .LCcpu_architecture:
  608. .word __cpu_architecture
  609. #endif
  610. #ifdef CONFIG_NEON
  611. .align 6
  612. .LCneon_arm_opcodes:
  613. .word 0xfe000000 @ mask
  614. .word 0xf2000000 @ opcode
  615. .word 0xff100000 @ mask
  616. .word 0xf4000000 @ opcode
  617. .word 0x00000000 @ mask
  618. .word 0x00000000 @ opcode
  619. .LCneon_thumb_opcodes:
  620. .word 0xef000000 @ mask
  621. .word 0xef000000 @ opcode
  622. .word 0xff100000 @ mask
  623. .word 0xf9000000 @ opcode
  624. .word 0x00000000 @ mask
  625. .word 0x00000000 @ opcode
  626. #endif
  627. do_fpe:
  628. ldr r4, .LCfp
  629. add r10, r10, #TI_FPSTATE @ r10 = workspace
  630. ldr pc, [r4] @ Call FP module USR entry point
  631. /*
  632. * The FP module is called with these registers set:
  633. * r0 = instruction
  634. * r2 = PC+4
  635. * r9 = normal "successful" return address
  636. * r10 = FP workspace
  637. * lr = unrecognised FP instruction return address
  638. */
  639. .pushsection .data
  640. ENTRY(fp_enter)
  641. .word no_fp
  642. .popsection
  643. ENTRY(no_fp)
  644. ret lr
  645. ENDPROC(no_fp)
  646. __und_usr_fault_32:
  647. mov r1, #4
  648. b 1f
  649. __und_usr_fault_16_pan:
  650. uaccess_disable ip
  651. __und_usr_fault_16:
  652. mov r1, #2
  653. 1: mov r0, sp
  654. badr lr, ret_from_exception
  655. b __und_fault
  656. ENDPROC(__und_usr_fault_32)
  657. ENDPROC(__und_usr_fault_16)
  658. .align 5
  659. __pabt_usr:
  660. usr_entry
  661. mov r2, sp @ regs
  662. pabt_helper
  663. UNWIND(.fnend )
  664. /* fall through */
  665. /*
  666. * This is the return code to user mode for abort handlers
  667. */
  668. ENTRY(ret_from_exception)
  669. UNWIND(.fnstart )
  670. UNWIND(.cantunwind )
  671. get_thread_info tsk
  672. mov why, #0
  673. b ret_to_user
  674. UNWIND(.fnend )
  675. ENDPROC(__pabt_usr)
  676. ENDPROC(ret_from_exception)
  677. .align 5
  678. __fiq_usr:
  679. usr_entry trace=0
  680. kuser_cmpxchg_check
  681. mov r0, sp @ struct pt_regs *regs
  682. bl handle_fiq_as_nmi
  683. get_thread_info tsk
  684. restore_user_regs fast = 0, offset = 0
  685. UNWIND(.fnend )
  686. ENDPROC(__fiq_usr)
  687. /*
  688. * Register switch for ARMv3 and ARMv4 processors
  689. * r0 = previous task_struct, r1 = previous thread_info, r2 = next thread_info
  690. * previous and next are guaranteed not to be the same.
  691. */
  692. ENTRY(__switch_to)
  693. UNWIND(.fnstart )
  694. UNWIND(.cantunwind )
  695. add ip, r1, #TI_CPU_SAVE
  696. ARM( stmia ip!, {r4 - sl, fp, sp, lr} ) @ Store most regs on stack
  697. THUMB( stmia ip!, {r4 - sl, fp} ) @ Store most regs on stack
  698. THUMB( str sp, [ip], #4 )
  699. THUMB( str lr, [ip], #4 )
  700. ldr r4, [r2, #TI_TP_VALUE]
  701. ldr r5, [r2, #TI_TP_VALUE + 4]
  702. #ifdef CONFIG_CPU_USE_DOMAINS
  703. mrc p15, 0, r6, c3, c0, 0 @ Get domain register
  704. str r6, [r1, #TI_CPU_DOMAIN] @ Save old domain register
  705. ldr r6, [r2, #TI_CPU_DOMAIN]
  706. #endif
  707. switch_tls r1, r4, r5, r3, r7
  708. #if defined(CONFIG_CC_STACKPROTECTOR) && !defined(CONFIG_SMP)
  709. ldr r7, [r2, #TI_TASK]
  710. ldr r8, =__stack_chk_guard
  711. ldr r7, [r7, #TSK_STACK_CANARY]
  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_CC_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. .globl cr_alignment
  1079. cr_alignment:
  1080. .space 4
  1081. #ifdef CONFIG_MULTI_IRQ_HANDLER
  1082. .globl handle_arch_irq
  1083. handle_arch_irq:
  1084. .space 4
  1085. #endif