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 that causes
15 * it to save wrong values... Be aware!
18 #include <asm/memory.h>
20 #include <asm/vfpmacros.h>
21 #include <asm/arch/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
89 inv_entry BAD_UNDEFINSTR
92 @ XXX fall through to common_invalid
96 @ common_invalid - generic code for failed exception (re-entrant version of handlers)
102 add r0, sp, #S_PC @ here for interlock avoidance
103 mov r7, #-1 @ "" "" "" ""
104 str r4, [sp] @ save preserved r0
105 stmia r0, {r5 - r7} @ lr_<exception>,
106 @ cpsr_<exception>, "old_r0"
115 #if defined(CONFIG_AEABI) && (__LINUX_ARM_ARCH__ >= 5)
116 #define SPFIX(code...) code
118 #define SPFIX(code...)
121 .macro svc_entry, stack_hole=0
122 sub sp, sp, #(S_FRAME_SIZE + \stack_hole)
124 SPFIX( bicne sp, sp, #4 )
128 add r5, sp, #S_SP @ here for interlock avoidance
129 mov r4, #-1 @ "" "" "" ""
130 add r0, sp, #(S_FRAME_SIZE + \stack_hole)
131 SPFIX( addne r0, r0, #4 )
132 str r1, [sp] @ save the "real" r0 copied
133 @ from the exception stack
138 @ We are now ready to fill in the remaining blanks on the stack:
142 @ r2 - lr_<exception>, already fixed up for correct return/restart
143 @ r3 - spsr_<exception>
144 @ r4 - orig_r0 (see pt_regs definition in ptrace.h)
154 @ get ready to re-enable interrupts if appropriate
158 biceq r9, r9, #PSR_I_BIT
161 @ Call the processor-specific abort handler:
163 @ r2 - aborted context pc
164 @ r3 - aborted context cpsr
166 @ The abort handler must return the aborted address in r0, and
167 @ the fault status register in r1. r9 must be preserved.
178 @ set desired IRQ state, then call main handler
185 @ IRQs off again before pulling preserved data off the stack
190 @ restore SPSR and restart the instruction
194 ldmia sp, {r0 - pc}^ @ load r0 - pc, cpsr
200 #ifdef CONFIG_TRACE_IRQFLAGS
201 bl trace_hardirqs_off
203 #ifdef CONFIG_PREEMPT
205 ldr r8, [tsk, #TI_PREEMPT] @ get preempt count
206 add r7, r8, #1 @ increment it
207 str r7, [tsk, #TI_PREEMPT]
211 #ifdef CONFIG_PREEMPT
212 ldr r0, [tsk, #TI_FLAGS] @ get flags
213 tst r0, #_TIF_NEED_RESCHED
216 ldr r0, [tsk, #TI_PREEMPT] @ read preempt value
217 str r8, [tsk, #TI_PREEMPT] @ restore preempt count
219 strne r0, [r0, -r0] @ bug()
221 ldr r0, [sp, #S_PSR] @ irqs are already disabled
223 #ifdef CONFIG_TRACE_IRQFLAGS
225 bleq trace_hardirqs_on
227 ldmia sp, {r0 - pc}^ @ load r0 - pc, cpsr
231 #ifdef CONFIG_PREEMPT
233 teq r8, #0 @ was preempt count = 0
234 ldreq r6, .LCirq_stat
236 ldr r0, [r6, #4] @ local_irq_count
237 ldr r1, [r6, #8] @ local_bh_count
240 mov r7, #0 @ preempt_schedule_irq
241 str r7, [tsk, #TI_PREEMPT] @ expects preempt_count == 0
242 1: bl preempt_schedule_irq @ irq en/disable is done inside
243 ldr r0, [tsk, #TI_FLAGS] @ get new tasks TI_FLAGS
244 tst r0, #_TIF_NEED_RESCHED
245 beq preempt_return @ go again
251 #ifdef CONFIG_KPROBES
252 @ If a kprobe is about to simulate a "stmdb sp..." instruction,
253 @ it obviously needs free stack space which then will belong to
261 @ call emulation code, which returns using r9 if it has emulated
262 @ the instruction, or the more conventional lr if we are to treat
263 @ this as a real undefined instruction
271 mov r0, sp @ struct pt_regs *regs
275 @ IRQs off again before pulling preserved data off the stack
280 @ restore SPSR and restart the instruction
282 ldr lr, [sp, #S_PSR] @ Get SVC cpsr
284 ldmia sp, {r0 - pc}^ @ Restore SVC registers
291 @ re-enable interrupts if appropriate
295 biceq r9, r9, #PSR_I_BIT
299 @ set args, then call main handler
301 @ r0 - address of faulting instruction
302 @ r1 - pointer to registers on stack
304 mov r0, r2 @ address (pc)
306 bl do_PrefetchAbort @ call abort handler
309 @ IRQs off again before pulling preserved data off the stack
314 @ restore SPSR and restart the instruction
318 ldmia sp, {r0 - pc}^ @ load r0 - pc, cpsr
329 #ifdef CONFIG_PREEMPT
337 * EABI note: sp_svc is always 64-bit aligned here, so should S_FRAME_SIZE
340 #if defined(CONFIG_AEABI) && (__LINUX_ARM_ARCH__ >= 5) && (S_FRAME_SIZE & 7)
341 #error "sizeof(struct pt_regs) must be a multiple of 8"
345 sub sp, sp, #S_FRAME_SIZE
349 add r0, sp, #S_PC @ here for interlock avoidance
350 mov r4, #-1 @ "" "" "" ""
352 str r1, [sp] @ save the "real" r0 copied
353 @ from the exception stack
356 @ We are now ready to fill in the remaining blanks on the stack:
358 @ r2 - lr_<exception>, already fixed up for correct return/restart
359 @ r3 - spsr_<exception>
360 @ r4 - orig_r0 (see pt_regs definition in ptrace.h)
362 @ Also, separately save sp_usr and lr_usr
368 @ Enable the alignment trap while in kernel mode
373 @ Clear FP to mark the first stack frame
378 .macro kuser_cmpxchg_check
379 #if __LINUX_ARM_ARCH__ < 6 && !defined(CONFIG_NEEDS_SYSCALL_FOR_CMPXCHG)
381 #warning "NPTL on non MMU needs fixing"
383 @ Make sure our user space atomic helper is restarted
384 @ if it was interrupted in a critical region. Here we
385 @ perform a quick test inline since it should be false
386 @ 99.9999% of the time. The rest is done out of line.
388 blhs kuser_cmpxchg_fixup
399 @ Call the processor-specific abort handler:
401 @ r2 - aborted context pc
402 @ r3 - aborted context cpsr
404 @ The abort handler must return the aborted address in r0, and
405 @ the fault status register in r1.
416 @ IRQs on, then call the main handler
420 adr lr, ret_from_exception
428 #ifdef CONFIG_TRACE_IRQFLAGS
429 bl trace_hardirqs_off
432 #ifdef CONFIG_PREEMPT
433 ldr r8, [tsk, #TI_PREEMPT] @ get preempt count
434 add r7, r8, #1 @ increment it
435 str r7, [tsk, #TI_PREEMPT]
439 #ifdef CONFIG_PREEMPT
440 ldr r0, [tsk, #TI_PREEMPT]
441 str r8, [tsk, #TI_PREEMPT]
445 #ifdef CONFIG_TRACE_IRQFLAGS
458 tst r3, #PSR_T_BIT @ Thumb mode?
459 bne __und_usr_unknown @ ignore FP
463 @ fall through to the emulation code, which returns using r9 if
464 @ it has emulated the instruction, or the more conventional lr
465 @ if we are to treat this as a real undefined instruction
469 adr r9, ret_from_exception
470 adr lr, __und_usr_unknown
473 @ fallthrough to call_fpe
477 * The out of line fixup for the ldrt above.
479 .section .fixup, "ax"
482 .section __ex_table,"a"
487 * Check whether the instruction is a co-processor instruction.
488 * If yes, we need to call the relevant co-processor handler.
490 * Note that we don't do a full check here for the co-processor
491 * instructions; all instructions with bit 27 set are well
492 * defined. The only instructions that should fault are the
493 * co-processor instructions. However, we have to watch out
494 * for the ARM6/ARM7 SWI bug.
496 * Emulators may wish to make use of the following registers:
497 * r0 = instruction opcode.
499 * r9 = normal "successful" return address
500 * r10 = this threads thread_info structure.
501 * lr = unrecognised instruction return address
504 tst r0, #0x08000000 @ only CDP/CPRT/LDC/STC have bit 27
505 #if defined(CONFIG_CPU_ARM610) || defined(CONFIG_CPU_ARM710)
506 and r8, r0, #0x0f000000 @ mask out op-code bits
507 teqne r8, #0x0f000000 @ SWI (ARM6/7 bug)?
510 get_thread_info r10 @ get current thread
511 and r8, r0, #0x00000f00 @ mask out CP number
513 add r6, r10, #TI_USED_CP
514 strb r7, [r6, r8, lsr #8] @ set appropriate used_cp[]
516 @ Test if we need to give access to iWMMXt coprocessors
517 ldr r5, [r10, #TI_FLAGS]
518 rsbs r7, r8, #(1 << 8) @ CP 0 or 1 only
519 movcss r7, r5, lsr #(TIF_USING_IWMMXT + 1)
520 bcs iwmmxt_task_enable
522 add pc, pc, r8, lsr #6
526 b do_fpe @ CP#1 (FPE)
527 b do_fpe @ CP#2 (FPE)
530 b crunch_task_enable @ CP#4 (MaverickCrunch)
531 b crunch_task_enable @ CP#5 (MaverickCrunch)
532 b crunch_task_enable @ CP#6 (MaverickCrunch)
542 b do_vfp @ CP#10 (VFP)
543 b do_vfp @ CP#11 (VFP)
545 mov pc, lr @ CP#10 (VFP)
546 mov pc, lr @ CP#11 (VFP)
550 mov pc, lr @ CP#14 (Debug)
551 mov pc, lr @ CP#15 (Control)
556 add r10, r10, #TI_FPSTATE @ r10 = workspace
557 ldr pc, [r4] @ Call FP module USR entry point
560 * The FP module is called with these registers set:
563 * r9 = normal "successful" return address
565 * lr = unrecognised FP instruction return address
577 adr lr, ret_from_exception
584 enable_irq @ Enable interrupts
585 mov r0, r2 @ address (pc)
587 bl do_PrefetchAbort @ call abort handler
590 * This is the return code to user mode for abort handlers
592 ENTRY(ret_from_exception)
598 * Register switch for ARMv3 and ARMv4 processors
599 * r0 = previous task_struct, r1 = previous thread_info, r2 = next thread_info
600 * previous and next are guaranteed not to be the same.
603 add ip, r1, #TI_CPU_SAVE
604 ldr r3, [r2, #TI_TP_VALUE]
605 stmia ip!, {r4 - sl, fp, sp, lr} @ Store most regs on stack
607 ldr r6, [r2, #TI_CPU_DOMAIN]
609 #if __LINUX_ARM_ARCH__ >= 6
610 #ifdef CONFIG_CPU_32v6K
613 strex r5, r4, [ip] @ Clear exclusive monitor
616 #if defined(CONFIG_HAS_TLS_REG)
617 mcr p15, 0, r3, c13, c0, 3 @ set TLS register
618 #elif !defined(CONFIG_TLS_REG_EMUL)
620 str r3, [r4, #-15] @ TLS val at 0xffff0ff0
623 mcr p15, 0, r6, c3, c0, 0 @ Set domain register
626 add r4, r2, #TI_CPU_SAVE
627 ldr r0, =thread_notify_head
628 mov r1, #THREAD_NOTIFY_SWITCH
629 bl atomic_notifier_call_chain
631 ldmia r4, {r4 - sl, fp, sp, pc} @ Load all regs saved previously
638 * These are segment of kernel provided user code reachable from user space
639 * at a fixed address in kernel memory. This is used to provide user space
640 * with some operations which require kernel help because of unimplemented
641 * native feature and/or instructions in many ARM CPUs. The idea is for
642 * this code to be executed directly in user mode for best efficiency but
643 * which is too intimate with the kernel counter part to be left to user
644 * libraries. In fact this code might even differ from one CPU to another
645 * depending on the available instruction set and restrictions like on
646 * SMP systems. In other words, the kernel reserves the right to change
647 * this code as needed without warning. Only the entry points and their
648 * results are guaranteed to be stable.
650 * Each segment is 32-byte aligned and will be moved to the top of the high
651 * vector page. New segments (if ever needed) must be added in front of
652 * existing ones. This mechanism should be used only for things that are
653 * really small and justified, and not be abused freely.
655 * User space is expected to implement those things inline when optimizing
656 * for a processor that has the necessary native support, but only if such
657 * resulting binaries are already to be incompatible with earlier ARM
658 * processors due to the use of unsupported instructions other than what
659 * is provided here. In other words don't make binaries unable to run on
660 * earlier processors just for the sake of not using these kernel helpers
661 * if your compiled code is not going to use the new instructions for other
666 #ifdef CONFIG_ARM_THUMB
674 .globl __kuser_helper_start
675 __kuser_helper_start:
678 * Reference prototype:
680 * void __kernel_memory_barrier(void)
684 * lr = return address
694 * Definition and user space usage example:
696 * typedef void (__kernel_dmb_t)(void);
697 * #define __kernel_dmb (*(__kernel_dmb_t *)0xffff0fa0)
699 * Apply any needed memory barrier to preserve consistency with data modified
700 * manually and __kuser_cmpxchg usage.
702 * This could be used as follows:
704 * #define __kernel_dmb() \
705 * asm volatile ( "mov r0, #0xffff0fff; mov lr, pc; sub pc, r0, #95" \
706 * : : : "r0", "lr","cc" )
709 __kuser_memory_barrier: @ 0xffff0fa0
711 #if __LINUX_ARM_ARCH__ >= 6 && defined(CONFIG_SMP)
712 mcr p15, 0, r0, c7, c10, 5 @ dmb
719 * Reference prototype:
721 * int __kernel_cmpxchg(int oldval, int newval, int *ptr)
728 * lr = return address
732 * r0 = returned value (zero or non-zero)
733 * C flag = set if r0 == 0, clear if r0 != 0
739 * Definition and user space usage example:
741 * typedef int (__kernel_cmpxchg_t)(int oldval, int newval, int *ptr);
742 * #define __kernel_cmpxchg (*(__kernel_cmpxchg_t *)0xffff0fc0)
744 * Atomically store newval in *ptr if *ptr is equal to oldval for user space.
745 * Return zero if *ptr was changed or non-zero if no exchange happened.
746 * The C flag is also set if *ptr was changed to allow for assembly
747 * optimization in the calling code.
751 * - This routine already includes memory barriers as needed.
753 * For example, a user space atomic_add implementation could look like this:
755 * #define atomic_add(ptr, val) \
756 * ({ register unsigned int *__ptr asm("r2") = (ptr); \
757 * register unsigned int __result asm("r1"); \
759 * "1: @ atomic_add\n\t" \
760 * "ldr r0, [r2]\n\t" \
761 * "mov r3, #0xffff0fff\n\t" \
762 * "add lr, pc, #4\n\t" \
763 * "add r1, r0, %2\n\t" \
764 * "add pc, r3, #(0xffff0fc0 - 0xffff0fff)\n\t" \
766 * : "=&r" (__result) \
767 * : "r" (__ptr), "rIL" (val) \
768 * : "r0","r3","ip","lr","cc","memory" ); \
772 __kuser_cmpxchg: @ 0xffff0fc0
774 #if defined(CONFIG_NEEDS_SYSCALL_FOR_CMPXCHG)
777 * Poor you. No fast solution possible...
778 * The kernel itself must perform the operation.
779 * A special ghost syscall is used for that (see traps.c).
782 mov r7, #0xff00 @ 0xfff0 into r7 for EABI
787 #elif __LINUX_ARM_ARCH__ < 6
792 * The only thing that can break atomicity in this cmpxchg
793 * implementation is either an IRQ or a data abort exception
794 * causing another process/thread to be scheduled in the middle
795 * of the critical sequence. To prevent this, code is added to
796 * the IRQ and data abort exception handlers to set the pc back
797 * to the beginning of the critical section if it is found to be
798 * within that critical section (see kuser_cmpxchg_fixup).
800 1: ldr r3, [r2] @ load current val
801 subs r3, r3, r0 @ compare with oldval
802 2: streq r1, [r2] @ store newval if eq
803 rsbs r0, r3, #0 @ set return val and C flag
808 @ Called from kuser_cmpxchg_check macro.
809 @ r2 = address of interrupted insn (must be preserved).
810 @ sp = saved regs. r7 and r8 are clobbered.
811 @ 1b = first critical insn, 2b = last critical insn.
812 @ If r2 >= 1b and r2 <= 2b then saved pc_usr is set to 1b.
814 sub r7, r7, #(0xffff0fff - (0xffff0fc0 + (1b - __kuser_cmpxchg)))
816 rsbcss r8, r8, #(2b - 1b)
817 strcs r7, [sp, #S_PC]
822 #warning "NPTL on non MMU needs fixing"
831 mcr p15, 0, r0, c7, c10, 5 @ dmb
839 /* beware -- each __kuser slot must be 8 instructions max */
841 b __kuser_memory_barrier
851 * Reference prototype:
853 * int __kernel_get_tls(void)
857 * lr = return address
867 * Definition and user space usage example:
869 * typedef int (__kernel_get_tls_t)(void);
870 * #define __kernel_get_tls (*(__kernel_get_tls_t *)0xffff0fe0)
872 * Get the TLS value as previously set via the __ARM_NR_set_tls syscall.
874 * This could be used as follows:
876 * #define __kernel_get_tls() \
877 * ({ register unsigned int __val asm("r0"); \
878 * asm( "mov r0, #0xffff0fff; mov lr, pc; sub pc, r0, #31" \
879 * : "=r" (__val) : : "lr","cc" ); \
883 __kuser_get_tls: @ 0xffff0fe0
885 #if !defined(CONFIG_HAS_TLS_REG) && !defined(CONFIG_TLS_REG_EMUL)
886 ldr r0, [pc, #(16 - 8)] @ TLS stored at 0xffff0ff0
888 mrc p15, 0, r0, c13, c0, 3 @ read TLS register
893 .word 0 @ pad up to __kuser_helper_version
897 * Reference declaration:
899 * extern unsigned int __kernel_helper_version;
901 * Definition and user space usage example:
903 * #define __kernel_helper_version (*(unsigned int *)0xffff0ffc)
905 * User space may read this to determine the curent number of helpers
909 __kuser_helper_version: @ 0xffff0ffc
910 .word ((__kuser_helper_end - __kuser_helper_start) >> 5)
912 .globl __kuser_helper_end
919 * This code is copied to 0xffff0200 so we can use branches in the
920 * vectors, rather than ldr's. Note that this code must not
921 * exceed 0x300 bytes.
923 * Common stub entry macro:
924 * Enter in IRQ mode, spsr = SVC/USR CPSR, lr = SVC/USR PC
926 * SP points to a minimal amount of processor-private memory, the address
927 * of which is copied into r0 for the mode specific abort handler.
929 .macro vector_stub, name, mode, correction=0
934 sub lr, lr, #\correction
938 @ Save r0, lr_<exception> (parent PC) and spsr_<exception>
941 stmia sp, {r0, lr} @ save r0, lr
943 str lr, [sp, #8] @ save spsr
946 @ Prepare for SVC32 mode. IRQs remain disabled.
949 eor r0, r0, #(\mode ^ SVC_MODE)
953 @ the branch table must immediately follow this code
957 ldr lr, [pc, lr, lsl #2]
958 movs pc, lr @ branch to handler in SVC mode
964 * Interrupt dispatcher
966 vector_stub irq, IRQ_MODE, 4
968 .long __irq_usr @ 0 (USR_26 / USR_32)
969 .long __irq_invalid @ 1 (FIQ_26 / FIQ_32)
970 .long __irq_invalid @ 2 (IRQ_26 / IRQ_32)
971 .long __irq_svc @ 3 (SVC_26 / SVC_32)
972 .long __irq_invalid @ 4
973 .long __irq_invalid @ 5
974 .long __irq_invalid @ 6
975 .long __irq_invalid @ 7
976 .long __irq_invalid @ 8
977 .long __irq_invalid @ 9
978 .long __irq_invalid @ a
979 .long __irq_invalid @ b
980 .long __irq_invalid @ c
981 .long __irq_invalid @ d
982 .long __irq_invalid @ e
983 .long __irq_invalid @ f
986 * Data abort dispatcher
987 * Enter in ABT mode, spsr = USR CPSR, lr = USR PC
989 vector_stub dabt, ABT_MODE, 8
991 .long __dabt_usr @ 0 (USR_26 / USR_32)
992 .long __dabt_invalid @ 1 (FIQ_26 / FIQ_32)
993 .long __dabt_invalid @ 2 (IRQ_26 / IRQ_32)
994 .long __dabt_svc @ 3 (SVC_26 / SVC_32)
995 .long __dabt_invalid @ 4
996 .long __dabt_invalid @ 5
997 .long __dabt_invalid @ 6
998 .long __dabt_invalid @ 7
999 .long __dabt_invalid @ 8
1000 .long __dabt_invalid @ 9
1001 .long __dabt_invalid @ a
1002 .long __dabt_invalid @ b
1003 .long __dabt_invalid @ c
1004 .long __dabt_invalid @ d
1005 .long __dabt_invalid @ e
1006 .long __dabt_invalid @ f
1009 * Prefetch abort dispatcher
1010 * Enter in ABT mode, spsr = USR CPSR, lr = USR PC
1012 vector_stub pabt, ABT_MODE, 4
1014 .long __pabt_usr @ 0 (USR_26 / USR_32)
1015 .long __pabt_invalid @ 1 (FIQ_26 / FIQ_32)
1016 .long __pabt_invalid @ 2 (IRQ_26 / IRQ_32)
1017 .long __pabt_svc @ 3 (SVC_26 / SVC_32)
1018 .long __pabt_invalid @ 4
1019 .long __pabt_invalid @ 5
1020 .long __pabt_invalid @ 6
1021 .long __pabt_invalid @ 7
1022 .long __pabt_invalid @ 8
1023 .long __pabt_invalid @ 9
1024 .long __pabt_invalid @ a
1025 .long __pabt_invalid @ b
1026 .long __pabt_invalid @ c
1027 .long __pabt_invalid @ d
1028 .long __pabt_invalid @ e
1029 .long __pabt_invalid @ f
1032 * Undef instr entry dispatcher
1033 * Enter in UND mode, spsr = SVC/USR CPSR, lr = SVC/USR PC
1035 vector_stub und, UND_MODE
1037 .long __und_usr @ 0 (USR_26 / USR_32)
1038 .long __und_invalid @ 1 (FIQ_26 / FIQ_32)
1039 .long __und_invalid @ 2 (IRQ_26 / IRQ_32)
1040 .long __und_svc @ 3 (SVC_26 / SVC_32)
1041 .long __und_invalid @ 4
1042 .long __und_invalid @ 5
1043 .long __und_invalid @ 6
1044 .long __und_invalid @ 7
1045 .long __und_invalid @ 8
1046 .long __und_invalid @ 9
1047 .long __und_invalid @ a
1048 .long __und_invalid @ b
1049 .long __und_invalid @ c
1050 .long __und_invalid @ d
1051 .long __und_invalid @ e
1052 .long __und_invalid @ f
1056 /*=============================================================================
1058 *-----------------------------------------------------------------------------
1059 * Enter in FIQ mode, spsr = ANY CPSR, lr = ANY PC
1060 * MUST PRESERVE SVC SPSR, but need to switch to SVC mode to show our msg.
1061 * Basically to switch modes, we *HAVE* to clobber one register... brain
1062 * damage alert! I don't think that we can execute any code in here in any
1063 * other mode than FIQ... Ok you can switch to another mode, but you can't
1064 * get out of that mode without clobbering one register.
1070 /*=============================================================================
1071 * Address exception handler
1072 *-----------------------------------------------------------------------------
1073 * These aren't too critical.
1074 * (they're not supposed to happen, and won't happen in 32-bit data mode).
1081 * We group all the following data together to optimise
1082 * for CPUs with separate I & D caches.
1092 .equ stubs_offset, __vectors_start + 0x200 - __stubs_start
1094 .globl __vectors_start
1097 b vector_und + stubs_offset
1098 ldr pc, .LCvswi + stubs_offset
1099 b vector_pabt + stubs_offset
1100 b vector_dabt + stubs_offset
1101 b vector_addrexcptn + stubs_offset
1102 b vector_irq + stubs_offset
1103 b vector_fiq + stubs_offset
1105 .globl __vectors_end
1111 .globl cr_no_alignment