entry-armv.S 30 KB

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