Commit | Line | Data |
---|---|---|
bce495d8 RK |
1 | #include <linux/config.h> |
2 | #include <linux/init.h> | |
1da177e4 LT |
3 | #include <linux/linkage.h> |
4 | ||
5 | #include <asm/assembler.h> | |
e6ae744d | 6 | #include <asm/asm-offsets.h> |
1da177e4 | 7 | #include <asm/errno.h> |
bce495d8 | 8 | #include <asm/thread_info.h> |
1da177e4 LT |
9 | |
10 | @ Bad Abort numbers | |
11 | @ ----------------- | |
12 | @ | |
13 | #define BAD_PREFETCH 0 | |
14 | #define BAD_DATA 1 | |
15 | #define BAD_ADDREXCPTN 2 | |
16 | #define BAD_IRQ 3 | |
17 | #define BAD_UNDEFINSTR 4 | |
18 | ||
1da177e4 | 19 | @ |
925c8a1a RK |
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. | |
2dede2d8 | 22 | @ This _must_ remain a multiple of 8 for EABI. |
1da177e4 | 23 | @ |
1da177e4 LT |
24 | #define S_OFF 8 |
25 | ||
925c8a1a RK |
26 | /* |
27 | * The SWI code relies on the fact that R0 is at the bottom of the stack | |
28 | * (due to slow/fast restore user regs). | |
29 | */ | |
30 | #if S_R0 != 0 | |
31 | #error "Please fix" | |
32 | #endif | |
33 | ||
bce495d8 RK |
34 | .macro zero_fp |
35 | #ifdef CONFIG_FRAME_POINTER | |
36 | mov fp, #0 | |
37 | #endif | |
38 | .endm | |
39 | ||
1da177e4 LT |
40 | .macro get_thread_info, rd |
41 | mov \rd, sp, lsr #13 | |
42 | mov \rd, \rd, lsl #13 | |
43 | .endm | |
44 | ||
49f680ea | 45 | .macro alignment_trap, rtemp |
1da177e4 | 46 | #ifdef CONFIG_ALIGNMENT_TRAP |
49f680ea RK |
47 | ldr \rtemp, .LCcralign |
48 | ldr \rtemp, [\rtemp] | |
1da177e4 LT |
49 | mcr p15, 0, \rtemp, c1, c0 |
50 | #endif | |
51 | .endm | |
52 | ||
53 | ||
54 | /* | |
55 | * These are the registers used in the syscall handler, and allow us to | |
56 | * have in theory up to 7 arguments to a function - r0 to r6. | |
57 | * | |
58 | * r7 is reserved for the system call number for thumb mode. | |
59 | * | |
60 | * Note that tbl == why is intentional. | |
61 | * | |
62 | * We must set at least "tsk" and "why" when calling ret_with_reschedule. | |
63 | */ | |
64 | scno .req r7 @ syscall number | |
65 | tbl .req r8 @ syscall table pointer | |
66 | why .req r8 @ Linux syscall (!= 0) | |
67 | tsk .req r9 @ current thread_info |