2005-04-26 16:21:02 +02:00
|
|
|
#include <linux/init.h>
|
2005-04-17 00:20:36 +02:00
|
|
|
#include <linux/linkage.h>
|
|
|
|
|
|
|
|
#include <asm/assembler.h>
|
2005-09-09 21:08:59 +02:00
|
|
|
#include <asm/asm-offsets.h>
|
2005-04-17 00:20:36 +02:00
|
|
|
#include <asm/errno.h>
|
2005-04-26 16:21:02 +02:00
|
|
|
#include <asm/thread_info.h>
|
2005-04-17 00:20:36 +02:00
|
|
|
|
|
|
|
@ Bad Abort numbers
|
|
|
|
@ -----------------
|
|
|
|
@
|
|
|
|
#define BAD_PREFETCH 0
|
|
|
|
#define BAD_DATA 1
|
|
|
|
#define BAD_ADDREXCPTN 2
|
|
|
|
#define BAD_IRQ 3
|
|
|
|
#define BAD_UNDEFINSTR 4
|
|
|
|
|
|
|
|
@
|
2005-04-26 16:18:59 +02:00
|
|
|
@ Most of the stack format comes from struct pt_regs, but with
|
|
|
|
@ the addition of 8 bytes for storing syscall args 5 and 6.
|
2006-01-14 17:18:08 +01:00
|
|
|
@ This _must_ remain a multiple of 8 for EABI.
|
2005-04-17 00:20:36 +02:00
|
|
|
@
|
|
|
|
#define S_OFF 8
|
|
|
|
|
2005-04-26 16:18:59 +02:00
|
|
|
/*
|
|
|
|
* The SWI code relies on the fact that R0 is at the bottom of the stack
|
|
|
|
* (due to slow/fast restore user regs).
|
|
|
|
*/
|
|
|
|
#if S_R0 != 0
|
|
|
|
#error "Please fix"
|
|
|
|
#endif
|
|
|
|
|
2005-04-26 16:21:02 +02:00
|
|
|
.macro zero_fp
|
|
|
|
#ifdef CONFIG_FRAME_POINTER
|
|
|
|
mov fp, #0
|
|
|
|
#endif
|
|
|
|
.endm
|
|
|
|
|
2005-04-17 00:20:36 +02:00
|
|
|
.macro get_thread_info, rd
|
|
|
|
mov \rd, sp, lsr #13
|
|
|
|
mov \rd, \rd, lsl #13
|
|
|
|
.endm
|
|
|
|
|
2005-05-31 19:02:00 +02:00
|
|
|
.macro alignment_trap, rtemp
|
2005-04-17 00:20:36 +02:00
|
|
|
#ifdef CONFIG_ALIGNMENT_TRAP
|
2005-05-31 19:02:00 +02:00
|
|
|
ldr \rtemp, .LCcralign
|
|
|
|
ldr \rtemp, [\rtemp]
|
2005-04-17 00:20:36 +02:00
|
|
|
mcr p15, 0, \rtemp, c1, c0
|
|
|
|
#endif
|
|
|
|
.endm
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
* These are the registers used in the syscall handler, and allow us to
|
|
|
|
* have in theory up to 7 arguments to a function - r0 to r6.
|
|
|
|
*
|
|
|
|
* r7 is reserved for the system call number for thumb mode.
|
|
|
|
*
|
|
|
|
* Note that tbl == why is intentional.
|
|
|
|
*
|
|
|
|
* We must set at least "tsk" and "why" when calling ret_with_reschedule.
|
|
|
|
*/
|
|
|
|
scno .req r7 @ syscall number
|
|
|
|
tbl .req r8 @ syscall table pointer
|
|
|
|
why .req r8 @ Linux syscall (!= 0)
|
|
|
|
tsk .req r9 @ current thread_info
|