1 #include <linux/config.h>
2 #include <linux/init.h>
3 #include <linux/linkage.h>
5 #include <asm/assembler.h>
6 #include <asm/constants.h>
8 #include <asm/thread_info.h>
13 #define BAD_PREFETCH 0
15 #define BAD_ADDREXCPTN 2
17 #define BAD_UNDEFINSTR 4
20 @ Most of the stack format comes from struct pt_regs, but with
21 @ the addition of 8 bytes for storing syscall args 5 and 6.
26 * The SWI code relies on the fact that R0 is at the bottom of the stack
27 * (due to slow/fast restore user regs).
34 #ifdef CONFIG_FRAME_POINTER
39 #if __LINUX_ARM_ARCH__ >= 6
49 msr cpsr_c, #PSR_I_BIT | SVC_MODE
57 .macro get_thread_info, rd
62 .macro alignment_trap, rbase, rtemp, sym
63 #ifdef CONFIG_ALIGNMENT_TRAP
64 #define OFF_CR_ALIGNMENT(x) cr_alignment - x
66 ldr \rtemp, [\rbase, #OFF_CR_ALIGNMENT(\sym)]
67 mcr p15, 0, \rtemp, c1, c0
73 * These are the registers used in the syscall handler, and allow us to
74 * have in theory up to 7 arguments to a function - r0 to r6.
76 * r7 is reserved for the system call number for thumb mode.
78 * Note that tbl == why is intentional.
80 * We must set at least "tsk" and "why" when calling ret_with_reschedule.
82 scno .req r7 @ syscall number
83 tbl .req r8 @ syscall table pointer
84 why .req r8 @ Linux syscall (!= 0)
85 tsk .req r9 @ current thread_info