blob: bd623b73445f79a9b37018e0da7d320d003c2a7c [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/*
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)
Hyok S. Choiafeb90c2006-01-13 21:05:25 +00006 * nommu support by Hyok S. Choi (hyok.choi@samsung.com)
Linus Torvalds1da177e2005-04-16 15:20:36 -07007 *
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 that causes
15 * it to save wrong values... Be aware!
16 */
Linus Torvalds1da177e2005-04-16 15:20:36 -070017
Nicolas Pitref09b9972005-10-29 21:44:55 +010018#include <asm/memory.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070019#include <asm/glue.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070020#include <asm/vfpmacros.h>
Russell Kingbce495d2005-04-26 15:21:02 +010021#include <asm/arch/entry-macro.S>
Russell Kingd6551e82006-06-21 13:31:52 +010022#include <asm/thread_notify.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070023
24#include "entry-header.S"
25
26/*
Russell King187a51a2005-05-21 18:14:44 +010027 * Interrupt handling. Preserves r7, r8, r9
28 */
29 .macro irq_handler
301: get_irqnr_and_base r0, r6, r5, lr
31 movne r1, sp
32 @
33 @ routine called with r0 = irq number, r1 = struct pt_regs *
34 @
35 adrne lr, 1b
36 bne asm_do_IRQ
Russell King791be9b2005-05-21 18:16:44 +010037
38#ifdef CONFIG_SMP
39 /*
40 * XXX
41 *
42 * this macro assumes that irqstat (r6) and base (r5) are
43 * preserved from get_irqnr_and_base above
44 */
45 test_for_ipi r0, r6, r5, lr
46 movne r0, sp
47 adrne lr, 1b
48 bne do_IPI
Russell King37ee16a2005-11-08 19:08:05 +000049
50#ifdef CONFIG_LOCAL_TIMERS
51 test_for_ltirq r0, r6, r5, lr
52 movne r0, sp
53 adrne lr, 1b
54 bne do_local_timer
55#endif
Russell King791be9b2005-05-21 18:16:44 +010056#endif
57
Russell King187a51a2005-05-21 18:14:44 +010058 .endm
59
60/*
Linus Torvalds1da177e2005-04-16 15:20:36 -070061 * Invalid mode handlers
62 */
Russell Kingccea7a12005-05-31 22:22:32 +010063 .macro inv_entry, reason
64 sub sp, sp, #S_FRAME_SIZE
65 stmib sp, {r1 - lr}
Linus Torvalds1da177e2005-04-16 15:20:36 -070066 mov r1, #\reason
67 .endm
68
69__pabt_invalid:
Russell Kingccea7a12005-05-31 22:22:32 +010070 inv_entry BAD_PREFETCH
71 b common_invalid
Linus Torvalds1da177e2005-04-16 15:20:36 -070072
73__dabt_invalid:
Russell Kingccea7a12005-05-31 22:22:32 +010074 inv_entry BAD_DATA
75 b common_invalid
Linus Torvalds1da177e2005-04-16 15:20:36 -070076
77__irq_invalid:
Russell Kingccea7a12005-05-31 22:22:32 +010078 inv_entry BAD_IRQ
79 b common_invalid
Linus Torvalds1da177e2005-04-16 15:20:36 -070080
81__und_invalid:
Russell Kingccea7a12005-05-31 22:22:32 +010082 inv_entry BAD_UNDEFINSTR
Linus Torvalds1da177e2005-04-16 15:20:36 -070083
Russell Kingccea7a12005-05-31 22:22:32 +010084 @
85 @ XXX fall through to common_invalid
86 @
87
88@
89@ common_invalid - generic code for failed exception (re-entrant version of handlers)
90@
91common_invalid:
92 zero_fp
93
94 ldmia r0, {r4 - r6}
95 add r0, sp, #S_PC @ here for interlock avoidance
96 mov r7, #-1 @ "" "" "" ""
97 str r4, [sp] @ save preserved r0
98 stmia r0, {r5 - r7} @ lr_<exception>,
99 @ cpsr_<exception>, "old_r0"
100
Linus Torvalds1da177e2005-04-16 15:20:36 -0700101 mov r0, sp
Russell Kingccea7a12005-05-31 22:22:32 +0100102 and r2, r6, #0x1f
Linus Torvalds1da177e2005-04-16 15:20:36 -0700103 b bad_mode
104
105/*
106 * SVC mode handlers
107 */
Nicolas Pitre2dede2d2006-01-14 16:18:08 +0000108
109#if defined(CONFIG_AEABI) && (__LINUX_ARM_ARCH__ >= 5)
110#define SPFIX(code...) code
111#else
112#define SPFIX(code...)
113#endif
114
Russell Kingccea7a12005-05-31 22:22:32 +0100115 .macro svc_entry
Linus Torvalds1da177e2005-04-16 15:20:36 -0700116 sub sp, sp, #S_FRAME_SIZE
Nicolas Pitre2dede2d2006-01-14 16:18:08 +0000117 SPFIX( tst sp, #4 )
118 SPFIX( bicne sp, sp, #4 )
Russell Kingccea7a12005-05-31 22:22:32 +0100119 stmib sp, {r1 - r12}
120
121 ldmia r0, {r1 - r3}
122 add r5, sp, #S_SP @ here for interlock avoidance
123 mov r4, #-1 @ "" "" "" ""
124 add r0, sp, #S_FRAME_SIZE @ "" "" "" ""
Nicolas Pitre2dede2d2006-01-14 16:18:08 +0000125 SPFIX( addne r0, r0, #4 )
Russell Kingccea7a12005-05-31 22:22:32 +0100126 str r1, [sp] @ save the "real" r0 copied
127 @ from the exception stack
128
Linus Torvalds1da177e2005-04-16 15:20:36 -0700129 mov r1, lr
130
131 @
132 @ We are now ready to fill in the remaining blanks on the stack:
133 @
134 @ r0 - sp_svc
135 @ r1 - lr_svc
136 @ r2 - lr_<exception>, already fixed up for correct return/restart
137 @ r3 - spsr_<exception>
138 @ r4 - orig_r0 (see pt_regs definition in ptrace.h)
139 @
140 stmia r5, {r0 - r4}
141 .endm
142
143 .align 5
144__dabt_svc:
Russell Kingccea7a12005-05-31 22:22:32 +0100145 svc_entry
Linus Torvalds1da177e2005-04-16 15:20:36 -0700146
147 @
148 @ get ready to re-enable interrupts if appropriate
149 @
150 mrs r9, cpsr
151 tst r3, #PSR_I_BIT
152 biceq r9, r9, #PSR_I_BIT
153
154 @
155 @ Call the processor-specific abort handler:
156 @
157 @ r2 - aborted context pc
158 @ r3 - aborted context cpsr
159 @
160 @ The abort handler must return the aborted address in r0, and
161 @ the fault status register in r1. r9 must be preserved.
162 @
163#ifdef MULTI_ABORT
164 ldr r4, .LCprocfns
165 mov lr, pc
166 ldr pc, [r4]
167#else
168 bl CPU_ABORT_HANDLER
169#endif
170
171 @
172 @ set desired IRQ state, then call main handler
173 @
174 msr cpsr_c, r9
175 mov r2, sp
176 bl do_DataAbort
177
178 @
179 @ IRQs off again before pulling preserved data off the stack
180 @
Russell King1ec42c02005-04-26 15:18:26 +0100181 disable_irq
Linus Torvalds1da177e2005-04-16 15:20:36 -0700182
183 @
184 @ restore SPSR and restart the instruction
185 @
186 ldr r0, [sp, #S_PSR]
187 msr spsr_cxsf, r0
188 ldmia sp, {r0 - pc}^ @ load r0 - pc, cpsr
189
190 .align 5
191__irq_svc:
Russell Kingccea7a12005-05-31 22:22:32 +0100192 svc_entry
193
Russell King7ad1bcb2006-08-27 12:07:02 +0100194#ifdef CONFIG_TRACE_IRQFLAGS
195 bl trace_hardirqs_off
196#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -0700197#ifdef CONFIG_PREEMPT
Russell King706fdd92005-05-21 18:15:45 +0100198 get_thread_info tsk
199 ldr r8, [tsk, #TI_PREEMPT] @ get preempt count
200 add r7, r8, #1 @ increment it
201 str r7, [tsk, #TI_PREEMPT]
Linus Torvalds1da177e2005-04-16 15:20:36 -0700202#endif
Russell Kingccea7a12005-05-31 22:22:32 +0100203
Russell King187a51a2005-05-21 18:14:44 +0100204 irq_handler
Linus Torvalds1da177e2005-04-16 15:20:36 -0700205#ifdef CONFIG_PREEMPT
Russell King706fdd92005-05-21 18:15:45 +0100206 ldr r0, [tsk, #TI_FLAGS] @ get flags
Linus Torvalds1da177e2005-04-16 15:20:36 -0700207 tst r0, #_TIF_NEED_RESCHED
208 blne svc_preempt
209preempt_return:
Russell King706fdd92005-05-21 18:15:45 +0100210 ldr r0, [tsk, #TI_PREEMPT] @ read preempt value
211 str r8, [tsk, #TI_PREEMPT] @ restore preempt count
Linus Torvalds1da177e2005-04-16 15:20:36 -0700212 teq r0, r7
Linus Torvalds1da177e2005-04-16 15:20:36 -0700213 strne r0, [r0, -r0] @ bug()
214#endif
215 ldr r0, [sp, #S_PSR] @ irqs are already disabled
216 msr spsr_cxsf, r0
Russell King7ad1bcb2006-08-27 12:07:02 +0100217#ifdef CONFIG_TRACE_IRQFLAGS
218 tst r0, #PSR_I_BIT
219 bleq trace_hardirqs_on
220#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -0700221 ldmia sp, {r0 - pc}^ @ load r0 - pc, cpsr
222
223 .ltorg
224
225#ifdef CONFIG_PREEMPT
226svc_preempt:
Russell King706fdd92005-05-21 18:15:45 +0100227 teq r8, #0 @ was preempt count = 0
Linus Torvalds1da177e2005-04-16 15:20:36 -0700228 ldreq r6, .LCirq_stat
229 movne pc, lr @ no
230 ldr r0, [r6, #4] @ local_irq_count
231 ldr r1, [r6, #8] @ local_bh_count
232 adds r0, r0, r1
233 movne pc, lr
234 mov r7, #0 @ preempt_schedule_irq
Russell King706fdd92005-05-21 18:15:45 +0100235 str r7, [tsk, #TI_PREEMPT] @ expects preempt_count == 0
Linus Torvalds1da177e2005-04-16 15:20:36 -07002361: bl preempt_schedule_irq @ irq en/disable is done inside
Russell King706fdd92005-05-21 18:15:45 +0100237 ldr r0, [tsk, #TI_FLAGS] @ get new tasks TI_FLAGS
Linus Torvalds1da177e2005-04-16 15:20:36 -0700238 tst r0, #_TIF_NEED_RESCHED
239 beq preempt_return @ go again
240 b 1b
241#endif
242
243 .align 5
244__und_svc:
Russell Kingccea7a12005-05-31 22:22:32 +0100245 svc_entry
Linus Torvalds1da177e2005-04-16 15:20:36 -0700246
247 @
248 @ call emulation code, which returns using r9 if it has emulated
249 @ the instruction, or the more conventional lr if we are to treat
250 @ this as a real undefined instruction
251 @
252 @ r0 - instruction
253 @
254 ldr r0, [r2, #-4]
255 adr r9, 1f
256 bl call_fpe
257
258 mov r0, sp @ struct pt_regs *regs
259 bl do_undefinstr
260
261 @
262 @ IRQs off again before pulling preserved data off the stack
263 @
Russell King1ec42c02005-04-26 15:18:26 +01002641: disable_irq
Linus Torvalds1da177e2005-04-16 15:20:36 -0700265
266 @
267 @ restore SPSR and restart the instruction
268 @
269 ldr lr, [sp, #S_PSR] @ Get SVC cpsr
270 msr spsr_cxsf, lr
271 ldmia sp, {r0 - pc}^ @ Restore SVC registers
272
273 .align 5
274__pabt_svc:
Russell Kingccea7a12005-05-31 22:22:32 +0100275 svc_entry
Linus Torvalds1da177e2005-04-16 15:20:36 -0700276
277 @
278 @ re-enable interrupts if appropriate
279 @
280 mrs r9, cpsr
281 tst r3, #PSR_I_BIT
282 biceq r9, r9, #PSR_I_BIT
283 msr cpsr_c, r9
284
285 @
286 @ set args, then call main handler
287 @
288 @ r0 - address of faulting instruction
289 @ r1 - pointer to registers on stack
290 @
291 mov r0, r2 @ address (pc)
292 mov r1, sp @ regs
293 bl do_PrefetchAbort @ call abort handler
294
295 @
296 @ IRQs off again before pulling preserved data off the stack
297 @
Russell King1ec42c02005-04-26 15:18:26 +0100298 disable_irq
Linus Torvalds1da177e2005-04-16 15:20:36 -0700299
300 @
301 @ restore SPSR and restart the instruction
302 @
303 ldr r0, [sp, #S_PSR]
304 msr spsr_cxsf, r0
305 ldmia sp, {r0 - pc}^ @ load r0 - pc, cpsr
306
307 .align 5
Russell King49f680e2005-05-31 18:02:00 +0100308.LCcralign:
309 .word cr_alignment
Linus Torvalds1da177e2005-04-16 15:20:36 -0700310#ifdef MULTI_ABORT
311.LCprocfns:
312 .word processor
313#endif
314.LCfp:
315 .word fp_enter
316#ifdef CONFIG_PREEMPT
317.LCirq_stat:
318 .word irq_stat
319#endif
320
321/*
322 * User mode handlers
Nicolas Pitre2dede2d2006-01-14 16:18:08 +0000323 *
324 * EABI note: sp_svc is always 64-bit aligned here, so should S_FRAME_SIZE
Linus Torvalds1da177e2005-04-16 15:20:36 -0700325 */
Nicolas Pitre2dede2d2006-01-14 16:18:08 +0000326
327#if defined(CONFIG_AEABI) && (__LINUX_ARM_ARCH__ >= 5) && (S_FRAME_SIZE & 7)
328#error "sizeof(struct pt_regs) must be a multiple of 8"
329#endif
330
Russell Kingccea7a12005-05-31 22:22:32 +0100331 .macro usr_entry
332 sub sp, sp, #S_FRAME_SIZE
333 stmib sp, {r1 - r12}
334
335 ldmia r0, {r1 - r3}
336 add r0, sp, #S_PC @ here for interlock avoidance
337 mov r4, #-1 @ "" "" "" ""
338
339 str r1, [sp] @ save the "real" r0 copied
340 @ from the exception stack
Linus Torvalds1da177e2005-04-16 15:20:36 -0700341
Nicolas Pitredcef1f62005-06-08 19:00:47 +0100342#if __LINUX_ARM_ARCH__ < 6 && !defined(CONFIG_NEEDS_SYSCALL_FOR_CMPXCHG)
Nicolas Pitre49bca4c2006-02-08 21:19:37 +0000343#ifndef CONFIG_MMU
344#warning "NPTL on non MMU needs fixing"
345#else
Nicolas Pitre2d2669b2005-04-29 22:08:33 +0100346 @ make sure our user space atomic helper is aborted
Nicolas Pitref09b9972005-10-29 21:44:55 +0100347 cmp r2, #TASK_SIZE
Nicolas Pitre2d2669b2005-04-29 22:08:33 +0100348 bichs r3, r3, #PSR_Z_BIT
349#endif
Nicolas Pitre49bca4c2006-02-08 21:19:37 +0000350#endif
Nicolas Pitre2d2669b2005-04-29 22:08:33 +0100351
Linus Torvalds1da177e2005-04-16 15:20:36 -0700352 @
353 @ We are now ready to fill in the remaining blanks on the stack:
354 @
355 @ r2 - lr_<exception>, already fixed up for correct return/restart
356 @ r3 - spsr_<exception>
357 @ r4 - orig_r0 (see pt_regs definition in ptrace.h)
358 @
359 @ Also, separately save sp_usr and lr_usr
360 @
Russell Kingccea7a12005-05-31 22:22:32 +0100361 stmia r0, {r2 - r4}
362 stmdb r0, {sp, lr}^
Linus Torvalds1da177e2005-04-16 15:20:36 -0700363
364 @
365 @ Enable the alignment trap while in kernel mode
366 @
Russell King49f680e2005-05-31 18:02:00 +0100367 alignment_trap r0
Linus Torvalds1da177e2005-04-16 15:20:36 -0700368
369 @
370 @ Clear FP to mark the first stack frame
371 @
372 zero_fp
373 .endm
374
375 .align 5
376__dabt_usr:
Russell Kingccea7a12005-05-31 22:22:32 +0100377 usr_entry
Linus Torvalds1da177e2005-04-16 15:20:36 -0700378
379 @
380 @ Call the processor-specific abort handler:
381 @
382 @ r2 - aborted context pc
383 @ r3 - aborted context cpsr
384 @
385 @ The abort handler must return the aborted address in r0, and
386 @ the fault status register in r1.
387 @
388#ifdef MULTI_ABORT
389 ldr r4, .LCprocfns
390 mov lr, pc
391 ldr pc, [r4]
392#else
393 bl CPU_ABORT_HANDLER
394#endif
395
396 @
397 @ IRQs on, then call the main handler
398 @
Russell King1ec42c02005-04-26 15:18:26 +0100399 enable_irq
Linus Torvalds1da177e2005-04-16 15:20:36 -0700400 mov r2, sp
401 adr lr, ret_from_exception
402 b do_DataAbort
403
404 .align 5
405__irq_usr:
Russell Kingccea7a12005-05-31 22:22:32 +0100406 usr_entry
Linus Torvalds1da177e2005-04-16 15:20:36 -0700407
Russell King7ad1bcb2006-08-27 12:07:02 +0100408#ifdef CONFIG_TRACE_IRQFLAGS
409 bl trace_hardirqs_off
410#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -0700411 get_thread_info tsk
Linus Torvalds1da177e2005-04-16 15:20:36 -0700412#ifdef CONFIG_PREEMPT
Russell King706fdd92005-05-21 18:15:45 +0100413 ldr r8, [tsk, #TI_PREEMPT] @ get preempt count
414 add r7, r8, #1 @ increment it
415 str r7, [tsk, #TI_PREEMPT]
Linus Torvalds1da177e2005-04-16 15:20:36 -0700416#endif
Russell Kingccea7a12005-05-31 22:22:32 +0100417
Russell King187a51a2005-05-21 18:14:44 +0100418 irq_handler
Linus Torvalds1da177e2005-04-16 15:20:36 -0700419#ifdef CONFIG_PREEMPT
Russell King706fdd92005-05-21 18:15:45 +0100420 ldr r0, [tsk, #TI_PREEMPT]
421 str r8, [tsk, #TI_PREEMPT]
Linus Torvalds1da177e2005-04-16 15:20:36 -0700422 teq r0, r7
Linus Torvalds1da177e2005-04-16 15:20:36 -0700423 strne r0, [r0, -r0]
Linus Torvalds1da177e2005-04-16 15:20:36 -0700424#endif
Russell King7ad1bcb2006-08-27 12:07:02 +0100425#ifdef CONFIG_TRACE_IRQFLAGS
426 bl trace_hardirqs_on
427#endif
Russell Kingccea7a12005-05-31 22:22:32 +0100428
Linus Torvalds1da177e2005-04-16 15:20:36 -0700429 mov why, #0
430 b ret_to_user
431
432 .ltorg
433
434 .align 5
435__und_usr:
Russell Kingccea7a12005-05-31 22:22:32 +0100436 usr_entry
Linus Torvalds1da177e2005-04-16 15:20:36 -0700437
438 tst r3, #PSR_T_BIT @ Thumb mode?
439 bne fpundefinstr @ ignore FP
440 sub r4, r2, #4
441
442 @
443 @ fall through to the emulation code, which returns using r9 if
444 @ it has emulated the instruction, or the more conventional lr
445 @ if we are to treat this as a real undefined instruction
446 @
447 @ r0 - instruction
448 @
4491: ldrt r0, [r4]
450 adr r9, ret_from_exception
451 adr lr, fpundefinstr
452 @
453 @ fallthrough to call_fpe
454 @
455
456/*
457 * The out of line fixup for the ldrt above.
458 */
459 .section .fixup, "ax"
4602: mov pc, r9
461 .previous
462 .section __ex_table,"a"
463 .long 1b, 2b
464 .previous
465
466/*
467 * Check whether the instruction is a co-processor instruction.
468 * If yes, we need to call the relevant co-processor handler.
469 *
470 * Note that we don't do a full check here for the co-processor
471 * instructions; all instructions with bit 27 set are well
472 * defined. The only instructions that should fault are the
473 * co-processor instructions. However, we have to watch out
474 * for the ARM6/ARM7 SWI bug.
475 *
476 * Emulators may wish to make use of the following registers:
477 * r0 = instruction opcode.
478 * r2 = PC+4
479 * r10 = this threads thread_info structure.
480 */
481call_fpe:
482 tst r0, #0x08000000 @ only CDP/CPRT/LDC/STC have bit 27
483#if defined(CONFIG_CPU_ARM610) || defined(CONFIG_CPU_ARM710)
484 and r8, r0, #0x0f000000 @ mask out op-code bits
485 teqne r8, #0x0f000000 @ SWI (ARM6/7 bug)?
486#endif
487 moveq pc, lr
488 get_thread_info r10 @ get current thread
489 and r8, r0, #0x00000f00 @ mask out CP number
490 mov r7, #1
491 add r6, r10, #TI_USED_CP
492 strb r7, [r6, r8, lsr #8] @ set appropriate used_cp[]
493#ifdef CONFIG_IWMMXT
494 @ Test if we need to give access to iWMMXt coprocessors
495 ldr r5, [r10, #TI_FLAGS]
496 rsbs r7, r8, #(1 << 8) @ CP 0 or 1 only
497 movcss r7, r5, lsr #(TIF_USING_IWMMXT + 1)
498 bcs iwmmxt_task_enable
499#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -0700500 add pc, pc, r8, lsr #6
501 mov r0, r0
502
503 mov pc, lr @ CP#0
504 b do_fpe @ CP#1 (FPE)
505 b do_fpe @ CP#2 (FPE)
506 mov pc, lr @ CP#3
Lennert Buytenhekc17fad12006-06-27 23:03:03 +0100507#ifdef CONFIG_CRUNCH
508 b crunch_task_enable @ CP#4 (MaverickCrunch)
509 b crunch_task_enable @ CP#5 (MaverickCrunch)
510 b crunch_task_enable @ CP#6 (MaverickCrunch)
511#else
Linus Torvalds1da177e2005-04-16 15:20:36 -0700512 mov pc, lr @ CP#4
513 mov pc, lr @ CP#5
514 mov pc, lr @ CP#6
Lennert Buytenhekc17fad12006-06-27 23:03:03 +0100515#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -0700516 mov pc, lr @ CP#7
517 mov pc, lr @ CP#8
518 mov pc, lr @ CP#9
519#ifdef CONFIG_VFP
520 b do_vfp @ CP#10 (VFP)
521 b do_vfp @ CP#11 (VFP)
522#else
523 mov pc, lr @ CP#10 (VFP)
524 mov pc, lr @ CP#11 (VFP)
525#endif
526 mov pc, lr @ CP#12
527 mov pc, lr @ CP#13
528 mov pc, lr @ CP#14 (Debug)
529 mov pc, lr @ CP#15 (Control)
530
531do_fpe:
Russell King5d25ac02006-03-15 12:33:43 +0000532 enable_irq
Linus Torvalds1da177e2005-04-16 15:20:36 -0700533 ldr r4, .LCfp
534 add r10, r10, #TI_FPSTATE @ r10 = workspace
535 ldr pc, [r4] @ Call FP module USR entry point
536
537/*
538 * The FP module is called with these registers set:
539 * r0 = instruction
540 * r2 = PC+4
541 * r9 = normal "successful" return address
542 * r10 = FP workspace
543 * lr = unrecognised FP instruction return address
544 */
545
546 .data
547ENTRY(fp_enter)
548 .word fpundefinstr
549 .text
550
551fpundefinstr:
552 mov r0, sp
553 adr lr, ret_from_exception
554 b do_undefinstr
555
556 .align 5
557__pabt_usr:
Russell Kingccea7a12005-05-31 22:22:32 +0100558 usr_entry
Linus Torvalds1da177e2005-04-16 15:20:36 -0700559
Russell King1ec42c02005-04-26 15:18:26 +0100560 enable_irq @ Enable interrupts
Linus Torvalds1da177e2005-04-16 15:20:36 -0700561 mov r0, r2 @ address (pc)
562 mov r1, sp @ regs
563 bl do_PrefetchAbort @ call abort handler
564 /* fall through */
565/*
566 * This is the return code to user mode for abort handlers
567 */
568ENTRY(ret_from_exception)
569 get_thread_info tsk
570 mov why, #0
571 b ret_to_user
572
573/*
574 * Register switch for ARMv3 and ARMv4 processors
575 * r0 = previous task_struct, r1 = previous thread_info, r2 = next thread_info
576 * previous and next are guaranteed not to be the same.
577 */
578ENTRY(__switch_to)
579 add ip, r1, #TI_CPU_SAVE
580 ldr r3, [r2, #TI_TP_VALUE]
581 stmia ip!, {r4 - sl, fp, sp, lr} @ Store most regs on stack
Russell Kingd6551e82006-06-21 13:31:52 +0100582#ifdef CONFIG_MMU
583 ldr r6, [r2, #TI_CPU_DOMAIN]
Hyok S. Choiafeb90c2006-01-13 21:05:25 +0000584#endif
Russell Kingb8763862005-08-10 14:52:52 +0100585#if __LINUX_ARM_ARCH__ >= 6
Russell King43cc1982006-02-22 21:13:28 +0000586#ifdef CONFIG_CPU_32v6K
Russell Kingb8763862005-08-10 14:52:52 +0100587 clrex
588#else
Russell King73394322005-09-23 21:49:58 +0100589 strex r5, r4, [ip] @ Clear exclusive monitor
Russell Kingb8763862005-08-10 14:52:52 +0100590#endif
591#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -0700592#if defined(CONFIG_CPU_XSCALE) && !defined(CONFIG_IWMMXT)
593 mra r4, r5, acc0
594 stmia ip, {r4, r5}
595#endif
Nicolas Pitre4b0e07a2005-05-05 23:24:45 +0100596#if defined(CONFIG_HAS_TLS_REG)
Nicolas Pitre2d2669b2005-04-29 22:08:33 +0100597 mcr p15, 0, r3, c13, c0, 3 @ set TLS register
Nicolas Pitre4b0e07a2005-05-05 23:24:45 +0100598#elif !defined(CONFIG_TLS_REG_EMUL)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700599 mov r4, #0xffff0fff
Nicolas Pitre2d2669b2005-04-29 22:08:33 +0100600 str r3, [r4, #-15] @ TLS val at 0xffff0ff0
601#endif
Hyok S. Choiafeb90c2006-01-13 21:05:25 +0000602#ifdef CONFIG_MMU
Linus Torvalds1da177e2005-04-16 15:20:36 -0700603 mcr p15, 0, r6, c3, c0, 0 @ Set domain register
Hyok S. Choiafeb90c2006-01-13 21:05:25 +0000604#endif
Lennert Buytenhekae95bfb2006-07-01 19:56:48 +0100605#if defined(CONFIG_CPU_XSCALE) && !defined(CONFIG_IWMMXT)
Russell Kingd6551e82006-06-21 13:31:52 +0100606 add r4, r2, #TI_CPU_DOMAIN + 40 @ cpu_context_save->extra
Linus Torvalds1da177e2005-04-16 15:20:36 -0700607 ldmib r4, {r4, r5}
608 mar acc0, r4, r5
609#endif
Russell Kingd6551e82006-06-21 13:31:52 +0100610 mov r5, r0
611 add r4, r2, #TI_CPU_SAVE
612 ldr r0, =thread_notify_head
613 mov r1, #THREAD_NOTIFY_SWITCH
614 bl atomic_notifier_call_chain
615 mov r0, r5
616 ldmia r4, {r4 - sl, fp, sp, pc} @ Load all regs saved previously
Linus Torvalds1da177e2005-04-16 15:20:36 -0700617
618 __INIT
Nicolas Pitre2d2669b2005-04-29 22:08:33 +0100619
620/*
621 * User helpers.
622 *
623 * These are segment of kernel provided user code reachable from user space
624 * at a fixed address in kernel memory. This is used to provide user space
625 * with some operations which require kernel help because of unimplemented
626 * native feature and/or instructions in many ARM CPUs. The idea is for
627 * this code to be executed directly in user mode for best efficiency but
628 * which is too intimate with the kernel counter part to be left to user
629 * libraries. In fact this code might even differ from one CPU to another
630 * depending on the available instruction set and restrictions like on
631 * SMP systems. In other words, the kernel reserves the right to change
632 * this code as needed without warning. Only the entry points and their
633 * results are guaranteed to be stable.
634 *
635 * Each segment is 32-byte aligned and will be moved to the top of the high
636 * vector page. New segments (if ever needed) must be added in front of
637 * existing ones. This mechanism should be used only for things that are
638 * really small and justified, and not be abused freely.
639 *
640 * User space is expected to implement those things inline when optimizing
641 * for a processor that has the necessary native support, but only if such
642 * resulting binaries are already to be incompatible with earlier ARM
643 * processors due to the use of unsupported instructions other than what
644 * is provided here. In other words don't make binaries unable to run on
645 * earlier processors just for the sake of not using these kernel helpers
646 * if your compiled code is not going to use the new instructions for other
647 * purpose.
648 */
649
Nicolas Pitreba9b5d72006-08-18 17:20:15 +0100650 .macro usr_ret, reg
651#ifdef CONFIG_ARM_THUMB
652 bx \reg
653#else
654 mov pc, \reg
655#endif
656 .endm
657
Nicolas Pitre2d2669b2005-04-29 22:08:33 +0100658 .align 5
659 .globl __kuser_helper_start
660__kuser_helper_start:
661
662/*
663 * Reference prototype:
664 *
Nicolas Pitre7c612bf2005-12-19 22:20:51 +0000665 * void __kernel_memory_barrier(void)
666 *
667 * Input:
668 *
669 * lr = return address
670 *
671 * Output:
672 *
673 * none
674 *
675 * Clobbered:
676 *
677 * the Z flag might be lost
678 *
679 * Definition and user space usage example:
680 *
681 * typedef void (__kernel_dmb_t)(void);
682 * #define __kernel_dmb (*(__kernel_dmb_t *)0xffff0fa0)
683 *
684 * Apply any needed memory barrier to preserve consistency with data modified
685 * manually and __kuser_cmpxchg usage.
686 *
687 * This could be used as follows:
688 *
689 * #define __kernel_dmb() \
690 * asm volatile ( "mov r0, #0xffff0fff; mov lr, pc; sub pc, r0, #95" \
Paul Brook6896eec2006-03-28 22:19:29 +0100691 * : : : "r0", "lr","cc" )
Nicolas Pitre7c612bf2005-12-19 22:20:51 +0000692 */
693
694__kuser_memory_barrier: @ 0xffff0fa0
695
696#if __LINUX_ARM_ARCH__ >= 6 && defined(CONFIG_SMP)
697 mcr p15, 0, r0, c7, c10, 5 @ dmb
698#endif
Nicolas Pitreba9b5d72006-08-18 17:20:15 +0100699 usr_ret lr
Nicolas Pitre7c612bf2005-12-19 22:20:51 +0000700
701 .align 5
702
703/*
704 * Reference prototype:
705 *
Nicolas Pitre2d2669b2005-04-29 22:08:33 +0100706 * int __kernel_cmpxchg(int oldval, int newval, int *ptr)
707 *
708 * Input:
709 *
710 * r0 = oldval
711 * r1 = newval
712 * r2 = ptr
713 * lr = return address
714 *
715 * Output:
716 *
717 * r0 = returned value (zero or non-zero)
718 * C flag = set if r0 == 0, clear if r0 != 0
719 *
720 * Clobbered:
721 *
722 * r3, ip, flags
723 *
724 * Definition and user space usage example:
725 *
726 * typedef int (__kernel_cmpxchg_t)(int oldval, int newval, int *ptr);
727 * #define __kernel_cmpxchg (*(__kernel_cmpxchg_t *)0xffff0fc0)
728 *
729 * Atomically store newval in *ptr if *ptr is equal to oldval for user space.
730 * Return zero if *ptr was changed or non-zero if no exchange happened.
731 * The C flag is also set if *ptr was changed to allow for assembly
732 * optimization in the calling code.
733 *
Nicolas Pitre5964eae2006-02-08 21:19:37 +0000734 * Notes:
735 *
736 * - This routine already includes memory barriers as needed.
737 *
738 * - A failure might be transient, i.e. it is possible, although unlikely,
739 * that "failure" be returned even if *ptr == oldval.
Nicolas Pitre7c612bf2005-12-19 22:20:51 +0000740 *
Nicolas Pitre2d2669b2005-04-29 22:08:33 +0100741 * For example, a user space atomic_add implementation could look like this:
742 *
743 * #define atomic_add(ptr, val) \
744 * ({ register unsigned int *__ptr asm("r2") = (ptr); \
745 * register unsigned int __result asm("r1"); \
746 * asm volatile ( \
747 * "1: @ atomic_add\n\t" \
748 * "ldr r0, [r2]\n\t" \
749 * "mov r3, #0xffff0fff\n\t" \
750 * "add lr, pc, #4\n\t" \
751 * "add r1, r0, %2\n\t" \
752 * "add pc, r3, #(0xffff0fc0 - 0xffff0fff)\n\t" \
753 * "bcc 1b" \
754 * : "=&r" (__result) \
755 * : "r" (__ptr), "rIL" (val) \
756 * : "r0","r3","ip","lr","cc","memory" ); \
757 * __result; })
758 */
759
760__kuser_cmpxchg: @ 0xffff0fc0
761
Nicolas Pitredcef1f62005-06-08 19:00:47 +0100762#if defined(CONFIG_NEEDS_SYSCALL_FOR_CMPXCHG)
Nicolas Pitre2d2669b2005-04-29 22:08:33 +0100763
Nicolas Pitredcef1f62005-06-08 19:00:47 +0100764 /*
765 * Poor you. No fast solution possible...
766 * The kernel itself must perform the operation.
767 * A special ghost syscall is used for that (see traps.c).
768 */
Nicolas Pitre5e097442006-01-18 22:38:49 +0000769 stmfd sp!, {r7, lr}
770 mov r7, #0xff00 @ 0xfff0 into r7 for EABI
771 orr r7, r7, #0xf0
Nicolas Pitredcef1f62005-06-08 19:00:47 +0100772 swi #0x9ffff0
Nicolas Pitre5e097442006-01-18 22:38:49 +0000773 ldmfd sp!, {r7, pc}
Nicolas Pitredcef1f62005-06-08 19:00:47 +0100774
775#elif __LINUX_ARM_ARCH__ < 6
Nicolas Pitre2d2669b2005-04-29 22:08:33 +0100776
777 /*
778 * Theory of operation:
779 *
780 * We set the Z flag before loading oldval. If ever an exception
781 * occurs we can not be sure the loaded value will still be the same
782 * when the exception returns, therefore the user exception handler
783 * will clear the Z flag whenever the interrupted user code was
784 * actually from the kernel address space (see the usr_entry macro).
785 *
786 * The post-increment on the str is used to prevent a race with an
787 * exception happening just after the str instruction which would
788 * clear the Z flag although the exchange was done.
789 */
Nicolas Pitre49bca4c2006-02-08 21:19:37 +0000790#ifdef CONFIG_MMU
Nicolas Pitre2d2669b2005-04-29 22:08:33 +0100791 teq ip, ip @ set Z flag
792 ldr ip, [r2] @ load current val
793 add r3, r2, #1 @ prepare store ptr
794 teqeq ip, r0 @ compare with oldval if still allowed
795 streq r1, [r3, #-1]! @ store newval if still allowed
796 subs r0, r2, r3 @ if r2 == r3 the str occured
Nicolas Pitre49bca4c2006-02-08 21:19:37 +0000797#else
798#warning "NPTL on non MMU needs fixing"
799 mov r0, #-1
800 adds r0, r0, #0
801#endif
Nicolas Pitreba9b5d72006-08-18 17:20:15 +0100802 usr_ret lr
Nicolas Pitre2d2669b2005-04-29 22:08:33 +0100803
804#else
805
Nicolas Pitre7c612bf2005-12-19 22:20:51 +0000806#ifdef CONFIG_SMP
807 mcr p15, 0, r0, c7, c10, 5 @ dmb
808#endif
Nicolas Pitre2d2669b2005-04-29 22:08:33 +0100809 ldrex r3, [r2]
810 subs r3, r3, r0
811 strexeq r3, r1, [r2]
812 rsbs r0, r3, #0
Nicolas Pitre7c612bf2005-12-19 22:20:51 +0000813#ifdef CONFIG_SMP
814 mcr p15, 0, r0, c7, c10, 5 @ dmb
815#endif
Nicolas Pitreba9b5d72006-08-18 17:20:15 +0100816 usr_ret lr
Nicolas Pitre2d2669b2005-04-29 22:08:33 +0100817
818#endif
819
820 .align 5
821
822/*
823 * Reference prototype:
824 *
825 * int __kernel_get_tls(void)
826 *
827 * Input:
828 *
829 * lr = return address
830 *
831 * Output:
832 *
833 * r0 = TLS value
834 *
835 * Clobbered:
836 *
837 * the Z flag might be lost
838 *
839 * Definition and user space usage example:
840 *
841 * typedef int (__kernel_get_tls_t)(void);
842 * #define __kernel_get_tls (*(__kernel_get_tls_t *)0xffff0fe0)
843 *
844 * Get the TLS value as previously set via the __ARM_NR_set_tls syscall.
845 *
846 * This could be used as follows:
847 *
848 * #define __kernel_get_tls() \
849 * ({ register unsigned int __val asm("r0"); \
850 * asm( "mov r0, #0xffff0fff; mov lr, pc; sub pc, r0, #31" \
851 * : "=r" (__val) : : "lr","cc" ); \
852 * __val; })
853 */
854
855__kuser_get_tls: @ 0xffff0fe0
856
Nicolas Pitre4b0e07a2005-05-05 23:24:45 +0100857#if !defined(CONFIG_HAS_TLS_REG) && !defined(CONFIG_TLS_REG_EMUL)
Nicolas Pitre2d2669b2005-04-29 22:08:33 +0100858 ldr r0, [pc, #(16 - 8)] @ TLS stored at 0xffff0ff0
Nicolas Pitre2d2669b2005-04-29 22:08:33 +0100859#else
Nicolas Pitre2d2669b2005-04-29 22:08:33 +0100860 mrc p15, 0, r0, c13, c0, 3 @ read TLS register
Nicolas Pitre2d2669b2005-04-29 22:08:33 +0100861#endif
Nicolas Pitreba9b5d72006-08-18 17:20:15 +0100862 usr_ret lr
Nicolas Pitre2d2669b2005-04-29 22:08:33 +0100863
864 .rep 5
865 .word 0 @ pad up to __kuser_helper_version
866 .endr
867
868/*
869 * Reference declaration:
870 *
871 * extern unsigned int __kernel_helper_version;
872 *
873 * Definition and user space usage example:
874 *
875 * #define __kernel_helper_version (*(unsigned int *)0xffff0ffc)
876 *
877 * User space may read this to determine the curent number of helpers
878 * available.
879 */
880
881__kuser_helper_version: @ 0xffff0ffc
882 .word ((__kuser_helper_end - __kuser_helper_start) >> 5)
883
884 .globl __kuser_helper_end
885__kuser_helper_end:
886
887
Linus Torvalds1da177e2005-04-16 15:20:36 -0700888/*
889 * Vector stubs.
890 *
Russell King79335232005-04-26 15:17:42 +0100891 * This code is copied to 0xffff0200 so we can use branches in the
892 * vectors, rather than ldr's. Note that this code must not
893 * exceed 0x300 bytes.
Linus Torvalds1da177e2005-04-16 15:20:36 -0700894 *
895 * Common stub entry macro:
896 * Enter in IRQ mode, spsr = SVC/USR CPSR, lr = SVC/USR PC
Russell Kingccea7a12005-05-31 22:22:32 +0100897 *
898 * SP points to a minimal amount of processor-private memory, the address
899 * of which is copied into r0 for the mode specific abort handler.
Linus Torvalds1da177e2005-04-16 15:20:36 -0700900 */
Nicolas Pitreb7ec4792005-11-06 14:42:37 +0000901 .macro vector_stub, name, mode, correction=0
Linus Torvalds1da177e2005-04-16 15:20:36 -0700902 .align 5
903
904vector_\name:
Linus Torvalds1da177e2005-04-16 15:20:36 -0700905 .if \correction
906 sub lr, lr, #\correction
907 .endif
Linus Torvalds1da177e2005-04-16 15:20:36 -0700908
Russell Kingccea7a12005-05-31 22:22:32 +0100909 @
910 @ Save r0, lr_<exception> (parent PC) and spsr_<exception>
911 @ (parent CPSR)
912 @
913 stmia sp, {r0, lr} @ save r0, lr
914 mrs lr, spsr
915 str lr, [sp, #8] @ save spsr
916
917 @
918 @ Prepare for SVC32 mode. IRQs remain disabled.
919 @
920 mrs r0, cpsr
Nicolas Pitreb7ec4792005-11-06 14:42:37 +0000921 eor r0, r0, #(\mode ^ SVC_MODE)
Russell Kingccea7a12005-05-31 22:22:32 +0100922 msr spsr_cxsf, r0
923
924 @
925 @ the branch table must immediately follow this code
926 @
Russell Kingccea7a12005-05-31 22:22:32 +0100927 and lr, lr, #0x0f
Nicolas Pitreb7ec4792005-11-06 14:42:37 +0000928 mov r0, sp
Linus Torvalds1da177e2005-04-16 15:20:36 -0700929 ldr lr, [pc, lr, lsl #2]
Russell Kingccea7a12005-05-31 22:22:32 +0100930 movs pc, lr @ branch to handler in SVC mode
Linus Torvalds1da177e2005-04-16 15:20:36 -0700931 .endm
932
Russell King79335232005-04-26 15:17:42 +0100933 .globl __stubs_start
Linus Torvalds1da177e2005-04-16 15:20:36 -0700934__stubs_start:
935/*
936 * Interrupt dispatcher
937 */
Nicolas Pitreb7ec4792005-11-06 14:42:37 +0000938 vector_stub irq, IRQ_MODE, 4
Linus Torvalds1da177e2005-04-16 15:20:36 -0700939
940 .long __irq_usr @ 0 (USR_26 / USR_32)
941 .long __irq_invalid @ 1 (FIQ_26 / FIQ_32)
942 .long __irq_invalid @ 2 (IRQ_26 / IRQ_32)
943 .long __irq_svc @ 3 (SVC_26 / SVC_32)
944 .long __irq_invalid @ 4
945 .long __irq_invalid @ 5
946 .long __irq_invalid @ 6
947 .long __irq_invalid @ 7
948 .long __irq_invalid @ 8
949 .long __irq_invalid @ 9
950 .long __irq_invalid @ a
951 .long __irq_invalid @ b
952 .long __irq_invalid @ c
953 .long __irq_invalid @ d
954 .long __irq_invalid @ e
955 .long __irq_invalid @ f
956
957/*
958 * Data abort dispatcher
959 * Enter in ABT mode, spsr = USR CPSR, lr = USR PC
960 */
Nicolas Pitreb7ec4792005-11-06 14:42:37 +0000961 vector_stub dabt, ABT_MODE, 8
Linus Torvalds1da177e2005-04-16 15:20:36 -0700962
963 .long __dabt_usr @ 0 (USR_26 / USR_32)
964 .long __dabt_invalid @ 1 (FIQ_26 / FIQ_32)
965 .long __dabt_invalid @ 2 (IRQ_26 / IRQ_32)
966 .long __dabt_svc @ 3 (SVC_26 / SVC_32)
967 .long __dabt_invalid @ 4
968 .long __dabt_invalid @ 5
969 .long __dabt_invalid @ 6
970 .long __dabt_invalid @ 7
971 .long __dabt_invalid @ 8
972 .long __dabt_invalid @ 9
973 .long __dabt_invalid @ a
974 .long __dabt_invalid @ b
975 .long __dabt_invalid @ c
976 .long __dabt_invalid @ d
977 .long __dabt_invalid @ e
978 .long __dabt_invalid @ f
979
980/*
981 * Prefetch abort dispatcher
982 * Enter in ABT mode, spsr = USR CPSR, lr = USR PC
983 */
Nicolas Pitreb7ec4792005-11-06 14:42:37 +0000984 vector_stub pabt, ABT_MODE, 4
Linus Torvalds1da177e2005-04-16 15:20:36 -0700985
986 .long __pabt_usr @ 0 (USR_26 / USR_32)
987 .long __pabt_invalid @ 1 (FIQ_26 / FIQ_32)
988 .long __pabt_invalid @ 2 (IRQ_26 / IRQ_32)
989 .long __pabt_svc @ 3 (SVC_26 / SVC_32)
990 .long __pabt_invalid @ 4
991 .long __pabt_invalid @ 5
992 .long __pabt_invalid @ 6
993 .long __pabt_invalid @ 7
994 .long __pabt_invalid @ 8
995 .long __pabt_invalid @ 9
996 .long __pabt_invalid @ a
997 .long __pabt_invalid @ b
998 .long __pabt_invalid @ c
999 .long __pabt_invalid @ d
1000 .long __pabt_invalid @ e
1001 .long __pabt_invalid @ f
1002
1003/*
1004 * Undef instr entry dispatcher
1005 * Enter in UND mode, spsr = SVC/USR CPSR, lr = SVC/USR PC
1006 */
Nicolas Pitreb7ec4792005-11-06 14:42:37 +00001007 vector_stub und, UND_MODE
Linus Torvalds1da177e2005-04-16 15:20:36 -07001008
1009 .long __und_usr @ 0 (USR_26 / USR_32)
1010 .long __und_invalid @ 1 (FIQ_26 / FIQ_32)
1011 .long __und_invalid @ 2 (IRQ_26 / IRQ_32)
1012 .long __und_svc @ 3 (SVC_26 / SVC_32)
1013 .long __und_invalid @ 4
1014 .long __und_invalid @ 5
1015 .long __und_invalid @ 6
1016 .long __und_invalid @ 7
1017 .long __und_invalid @ 8
1018 .long __und_invalid @ 9
1019 .long __und_invalid @ a
1020 .long __und_invalid @ b
1021 .long __und_invalid @ c
1022 .long __und_invalid @ d
1023 .long __und_invalid @ e
1024 .long __und_invalid @ f
1025
1026 .align 5
1027
1028/*=============================================================================
1029 * Undefined FIQs
1030 *-----------------------------------------------------------------------------
1031 * Enter in FIQ mode, spsr = ANY CPSR, lr = ANY PC
1032 * MUST PRESERVE SVC SPSR, but need to switch to SVC mode to show our msg.
1033 * Basically to switch modes, we *HAVE* to clobber one register... brain
1034 * damage alert! I don't think that we can execute any code in here in any
1035 * other mode than FIQ... Ok you can switch to another mode, but you can't
1036 * get out of that mode without clobbering one register.
1037 */
1038vector_fiq:
1039 disable_fiq
1040 subs pc, lr, #4
1041
1042/*=============================================================================
1043 * Address exception handler
1044 *-----------------------------------------------------------------------------
1045 * These aren't too critical.
1046 * (they're not supposed to happen, and won't happen in 32-bit data mode).
1047 */
1048
1049vector_addrexcptn:
1050 b vector_addrexcptn
1051
1052/*
1053 * We group all the following data together to optimise
1054 * for CPUs with separate I & D caches.
1055 */
1056 .align 5
1057
1058.LCvswi:
1059 .word vector_swi
1060
Russell King79335232005-04-26 15:17:42 +01001061 .globl __stubs_end
Linus Torvalds1da177e2005-04-16 15:20:36 -07001062__stubs_end:
1063
Russell King79335232005-04-26 15:17:42 +01001064 .equ stubs_offset, __vectors_start + 0x200 - __stubs_start
Linus Torvalds1da177e2005-04-16 15:20:36 -07001065
Russell King79335232005-04-26 15:17:42 +01001066 .globl __vectors_start
1067__vectors_start:
Linus Torvalds1da177e2005-04-16 15:20:36 -07001068 swi SYS_ERROR0
Russell King79335232005-04-26 15:17:42 +01001069 b vector_und + stubs_offset
1070 ldr pc, .LCvswi + stubs_offset
1071 b vector_pabt + stubs_offset
1072 b vector_dabt + stubs_offset
1073 b vector_addrexcptn + stubs_offset
1074 b vector_irq + stubs_offset
1075 b vector_fiq + stubs_offset
Linus Torvalds1da177e2005-04-16 15:20:36 -07001076
Russell King79335232005-04-26 15:17:42 +01001077 .globl __vectors_end
1078__vectors_end:
Linus Torvalds1da177e2005-04-16 15:20:36 -07001079
1080 .data
1081
Linus Torvalds1da177e2005-04-16 15:20:36 -07001082 .globl cr_alignment
1083 .globl cr_no_alignment
1084cr_alignment:
1085 .space 4
1086cr_no_alignment:
1087 .space 4