entry-armv.S 30 KB

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