2 * linux/arch/arm/kernel/entry-armv.S
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)
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.
12 * Low-level vector interface routines
14 * Note: there is a StrongARM bug in the STMIA rn, {regs}^ instruction
15 * that causes it to save wrong values... Be aware!
18 #include <asm/memory.h>
20 #include <asm/vfpmacros.h>
21 #include <mach/entry-macro.S>
22 #include <asm/thread_notify.h>
24 #include "entry-header.S"
27 * Interrupt handling. Preserves r7, r8, r9
30 get_irqnr_preamble r5, lr
31 1: get_irqnr_and_base r0, r6, r5, lr
34 @ routine called with r0 = irq number, r1 = struct pt_regs *
43 * this macro assumes that irqstat (r6) and base (r5) are
44 * preserved from get_irqnr_and_base above
46 test_for_ipi r0, r6, r5, lr
51 #ifdef CONFIG_LOCAL_TIMERS
52 test_for_ltirq r0, r6, r5, lr
62 .section .kprobes.text,"ax",%progbits
68 * Invalid mode handlers
70 .macro inv_entry, reason
71 sub sp, sp, #S_FRAME_SIZE
77 inv_entry BAD_PREFETCH
79 ENDPROC(__pabt_invalid)
84 ENDPROC(__dabt_invalid)
89 ENDPROC(__irq_invalid)
92 inv_entry BAD_UNDEFINSTR
95 @ XXX fall through to common_invalid
99 @ common_invalid - generic code for failed exception (re-entrant version of handlers)
105 add r0, sp, #S_PC @ here for interlock avoidance
106 mov r7, #-1 @ "" "" "" ""
107 str r4, [sp] @ save preserved r0
108 stmia r0, {r5 - r7} @ lr_<exception>,
109 @ cpsr_<exception>, "old_r0"
113 ENDPROC(__und_invalid)
119 #if defined(CONFIG_AEABI) && (__LINUX_ARM_ARCH__ >= 5)
120 #define SPFIX(code...) code
122 #define SPFIX(code...)
125 .macro svc_entry, stack_hole=0
126 sub sp, sp, #(S_FRAME_SIZE + \stack_hole)
128 SPFIX( bicne sp, sp, #4 )
132 add r5, sp, #S_SP @ here for interlock avoidance
133 mov r4, #-1 @ "" "" "" ""
134 add r0, sp, #(S_FRAME_SIZE + \stack_hole)
135 SPFIX( addne r0, r0, #4 )
136 str r1, [sp] @ save the "real" r0 copied
137 @ from the exception stack
142 @ We are now ready to fill in the remaining blanks on the stack:
146 @ r2 - lr_<exception>, already fixed up for correct return/restart
147 @ r3 - spsr_<exception>
148 @ r4 - orig_r0 (see pt_regs definition in ptrace.h)
158 @ get ready to re-enable interrupts if appropriate
162 biceq r9, r9, #PSR_I_BIT
165 @ Call the processor-specific abort handler:
167 @ r2 - aborted context pc
168 @ r3 - aborted context cpsr
170 @ The abort handler must return the aborted address in r0, and
171 @ the fault status register in r1. r9 must be preserved.
176 ldr pc, [r4, #PROCESSOR_DABT_FUNC]
178 bl CPU_DABORT_HANDLER
182 @ set desired IRQ state, then call main handler
189 @ IRQs off again before pulling preserved data off the stack
194 @ restore SPSR and restart the instruction
198 ldmia sp, {r0 - pc}^ @ load r0 - pc, cpsr
205 #ifdef CONFIG_TRACE_IRQFLAGS
206 bl trace_hardirqs_off
208 #ifdef CONFIG_PREEMPT
210 ldr r8, [tsk, #TI_PREEMPT] @ get preempt count
211 add r7, r8, #1 @ increment it
212 str r7, [tsk, #TI_PREEMPT]
216 #ifdef CONFIG_PREEMPT
217 str r8, [tsk, #TI_PREEMPT] @ restore preempt count
218 ldr r0, [tsk, #TI_FLAGS] @ get flags
219 teq r8, #0 @ if preempt count != 0
220 movne r0, #0 @ force flags to 0
221 tst r0, #_TIF_NEED_RESCHED
224 ldr r0, [sp, #S_PSR] @ irqs are already disabled
226 #ifdef CONFIG_TRACE_IRQFLAGS
228 bleq trace_hardirqs_on
230 ldmia sp, {r0 - pc}^ @ load r0 - pc, cpsr
235 #ifdef CONFIG_PREEMPT
238 1: bl preempt_schedule_irq @ irq en/disable is done inside
239 ldr r0, [tsk, #TI_FLAGS] @ get new tasks TI_FLAGS
240 tst r0, #_TIF_NEED_RESCHED
241 moveq pc, r8 @ go again
247 #ifdef CONFIG_KPROBES
248 @ If a kprobe is about to simulate a "stmdb sp..." instruction,
249 @ it obviously needs free stack space which then will belong to
257 @ call emulation code, which returns using r9 if it has emulated
258 @ the instruction, or the more conventional lr if we are to treat
259 @ this as a real undefined instruction
267 mov r0, sp @ struct pt_regs *regs
271 @ IRQs off again before pulling preserved data off the stack
276 @ restore SPSR and restart the instruction
278 ldr lr, [sp, #S_PSR] @ Get SVC cpsr
280 ldmia sp, {r0 - pc}^ @ Restore SVC registers
288 @ re-enable interrupts if appropriate
292 biceq r9, r9, #PSR_I_BIT
295 @ set args, then call main handler
297 @ r0 - address of faulting instruction
298 @ r1 - pointer to registers on stack
301 mov r0, r2 @ pass address of aborted instruction.
304 ldr pc, [r4, #PROCESSOR_PABT_FUNC]
306 CPU_PABORT_HANDLER(r0, r2)
308 msr cpsr_c, r9 @ Maybe enable interrupts
310 bl do_PrefetchAbort @ call abort handler
313 @ IRQs off again before pulling preserved data off the stack
318 @ restore SPSR and restart the instruction
322 ldmia sp, {r0 - pc}^ @ load r0 - pc, cpsr
338 * EABI note: sp_svc is always 64-bit aligned here, so should S_FRAME_SIZE
341 #if defined(CONFIG_AEABI) && (__LINUX_ARM_ARCH__ >= 5) && (S_FRAME_SIZE & 7)
342 #error "sizeof(struct pt_regs) must be a multiple of 8"
346 sub sp, sp, #S_FRAME_SIZE
350 add r0, sp, #S_PC @ here for interlock avoidance
351 mov r4, #-1 @ "" "" "" ""
353 str r1, [sp] @ save the "real" r0 copied
354 @ from the exception stack
357 @ We are now ready to fill in the remaining blanks on the stack:
359 @ r2 - lr_<exception>, already fixed up for correct return/restart
360 @ r3 - spsr_<exception>
361 @ r4 - orig_r0 (see pt_regs definition in ptrace.h)
363 @ Also, separately save sp_usr and lr_usr
369 @ Enable the alignment trap while in kernel mode
374 @ Clear FP to mark the first stack frame
379 .macro kuser_cmpxchg_check
380 #if __LINUX_ARM_ARCH__ < 6 && !defined(CONFIG_NEEDS_SYSCALL_FOR_CMPXCHG)
382 #warning "NPTL on non MMU needs fixing"
384 @ Make sure our user space atomic helper is restarted
385 @ if it was interrupted in a critical region. Here we
386 @ perform a quick test inline since it should be false
387 @ 99.9999% of the time. The rest is done out of line.
389 blhs kuser_cmpxchg_fixup
400 @ Call the processor-specific abort handler:
402 @ r2 - aborted context pc
403 @ r3 - aborted context cpsr
405 @ The abort handler must return the aborted address in r0, and
406 @ the fault status register in r1.
411 ldr pc, [r4, #PROCESSOR_DABT_FUNC]
413 bl CPU_DABORT_HANDLER
417 @ IRQs on, then call the main handler
421 adr lr, ret_from_exception
430 #ifdef CONFIG_TRACE_IRQFLAGS
431 bl trace_hardirqs_off
434 #ifdef CONFIG_PREEMPT
435 ldr r8, [tsk, #TI_PREEMPT] @ get preempt count
436 add r7, r8, #1 @ increment it
437 str r7, [tsk, #TI_PREEMPT]
441 #ifdef CONFIG_PREEMPT
442 ldr r0, [tsk, #TI_PREEMPT]
443 str r8, [tsk, #TI_PREEMPT]
447 #ifdef CONFIG_TRACE_IRQFLAGS
462 @ fall through to the emulation code, which returns using r9 if
463 @ it has emulated the instruction, or the more conventional lr
464 @ if we are to treat this as a real undefined instruction
468 adr r9, ret_from_exception
469 adr lr, __und_usr_unknown
470 tst r3, #PSR_T_BIT @ Thumb mode?
471 subeq r4, r2, #4 @ ARM instr at LR - 4
472 subne r4, r2, #2 @ Thumb instr at LR - 2
476 #if __LINUX_ARM_ARCH__ >= 7
477 2: ldrht r5, [r4], #2
478 and r0, r5, #0xf800 @ mask bits 111x x... .... ....
479 cmp r0, #0xe800 @ 32bit instruction if xx != 0
480 blo __und_usr_unknown
482 add r2, r2, #2 @ r2 is PC + 2, make it PC + 4
483 orr r0, r0, r5, lsl #16
490 @ fallthrough to call_fpe
494 * The out of line fixup for the ldrt above.
496 .section .fixup, "ax"
499 .section __ex_table,"a"
501 #if __LINUX_ARM_ARCH__ >= 7
508 * Check whether the instruction is a co-processor instruction.
509 * If yes, we need to call the relevant co-processor handler.
511 * Note that we don't do a full check here for the co-processor
512 * instructions; all instructions with bit 27 set are well
513 * defined. The only instructions that should fault are the
514 * co-processor instructions. However, we have to watch out
515 * for the ARM6/ARM7 SWI bug.
517 * NEON is a special case that has to be handled here. Not all
518 * NEON instructions are co-processor instructions, so we have
519 * to make a special case of checking for them. Plus, there's
520 * five groups of them, so we have a table of mask/opcode pairs
521 * to check against, and if any match then we branch off into the
524 * Emulators may wish to make use of the following registers:
525 * r0 = instruction opcode.
527 * r9 = normal "successful" return address
528 * r10 = this threads thread_info structure.
529 * lr = unrecognised instruction return address
532 @ Fall-through from Thumb-2 __und_usr
535 adr r6, .LCneon_thumb_opcodes
540 adr r6, .LCneon_arm_opcodes
542 ldr r7, [r6], #4 @ mask value
543 cmp r7, #0 @ end mask?
546 ldr r7, [r6], #4 @ opcode bits matching in mask
547 cmp r8, r7 @ NEON instruction?
551 strb r7, [r10, #TI_USED_CP + 10] @ mark CP#10 as used
552 strb r7, [r10, #TI_USED_CP + 11] @ mark CP#11 as used
553 b do_vfp @ let VFP handler handle this
556 tst r0, #0x08000000 @ only CDP/CPRT/LDC/STC have bit 27
557 tstne r0, #0x04000000 @ bit 26 set on both ARM and Thumb-2
558 #if defined(CONFIG_CPU_ARM610) || defined(CONFIG_CPU_ARM710)
559 and r8, r0, #0x0f000000 @ mask out op-code bits
560 teqne r8, #0x0f000000 @ SWI (ARM6/7 bug)?
563 get_thread_info r10 @ get current thread
564 and r8, r0, #0x00000f00 @ mask out CP number
566 add r6, r10, #TI_USED_CP
567 strb r7, [r6, r8, lsr #8] @ set appropriate used_cp[]
569 @ Test if we need to give access to iWMMXt coprocessors
570 ldr r5, [r10, #TI_FLAGS]
571 rsbs r7, r8, #(1 << 8) @ CP 0 or 1 only
572 movcss r7, r5, lsr #(TIF_USING_IWMMXT + 1)
573 bcs iwmmxt_task_enable
575 add pc, pc, r8, lsr #6
579 b do_fpe @ CP#1 (FPE)
580 b do_fpe @ CP#2 (FPE)
583 b crunch_task_enable @ CP#4 (MaverickCrunch)
584 b crunch_task_enable @ CP#5 (MaverickCrunch)
585 b crunch_task_enable @ CP#6 (MaverickCrunch)
595 b do_vfp @ CP#10 (VFP)
596 b do_vfp @ CP#11 (VFP)
598 mov pc, lr @ CP#10 (VFP)
599 mov pc, lr @ CP#11 (VFP)
603 mov pc, lr @ CP#14 (Debug)
604 mov pc, lr @ CP#15 (Control)
610 .word 0xfe000000 @ mask
611 .word 0xf2000000 @ opcode
613 .word 0xff100000 @ mask
614 .word 0xf4000000 @ opcode
616 .word 0x00000000 @ mask
617 .word 0x00000000 @ opcode
619 .LCneon_thumb_opcodes:
620 .word 0xef000000 @ mask
621 .word 0xef000000 @ opcode
623 .word 0xff100000 @ mask
624 .word 0xf9000000 @ opcode
626 .word 0x00000000 @ mask
627 .word 0x00000000 @ opcode
633 add r10, r10, #TI_FPSTATE @ r10 = workspace
634 ldr pc, [r4] @ Call FP module USR entry point
637 * The FP module is called with these registers set:
640 * r9 = normal "successful" return address
642 * lr = unrecognised FP instruction return address
654 adr lr, ret_from_exception
656 ENDPROC(__und_usr_unknown)
663 mov r0, r2 @ pass address of aborted instruction.
666 ldr pc, [r4, #PROCESSOR_PABT_FUNC]
668 CPU_PABORT_HANDLER(r0, r2)
670 enable_irq @ Enable interrupts
672 bl do_PrefetchAbort @ call abort handler
675 * This is the return code to user mode for abort handlers
677 ENTRY(ret_from_exception)
682 ENDPROC(ret_from_exception)
685 * Register switch for ARMv3 and ARMv4 processors
686 * r0 = previous task_struct, r1 = previous thread_info, r2 = next thread_info
687 * previous and next are guaranteed not to be the same.
690 add ip, r1, #TI_CPU_SAVE
691 ldr r3, [r2, #TI_TP_VALUE]
692 stmia ip!, {r4 - sl, fp, sp, lr} @ Store most regs on stack
694 ldr r6, [r2, #TI_CPU_DOMAIN]
696 #if __LINUX_ARM_ARCH__ >= 6
697 #ifdef CONFIG_CPU_32v6K
700 strex r5, r4, [ip] @ Clear exclusive monitor
703 #if defined(CONFIG_HAS_TLS_REG)
704 mcr p15, 0, r3, c13, c0, 3 @ set TLS register
705 #elif !defined(CONFIG_TLS_REG_EMUL)
707 str r3, [r4, #-15] @ TLS val at 0xffff0ff0
710 mcr p15, 0, r6, c3, c0, 0 @ Set domain register
713 add r4, r2, #TI_CPU_SAVE
714 ldr r0, =thread_notify_head
715 mov r1, #THREAD_NOTIFY_SWITCH
716 bl atomic_notifier_call_chain
718 ldmia r4, {r4 - sl, fp, sp, pc} @ Load all regs saved previously
726 * These are segment of kernel provided user code reachable from user space
727 * at a fixed address in kernel memory. This is used to provide user space
728 * with some operations which require kernel help because of unimplemented
729 * native feature and/or instructions in many ARM CPUs. The idea is for
730 * this code to be executed directly in user mode for best efficiency but
731 * which is too intimate with the kernel counter part to be left to user
732 * libraries. In fact this code might even differ from one CPU to another
733 * depending on the available instruction set and restrictions like on
734 * SMP systems. In other words, the kernel reserves the right to change
735 * this code as needed without warning. Only the entry points and their
736 * results are guaranteed to be stable.
738 * Each segment is 32-byte aligned and will be moved to the top of the high
739 * vector page. New segments (if ever needed) must be added in front of
740 * existing ones. This mechanism should be used only for things that are
741 * really small and justified, and not be abused freely.
743 * User space is expected to implement those things inline when optimizing
744 * for a processor that has the necessary native support, but only if such
745 * resulting binaries are already to be incompatible with earlier ARM
746 * processors due to the use of unsupported instructions other than what
747 * is provided here. In other words don't make binaries unable to run on
748 * earlier processors just for the sake of not using these kernel helpers
749 * if your compiled code is not going to use the new instructions for other
754 #ifdef CONFIG_ARM_THUMB
762 .globl __kuser_helper_start
763 __kuser_helper_start:
766 * Reference prototype:
768 * void __kernel_memory_barrier(void)
772 * lr = return address
782 * Definition and user space usage example:
784 * typedef void (__kernel_dmb_t)(void);
785 * #define __kernel_dmb (*(__kernel_dmb_t *)0xffff0fa0)
787 * Apply any needed memory barrier to preserve consistency with data modified
788 * manually and __kuser_cmpxchg usage.
790 * This could be used as follows:
792 * #define __kernel_dmb() \
793 * asm volatile ( "mov r0, #0xffff0fff; mov lr, pc; sub pc, r0, #95" \
794 * : : : "r0", "lr","cc" )
797 __kuser_memory_barrier: @ 0xffff0fa0
799 #if __LINUX_ARM_ARCH__ >= 6 && defined(CONFIG_SMP)
800 mcr p15, 0, r0, c7, c10, 5 @ dmb
807 * Reference prototype:
809 * int __kernel_cmpxchg(int oldval, int newval, int *ptr)
816 * lr = return address
820 * r0 = returned value (zero or non-zero)
821 * C flag = set if r0 == 0, clear if r0 != 0
827 * Definition and user space usage example:
829 * typedef int (__kernel_cmpxchg_t)(int oldval, int newval, int *ptr);
830 * #define __kernel_cmpxchg (*(__kernel_cmpxchg_t *)0xffff0fc0)
832 * Atomically store newval in *ptr if *ptr is equal to oldval for user space.
833 * Return zero if *ptr was changed or non-zero if no exchange happened.
834 * The C flag is also set if *ptr was changed to allow for assembly
835 * optimization in the calling code.
839 * - This routine already includes memory barriers as needed.
841 * For example, a user space atomic_add implementation could look like this:
843 * #define atomic_add(ptr, val) \
844 * ({ register unsigned int *__ptr asm("r2") = (ptr); \
845 * register unsigned int __result asm("r1"); \
847 * "1: @ atomic_add\n\t" \
848 * "ldr r0, [r2]\n\t" \
849 * "mov r3, #0xffff0fff\n\t" \
850 * "add lr, pc, #4\n\t" \
851 * "add r1, r0, %2\n\t" \
852 * "add pc, r3, #(0xffff0fc0 - 0xffff0fff)\n\t" \
854 * : "=&r" (__result) \
855 * : "r" (__ptr), "rIL" (val) \
856 * : "r0","r3","ip","lr","cc","memory" ); \
860 __kuser_cmpxchg: @ 0xffff0fc0
862 #if defined(CONFIG_NEEDS_SYSCALL_FOR_CMPXCHG)
865 * Poor you. No fast solution possible...
866 * The kernel itself must perform the operation.
867 * A special ghost syscall is used for that (see traps.c).
870 mov r7, #0xff00 @ 0xfff0 into r7 for EABI
875 #elif __LINUX_ARM_ARCH__ < 6
880 * The only thing that can break atomicity in this cmpxchg
881 * implementation is either an IRQ or a data abort exception
882 * causing another process/thread to be scheduled in the middle
883 * of the critical sequence. To prevent this, code is added to
884 * the IRQ and data abort exception handlers to set the pc back
885 * to the beginning of the critical section if it is found to be
886 * within that critical section (see kuser_cmpxchg_fixup).
888 1: ldr r3, [r2] @ load current val
889 subs r3, r3, r0 @ compare with oldval
890 2: streq r1, [r2] @ store newval if eq
891 rsbs r0, r3, #0 @ set return val and C flag
896 @ Called from kuser_cmpxchg_check macro.
897 @ r2 = address of interrupted insn (must be preserved).
898 @ sp = saved regs. r7 and r8 are clobbered.
899 @ 1b = first critical insn, 2b = last critical insn.
900 @ If r2 >= 1b and r2 <= 2b then saved pc_usr is set to 1b.
902 sub r7, r7, #(0xffff0fff - (0xffff0fc0 + (1b - __kuser_cmpxchg)))
904 rsbcss r8, r8, #(2b - 1b)
905 strcs r7, [sp, #S_PC]
910 #warning "NPTL on non MMU needs fixing"
919 mcr p15, 0, r0, c7, c10, 5 @ dmb
927 /* beware -- each __kuser slot must be 8 instructions max */
929 b __kuser_memory_barrier
939 * Reference prototype:
941 * int __kernel_get_tls(void)
945 * lr = return address
955 * Definition and user space usage example:
957 * typedef int (__kernel_get_tls_t)(void);
958 * #define __kernel_get_tls (*(__kernel_get_tls_t *)0xffff0fe0)
960 * Get the TLS value as previously set via the __ARM_NR_set_tls syscall.
962 * This could be used as follows:
964 * #define __kernel_get_tls() \
965 * ({ register unsigned int __val asm("r0"); \
966 * asm( "mov r0, #0xffff0fff; mov lr, pc; sub pc, r0, #31" \
967 * : "=r" (__val) : : "lr","cc" ); \
971 __kuser_get_tls: @ 0xffff0fe0
973 #if !defined(CONFIG_HAS_TLS_REG) && !defined(CONFIG_TLS_REG_EMUL)
974 ldr r0, [pc, #(16 - 8)] @ TLS stored at 0xffff0ff0
976 mrc p15, 0, r0, c13, c0, 3 @ read TLS register
981 .word 0 @ pad up to __kuser_helper_version
985 * Reference declaration:
987 * extern unsigned int __kernel_helper_version;
989 * Definition and user space usage example:
991 * #define __kernel_helper_version (*(unsigned int *)0xffff0ffc)
993 * User space may read this to determine the curent number of helpers
997 __kuser_helper_version: @ 0xffff0ffc
998 .word ((__kuser_helper_end - __kuser_helper_start) >> 5)
1000 .globl __kuser_helper_end
1007 * This code is copied to 0xffff0200 so we can use branches in the
1008 * vectors, rather than ldr's. Note that this code must not
1009 * exceed 0x300 bytes.
1011 * Common stub entry macro:
1012 * Enter in IRQ mode, spsr = SVC/USR CPSR, lr = SVC/USR PC
1014 * SP points to a minimal amount of processor-private memory, the address
1015 * of which is copied into r0 for the mode specific abort handler.
1017 .macro vector_stub, name, mode, correction=0
1022 sub lr, lr, #\correction
1026 @ Save r0, lr_<exception> (parent PC) and spsr_<exception>
1029 stmia sp, {r0, lr} @ save r0, lr
1031 str lr, [sp, #8] @ save spsr
1034 @ Prepare for SVC32 mode. IRQs remain disabled.
1037 eor r0, r0, #(\mode ^ SVC_MODE)
1041 @ the branch table must immediately follow this code
1045 ldr lr, [pc, lr, lsl #2]
1046 movs pc, lr @ branch to handler in SVC mode
1047 ENDPROC(vector_\name)
1050 .globl __stubs_start
1053 * Interrupt dispatcher
1055 vector_stub irq, IRQ_MODE, 4
1057 .long __irq_usr @ 0 (USR_26 / USR_32)
1058 .long __irq_invalid @ 1 (FIQ_26 / FIQ_32)
1059 .long __irq_invalid @ 2 (IRQ_26 / IRQ_32)
1060 .long __irq_svc @ 3 (SVC_26 / SVC_32)
1061 .long __irq_invalid @ 4
1062 .long __irq_invalid @ 5
1063 .long __irq_invalid @ 6
1064 .long __irq_invalid @ 7
1065 .long __irq_invalid @ 8
1066 .long __irq_invalid @ 9
1067 .long __irq_invalid @ a
1068 .long __irq_invalid @ b
1069 .long __irq_invalid @ c
1070 .long __irq_invalid @ d
1071 .long __irq_invalid @ e
1072 .long __irq_invalid @ f
1075 * Data abort dispatcher
1076 * Enter in ABT mode, spsr = USR CPSR, lr = USR PC
1078 vector_stub dabt, ABT_MODE, 8
1080 .long __dabt_usr @ 0 (USR_26 / USR_32)
1081 .long __dabt_invalid @ 1 (FIQ_26 / FIQ_32)
1082 .long __dabt_invalid @ 2 (IRQ_26 / IRQ_32)
1083 .long __dabt_svc @ 3 (SVC_26 / SVC_32)
1084 .long __dabt_invalid @ 4
1085 .long __dabt_invalid @ 5
1086 .long __dabt_invalid @ 6
1087 .long __dabt_invalid @ 7
1088 .long __dabt_invalid @ 8
1089 .long __dabt_invalid @ 9
1090 .long __dabt_invalid @ a
1091 .long __dabt_invalid @ b
1092 .long __dabt_invalid @ c
1093 .long __dabt_invalid @ d
1094 .long __dabt_invalid @ e
1095 .long __dabt_invalid @ f
1098 * Prefetch abort dispatcher
1099 * Enter in ABT mode, spsr = USR CPSR, lr = USR PC
1101 vector_stub pabt, ABT_MODE, 4
1103 .long __pabt_usr @ 0 (USR_26 / USR_32)
1104 .long __pabt_invalid @ 1 (FIQ_26 / FIQ_32)
1105 .long __pabt_invalid @ 2 (IRQ_26 / IRQ_32)
1106 .long __pabt_svc @ 3 (SVC_26 / SVC_32)
1107 .long __pabt_invalid @ 4
1108 .long __pabt_invalid @ 5
1109 .long __pabt_invalid @ 6
1110 .long __pabt_invalid @ 7
1111 .long __pabt_invalid @ 8
1112 .long __pabt_invalid @ 9
1113 .long __pabt_invalid @ a
1114 .long __pabt_invalid @ b
1115 .long __pabt_invalid @ c
1116 .long __pabt_invalid @ d
1117 .long __pabt_invalid @ e
1118 .long __pabt_invalid @ f
1121 * Undef instr entry dispatcher
1122 * Enter in UND mode, spsr = SVC/USR CPSR, lr = SVC/USR PC
1124 vector_stub und, UND_MODE
1126 .long __und_usr @ 0 (USR_26 / USR_32)
1127 .long __und_invalid @ 1 (FIQ_26 / FIQ_32)
1128 .long __und_invalid @ 2 (IRQ_26 / IRQ_32)
1129 .long __und_svc @ 3 (SVC_26 / SVC_32)
1130 .long __und_invalid @ 4
1131 .long __und_invalid @ 5
1132 .long __und_invalid @ 6
1133 .long __und_invalid @ 7
1134 .long __und_invalid @ 8
1135 .long __und_invalid @ 9
1136 .long __und_invalid @ a
1137 .long __und_invalid @ b
1138 .long __und_invalid @ c
1139 .long __und_invalid @ d
1140 .long __und_invalid @ e
1141 .long __und_invalid @ f
1145 /*=============================================================================
1147 *-----------------------------------------------------------------------------
1148 * Enter in FIQ mode, spsr = ANY CPSR, lr = ANY PC
1149 * MUST PRESERVE SVC SPSR, but need to switch to SVC mode to show our msg.
1150 * Basically to switch modes, we *HAVE* to clobber one register... brain
1151 * damage alert! I don't think that we can execute any code in here in any
1152 * other mode than FIQ... Ok you can switch to another mode, but you can't
1153 * get out of that mode without clobbering one register.
1159 /*=============================================================================
1160 * Address exception handler
1161 *-----------------------------------------------------------------------------
1162 * These aren't too critical.
1163 * (they're not supposed to happen, and won't happen in 32-bit data mode).
1170 * We group all the following data together to optimise
1171 * for CPUs with separate I & D caches.
1181 .equ stubs_offset, __vectors_start + 0x200 - __stubs_start
1183 .globl __vectors_start
1186 b vector_und + stubs_offset
1187 ldr pc, .LCvswi + stubs_offset
1188 b vector_pabt + stubs_offset
1189 b vector_dabt + stubs_offset
1190 b vector_addrexcptn + stubs_offset
1191 b vector_irq + stubs_offset
1192 b vector_fiq + stubs_offset
1194 .globl __vectors_end
1200 .globl cr_no_alignment