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