| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | /* | 
|  | 2 | *  linux/arch/arm/kernel/entry-common.S | 
|  | 3 | * | 
|  | 4 | *  Copyright (C) 2000 Russell King | 
|  | 5 | * | 
|  | 6 | * This program is free software; you can redistribute it and/or modify | 
|  | 7 | * it under the terms of the GNU General Public License version 2 as | 
|  | 8 | * published by the Free Software Foundation. | 
|  | 9 | */ | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 10 |  | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 11 | #include <asm/unistd.h> | 
|  | 12 |  | 
|  | 13 | #include "entry-header.S" | 
|  | 14 |  | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 15 |  | 
|  | 16 | .align	5 | 
|  | 17 | /* | 
|  | 18 | * This is the fast syscall return path.  We do as little as | 
|  | 19 | * possible here, and this includes saving r0 back into the SVC | 
|  | 20 | * stack. | 
|  | 21 | */ | 
|  | 22 | ret_fast_syscall: | 
| Russell King | 1ec42c0 | 2005-04-26 15:18:26 +0100 | [diff] [blame] | 23 | disable_irq				@ disable interrupts | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 24 | ldr	r1, [tsk, #TI_FLAGS] | 
|  | 25 | tst	r1, #_TIF_WORK_MASK | 
|  | 26 | bne	fast_work_pending | 
| Russell King | f4dc9a4 | 2005-04-26 15:20:34 +0100 | [diff] [blame] | 27 |  | 
|  | 28 | @ fast_restore_user_regs | 
|  | 29 | ldr	r1, [sp, #S_OFF + S_PSR]	@ get calling cpsr | 
|  | 30 | ldr	lr, [sp, #S_OFF + S_PC]!	@ get pc | 
|  | 31 | msr	spsr_cxsf, r1			@ save in spsr_svc | 
|  | 32 | ldmdb	sp, {r1 - lr}^			@ get calling r1 - lr | 
|  | 33 | mov	r0, r0 | 
|  | 34 | add	sp, sp, #S_FRAME_SIZE - S_PC | 
|  | 35 | movs	pc, lr				@ return & move spsr_svc into cpsr | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 36 |  | 
|  | 37 | /* | 
|  | 38 | * Ok, we need to do extra processing, enter the slow path. | 
|  | 39 | */ | 
|  | 40 | fast_work_pending: | 
|  | 41 | str	r0, [sp, #S_R0+S_OFF]!		@ returned r0 | 
|  | 42 | work_pending: | 
|  | 43 | tst	r1, #_TIF_NEED_RESCHED | 
|  | 44 | bne	work_resched | 
|  | 45 | tst	r1, #_TIF_NOTIFY_RESUME | _TIF_SIGPENDING | 
|  | 46 | beq	no_work_pending | 
|  | 47 | mov	r0, sp				@ 'regs' | 
|  | 48 | mov	r2, why				@ 'syscall' | 
|  | 49 | bl	do_notify_resume | 
| Daniel Jacobowitz | a6c61e9 | 2005-11-19 10:01:07 +0000 | [diff] [blame] | 50 | b	ret_slow_syscall		@ Check work again | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 51 |  | 
|  | 52 | work_resched: | 
|  | 53 | bl	schedule | 
|  | 54 | /* | 
|  | 55 | * "slow" syscall return path.  "why" tells us if this was a real syscall. | 
|  | 56 | */ | 
|  | 57 | ENTRY(ret_to_user) | 
|  | 58 | ret_slow_syscall: | 
| Russell King | 1ec42c0 | 2005-04-26 15:18:26 +0100 | [diff] [blame] | 59 | disable_irq				@ disable interrupts | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 60 | ldr	r1, [tsk, #TI_FLAGS] | 
|  | 61 | tst	r1, #_TIF_WORK_MASK | 
|  | 62 | bne	work_pending | 
|  | 63 | no_work_pending: | 
| Russell King | f4dc9a4 | 2005-04-26 15:20:34 +0100 | [diff] [blame] | 64 | @ slow_restore_user_regs | 
|  | 65 | ldr	r1, [sp, #S_PSR]		@ get calling cpsr | 
|  | 66 | ldr	lr, [sp, #S_PC]!		@ get pc | 
|  | 67 | msr	spsr_cxsf, r1			@ save in spsr_svc | 
|  | 68 | ldmdb	sp, {r0 - lr}^			@ get calling r1 - lr | 
|  | 69 | mov	r0, r0 | 
|  | 70 | add	sp, sp, #S_FRAME_SIZE - S_PC | 
|  | 71 | movs	pc, lr				@ return & move spsr_svc into cpsr | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 72 |  | 
|  | 73 | /* | 
|  | 74 | * This is how we return from a fork. | 
|  | 75 | */ | 
|  | 76 | ENTRY(ret_from_fork) | 
|  | 77 | bl	schedule_tail | 
|  | 78 | get_thread_info tsk | 
|  | 79 | ldr	r1, [tsk, #TI_FLAGS]		@ check for syscall tracing | 
|  | 80 | mov	why, #1 | 
|  | 81 | tst	r1, #_TIF_SYSCALL_TRACE		@ are we tracing syscalls? | 
|  | 82 | beq	ret_slow_syscall | 
|  | 83 | mov	r1, sp | 
|  | 84 | mov	r0, #1				@ trace exit [IP = 1] | 
|  | 85 | bl	syscall_trace | 
|  | 86 | b	ret_slow_syscall | 
|  | 87 |  | 
|  | 88 |  | 
| Al Viro | fa1b4f9 | 2006-01-19 12:57:01 +0000 | [diff] [blame] | 89 | .equ NR_syscalls,0 | 
|  | 90 | #define CALL(x) .equ NR_syscalls,NR_syscalls+1 | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 91 | #include "calls.S" | 
| Al Viro | fa1b4f9 | 2006-01-19 12:57:01 +0000 | [diff] [blame] | 92 | #undef CALL | 
|  | 93 | #define CALL(x) .long x | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 94 |  | 
|  | 95 | /*============================================================================= | 
|  | 96 | * SWI handler | 
|  | 97 | *----------------------------------------------------------------------------- | 
|  | 98 | */ | 
|  | 99 |  | 
|  | 100 | /* If we're optimising for StrongARM the resulting code won't | 
|  | 101 | run on an ARM7 and we can save a couple of instructions. | 
|  | 102 | --pb */ | 
|  | 103 | #ifdef CONFIG_CPU_ARM710 | 
| Nicolas Pitre | 3f2829a | 2006-01-14 16:31:29 +0000 | [diff] [blame] | 104 | #define A710(code...) code | 
|  | 105 | .Larm710bug: | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 106 | ldmia	sp, {r0 - lr}^			@ Get calling r0 - lr | 
|  | 107 | mov	r0, r0 | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 108 | add	sp, sp, #S_FRAME_SIZE | 
| Nicolas Pitre | 60ac133 | 2005-10-12 19:51:24 +0100 | [diff] [blame] | 109 | subs	pc, lr, #4 | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 110 | #else | 
| Nicolas Pitre | 3f2829a | 2006-01-14 16:31:29 +0000 | [diff] [blame] | 111 | #define A710(code...) | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 112 | #endif | 
|  | 113 |  | 
|  | 114 | .align	5 | 
|  | 115 | ENTRY(vector_swi) | 
| Russell King | f4dc9a4 | 2005-04-26 15:20:34 +0100 | [diff] [blame] | 116 | sub	sp, sp, #S_FRAME_SIZE | 
|  | 117 | stmia	sp, {r0 - r12}			@ Calling r0 - r12 | 
|  | 118 | add	r8, sp, #S_PC | 
|  | 119 | stmdb	r8, {sp, lr}^			@ Calling sp, lr | 
|  | 120 | mrs	r8, spsr			@ called from non-FIQ mode, so ok. | 
|  | 121 | str	lr, [sp, #S_PC]			@ Save calling PC | 
|  | 122 | str	r8, [sp, #S_PSR]		@ Save CPSR | 
|  | 123 | str	r0, [sp, #S_OLD_R0]		@ Save OLD_R0 | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 124 | zero_fp | 
| Russell King | e0f9f4a | 2005-04-26 15:19:24 +0100 | [diff] [blame] | 125 |  | 
|  | 126 | /* | 
|  | 127 | * Get the system call number. | 
|  | 128 | */ | 
| Nicolas Pitre | 3f2829a | 2006-01-14 16:31:29 +0000 | [diff] [blame] | 129 |  | 
| Nicolas Pitre | dd35afc | 2006-01-14 16:36:12 +0000 | [diff] [blame] | 130 | #if defined(CONFIG_OABI_COMPAT) | 
| Nicolas Pitre | 3f2829a | 2006-01-14 16:31:29 +0000 | [diff] [blame] | 131 |  | 
| Nicolas Pitre | dd35afc | 2006-01-14 16:36:12 +0000 | [diff] [blame] | 132 | /* | 
|  | 133 | * If we have CONFIG_OABI_COMPAT then we need to look at the swi | 
|  | 134 | * value to determine if it is an EABI or an old ABI call. | 
|  | 135 | */ | 
|  | 136 | #ifdef CONFIG_ARM_THUMB | 
|  | 137 | tst	r8, #PSR_T_BIT | 
|  | 138 | movne	r10, #0				@ no thumb OABI emulation | 
|  | 139 | ldreq	r10, [lr, #-4]			@ get SWI instruction | 
|  | 140 | #else | 
|  | 141 | ldr	r10, [lr, #-4]			@ get SWI instruction | 
|  | 142 | A710(	and	ip, r10, #0x0f000000		@ check for SWI		) | 
|  | 143 | A710(	teq	ip, #0x0f000000						) | 
|  | 144 | A710(	bne	.Larm710bug						) | 
|  | 145 | #endif | 
|  | 146 |  | 
|  | 147 | #elif defined(CONFIG_AEABI) | 
|  | 148 |  | 
|  | 149 | /* | 
|  | 150 | * Pure EABI user space always put syscall number into scno (r7). | 
|  | 151 | */ | 
| Nicolas Pitre | 3f2829a | 2006-01-14 16:31:29 +0000 | [diff] [blame] | 152 | A710(	ldr	ip, [lr, #-4]			@ get SWI instruction	) | 
|  | 153 | A710(	and	ip, ip, #0x0f000000		@ check for SWI		) | 
|  | 154 | A710(	teq	ip, #0x0f000000						) | 
|  | 155 | A710(	bne	.Larm710bug						) | 
| Nicolas Pitre | dd35afc | 2006-01-14 16:36:12 +0000 | [diff] [blame] | 156 |  | 
| Nicolas Pitre | 3f2829a | 2006-01-14 16:31:29 +0000 | [diff] [blame] | 157 | #elif defined(CONFIG_ARM_THUMB) | 
| Nicolas Pitre | dd35afc | 2006-01-14 16:36:12 +0000 | [diff] [blame] | 158 |  | 
|  | 159 | /* Legacy ABI only, possibly thumb mode. */ | 
| Russell King | e0f9f4a | 2005-04-26 15:19:24 +0100 | [diff] [blame] | 160 | tst	r8, #PSR_T_BIT			@ this is SPSR from save_user_regs | 
|  | 161 | addne	scno, r7, #__NR_SYSCALL_BASE	@ put OS number in | 
|  | 162 | ldreq	scno, [lr, #-4] | 
| Nicolas Pitre | dd35afc | 2006-01-14 16:36:12 +0000 | [diff] [blame] | 163 |  | 
| Russell King | e0f9f4a | 2005-04-26 15:19:24 +0100 | [diff] [blame] | 164 | #else | 
| Nicolas Pitre | dd35afc | 2006-01-14 16:36:12 +0000 | [diff] [blame] | 165 |  | 
|  | 166 | /* Legacy ABI only. */ | 
| Russell King | e0f9f4a | 2005-04-26 15:19:24 +0100 | [diff] [blame] | 167 | ldr	scno, [lr, #-4]			@ get SWI instruction | 
| Nicolas Pitre | 3f2829a | 2006-01-14 16:31:29 +0000 | [diff] [blame] | 168 | A710(	and	ip, scno, #0x0f000000		@ check for SWI		) | 
|  | 169 | A710(	teq	ip, #0x0f000000						) | 
|  | 170 | A710(	bne	.Larm710bug						) | 
| Nicolas Pitre | dd35afc | 2006-01-14 16:36:12 +0000 | [diff] [blame] | 171 |  | 
| Russell King | e0f9f4a | 2005-04-26 15:19:24 +0100 | [diff] [blame] | 172 | #endif | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 173 |  | 
|  | 174 | #ifdef CONFIG_ALIGNMENT_TRAP | 
|  | 175 | ldr	ip, __cr_alignment | 
|  | 176 | ldr	ip, [ip] | 
|  | 177 | mcr	p15, 0, ip, c1, c0		@ update control register | 
|  | 178 | #endif | 
| Russell King | 1ec42c0 | 2005-04-26 15:18:26 +0100 | [diff] [blame] | 179 | enable_irq | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 180 |  | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 181 | get_thread_info tsk | 
| Nicolas Pitre | dd35afc | 2006-01-14 16:36:12 +0000 | [diff] [blame] | 182 | adr	tbl, sys_call_table		@ load syscall table pointer | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 183 | ldr	ip, [tsk, #TI_FLAGS]		@ check for syscall tracing | 
| Nicolas Pitre | dd35afc | 2006-01-14 16:36:12 +0000 | [diff] [blame] | 184 |  | 
|  | 185 | #if defined(CONFIG_OABI_COMPAT) | 
|  | 186 | /* | 
|  | 187 | * If the swi argument is zero, this is an EABI call and we do nothing. | 
|  | 188 | * | 
|  | 189 | * If this is an old ABI call, get the syscall number into scno and | 
|  | 190 | * get the old ABI syscall table address. | 
|  | 191 | */ | 
|  | 192 | bics	r10, r10, #0xff000000 | 
|  | 193 | eorne	scno, r10, #__NR_OABI_SYSCALL_BASE | 
|  | 194 | ldrne	tbl, =sys_oabi_call_table | 
|  | 195 | #elif !defined(CONFIG_AEABI) | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 196 | bic	scno, scno, #0xff000000		@ mask off SWI op-code | 
| Russell King | e0f9f4a | 2005-04-26 15:19:24 +0100 | [diff] [blame] | 197 | eor	scno, scno, #__NR_SYSCALL_BASE	@ check OS number | 
| Nicolas Pitre | 3f2829a | 2006-01-14 16:31:29 +0000 | [diff] [blame] | 198 | #endif | 
| Nicolas Pitre | dd35afc | 2006-01-14 16:36:12 +0000 | [diff] [blame] | 199 |  | 
| Nicolas Pitre | 3f2829a | 2006-01-14 16:31:29 +0000 | [diff] [blame] | 200 | stmdb	sp!, {r4, r5}			@ push fifth and sixth args | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 201 | tst	ip, #_TIF_SYSCALL_TRACE		@ are we tracing syscalls? | 
|  | 202 | bne	__sys_trace | 
|  | 203 |  | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 204 | cmp	scno, #NR_syscalls		@ check upper syscall limit | 
| Nicolas Pitre | 3f2829a | 2006-01-14 16:31:29 +0000 | [diff] [blame] | 205 | adr	lr, ret_fast_syscall		@ return address | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 206 | ldrcc	pc, [tbl, scno, lsl #2]		@ call sys_* routine | 
|  | 207 |  | 
|  | 208 | add	r1, sp, #S_OFF | 
|  | 209 | 2:	mov	why, #0				@ no longer a real syscall | 
| Russell King | e0f9f4a | 2005-04-26 15:19:24 +0100 | [diff] [blame] | 210 | cmp	scno, #(__ARM_NR_BASE - __NR_SYSCALL_BASE) | 
|  | 211 | eor	r0, scno, #__NR_SYSCALL_BASE	@ put OS number back | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 212 | bcs	arm_syscall | 
|  | 213 | b	sys_ni_syscall			@ not private func | 
|  | 214 |  | 
|  | 215 | /* | 
|  | 216 | * This is the really slow path.  We're going to be doing | 
|  | 217 | * context switches, and waiting for our parent to respond. | 
|  | 218 | */ | 
|  | 219 | __sys_trace: | 
| Nicolas Pitre | 3f47112 | 2006-01-14 19:30:04 +0000 | [diff] [blame] | 220 | mov	r2, scno | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 221 | add	r1, sp, #S_OFF | 
|  | 222 | mov	r0, #0				@ trace entry [IP = 0] | 
|  | 223 | bl	syscall_trace | 
|  | 224 |  | 
|  | 225 | adr	lr, __sys_trace_return		@ return address | 
| Nicolas Pitre | 3f47112 | 2006-01-14 19:30:04 +0000 | [diff] [blame] | 226 | mov	scno, r0			@ syscall number (possibly new) | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 227 | add	r1, sp, #S_R0 + S_OFF		@ pointer to regs | 
|  | 228 | cmp	scno, #NR_syscalls		@ check upper syscall limit | 
|  | 229 | ldmccia	r1, {r0 - r3}			@ have to reload r0 - r3 | 
|  | 230 | ldrcc	pc, [tbl, scno, lsl #2]		@ call sys_* routine | 
|  | 231 | b	2b | 
|  | 232 |  | 
|  | 233 | __sys_trace_return: | 
|  | 234 | str	r0, [sp, #S_R0 + S_OFF]!	@ save returned r0 | 
| Nicolas Pitre | 3f47112 | 2006-01-14 19:30:04 +0000 | [diff] [blame] | 235 | mov	r2, scno | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 236 | mov	r1, sp | 
|  | 237 | mov	r0, #1				@ trace exit [IP = 1] | 
|  | 238 | bl	syscall_trace | 
|  | 239 | b	ret_slow_syscall | 
|  | 240 |  | 
|  | 241 | .align	5 | 
|  | 242 | #ifdef CONFIG_ALIGNMENT_TRAP | 
|  | 243 | .type	__cr_alignment, #object | 
|  | 244 | __cr_alignment: | 
|  | 245 | .word	cr_alignment | 
|  | 246 | #endif | 
| Nicolas Pitre | dd35afc | 2006-01-14 16:36:12 +0000 | [diff] [blame] | 247 | .ltorg | 
|  | 248 |  | 
|  | 249 | /* | 
|  | 250 | * This is the syscall table declaration for native ABI syscalls. | 
|  | 251 | * With EABI a couple syscalls are obsolete and defined as sys_ni_syscall. | 
|  | 252 | */ | 
|  | 253 | #define ABI(native, compat) native | 
|  | 254 | #ifdef CONFIG_AEABI | 
|  | 255 | #define OBSOLETE(syscall) sys_ni_syscall | 
|  | 256 | #else | 
|  | 257 | #define OBSOLETE(syscall) syscall | 
|  | 258 | #endif | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 259 |  | 
|  | 260 | .type	sys_call_table, #object | 
|  | 261 | ENTRY(sys_call_table) | 
|  | 262 | #include "calls.S" | 
| Nicolas Pitre | dd35afc | 2006-01-14 16:36:12 +0000 | [diff] [blame] | 263 | #undef ABI | 
|  | 264 | #undef OBSOLETE | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 265 |  | 
|  | 266 | /*============================================================================ | 
|  | 267 | * Special system call wrappers | 
|  | 268 | */ | 
|  | 269 | @ r0 = syscall number | 
| Russell King | 567bd98 | 2005-12-17 15:25:42 +0000 | [diff] [blame] | 270 | @ r8 = syscall table | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 271 | .type	sys_syscall, #function | 
|  | 272 | sys_syscall: | 
| Paul Brook | 5247593 | 2006-05-16 14:25:55 +0100 | [diff] [blame] | 273 | bic	scno, r0, #__NR_OABI_SYSCALL_BASE | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 274 | cmp	scno, #__NR_syscall - __NR_SYSCALL_BASE | 
|  | 275 | cmpne	scno, #NR_syscalls	@ check range | 
|  | 276 | stmloia	sp, {r5, r6}		@ shuffle args | 
|  | 277 | movlo	r0, r1 | 
|  | 278 | movlo	r1, r2 | 
|  | 279 | movlo	r2, r3 | 
|  | 280 | movlo	r3, r4 | 
|  | 281 | ldrlo	pc, [tbl, scno, lsl #2] | 
|  | 282 | b	sys_ni_syscall | 
|  | 283 |  | 
|  | 284 | sys_fork_wrapper: | 
|  | 285 | add	r0, sp, #S_OFF | 
|  | 286 | b	sys_fork | 
|  | 287 |  | 
|  | 288 | sys_vfork_wrapper: | 
|  | 289 | add	r0, sp, #S_OFF | 
|  | 290 | b	sys_vfork | 
|  | 291 |  | 
|  | 292 | sys_execve_wrapper: | 
|  | 293 | add	r3, sp, #S_OFF | 
|  | 294 | b	sys_execve | 
|  | 295 |  | 
|  | 296 | sys_clone_wrapper: | 
|  | 297 | add	ip, sp, #S_OFF | 
|  | 298 | str	ip, [sp, #4] | 
|  | 299 | b	sys_clone | 
|  | 300 |  | 
|  | 301 | sys_sigsuspend_wrapper: | 
|  | 302 | add	r3, sp, #S_OFF | 
|  | 303 | b	sys_sigsuspend | 
|  | 304 |  | 
|  | 305 | sys_rt_sigsuspend_wrapper: | 
|  | 306 | add	r2, sp, #S_OFF | 
|  | 307 | b	sys_rt_sigsuspend | 
|  | 308 |  | 
|  | 309 | sys_sigreturn_wrapper: | 
|  | 310 | add	r0, sp, #S_OFF | 
|  | 311 | b	sys_sigreturn | 
|  | 312 |  | 
|  | 313 | sys_rt_sigreturn_wrapper: | 
|  | 314 | add	r0, sp, #S_OFF | 
|  | 315 | b	sys_rt_sigreturn | 
|  | 316 |  | 
|  | 317 | sys_sigaltstack_wrapper: | 
|  | 318 | ldr	r2, [sp, #S_OFF + S_SP] | 
|  | 319 | b	do_sigaltstack | 
|  | 320 |  | 
| Nicolas Pitre | 713c481 | 2006-01-14 16:35:03 +0000 | [diff] [blame] | 321 | sys_statfs64_wrapper: | 
|  | 322 | teq	r1, #88 | 
|  | 323 | moveq	r1, #84 | 
|  | 324 | b	sys_statfs64 | 
|  | 325 |  | 
|  | 326 | sys_fstatfs64_wrapper: | 
|  | 327 | teq	r1, #88 | 
|  | 328 | moveq	r1, #84 | 
|  | 329 | b	sys_fstatfs64 | 
|  | 330 |  | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 331 | /* | 
|  | 332 | * Note: off_4k (r5) is always units of 4K.  If we can't do the requested | 
|  | 333 | * offset, we return EINVAL. | 
|  | 334 | */ | 
|  | 335 | sys_mmap2: | 
|  | 336 | #if PAGE_SHIFT > 12 | 
|  | 337 | tst	r5, #PGOFF_MASK | 
|  | 338 | moveq	r5, r5, lsr #PAGE_SHIFT - 12 | 
|  | 339 | streq	r5, [sp, #4] | 
|  | 340 | beq	do_mmap2 | 
|  | 341 | mov	r0, #-EINVAL | 
| Russell King | 7999d8d | 2006-06-25 11:17:23 +0100 | [diff] [blame] | 342 | mov	pc, lr | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 343 | #else | 
|  | 344 | str	r5, [sp, #4] | 
|  | 345 | b	do_mmap2 | 
|  | 346 | #endif | 
| Nicolas Pitre | 687ad01 | 2006-01-14 16:35:31 +0000 | [diff] [blame] | 347 |  | 
|  | 348 | #ifdef CONFIG_OABI_COMPAT | 
| Nicolas Pitre | dd35afc | 2006-01-14 16:36:12 +0000 | [diff] [blame] | 349 |  | 
| Nicolas Pitre | 687ad01 | 2006-01-14 16:35:31 +0000 | [diff] [blame] | 350 | /* | 
|  | 351 | * These are syscalls with argument register differences | 
|  | 352 | */ | 
|  | 353 |  | 
|  | 354 | sys_oabi_pread64: | 
|  | 355 | stmia	sp, {r3, r4} | 
|  | 356 | b	sys_pread64 | 
|  | 357 |  | 
|  | 358 | sys_oabi_pwrite64: | 
|  | 359 | stmia	sp, {r3, r4} | 
|  | 360 | b	sys_pwrite64 | 
|  | 361 |  | 
|  | 362 | sys_oabi_truncate64: | 
|  | 363 | mov	r3, r2 | 
|  | 364 | mov	r2, r1 | 
|  | 365 | b	sys_truncate64 | 
|  | 366 |  | 
|  | 367 | sys_oabi_ftruncate64: | 
|  | 368 | mov	r3, r2 | 
|  | 369 | mov	r2, r1 | 
|  | 370 | b	sys_ftruncate64 | 
|  | 371 |  | 
|  | 372 | sys_oabi_readahead: | 
|  | 373 | str	r3, [sp] | 
|  | 374 | mov	r3, r2 | 
|  | 375 | mov	r2, r1 | 
|  | 376 | b	sys_readahead | 
|  | 377 |  | 
| Nicolas Pitre | dd35afc | 2006-01-14 16:36:12 +0000 | [diff] [blame] | 378 | /* | 
|  | 379 | * Let's declare a second syscall table for old ABI binaries | 
|  | 380 | * using the compatibility syscall entries. | 
|  | 381 | */ | 
|  | 382 | #define ABI(native, compat) compat | 
|  | 383 | #define OBSOLETE(syscall) syscall | 
|  | 384 |  | 
|  | 385 | .type	sys_oabi_call_table, #object | 
|  | 386 | ENTRY(sys_oabi_call_table) | 
|  | 387 | #include "calls.S" | 
|  | 388 | #undef ABI | 
|  | 389 | #undef OBSOLETE | 
|  | 390 |  | 
| Nicolas Pitre | 687ad01 | 2006-01-14 16:35:31 +0000 | [diff] [blame] | 391 | #endif | 
|  | 392 |  |