blob: eb5cd77bf1d8326aa69fe05ff7dc223aa5eb707a [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/*
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 Torvalds1da177e2005-04-16 15:20:36 -070010
Russell King6ebbf2c2014-06-30 16:29:12 +010011#include <asm/assembler.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070012#include <asm/unistd.h>
Abhishek Sagar395a59d2008-06-21 23:47:27 +053013#include <asm/ftrace.h>
Catalin Marinasc4c57162009-02-16 11:42:09 +010014#include <asm/unwind.h>
Russell King96a8fae2016-10-18 19:57:01 +010015#ifdef CONFIG_AEABI
16#include <asm/unistd-oabi.h>
17#endif
18
19 .equ NR_syscalls, __NR_syscalls
Linus Torvalds1da177e2005-04-16 15:20:36 -070020
Rob Herring13a50452012-02-07 09:28:22 -060021#ifdef CONFIG_NEED_RET_TO_USER
22#include <mach/entry-macro.S>
23#else
24 .macro arch_ret_to_user, tmp1, tmp2
25 .endm
26#endif
27
Linus Torvalds1da177e2005-04-16 15:20:36 -070028#include "entry-header.S"
29
Linus Torvalds1da177e2005-04-16 15:20:36 -070030
31 .align 5
Russell King3302cad2015-08-20 16:13:37 +010032#if !(IS_ENABLED(CONFIG_TRACE_IRQFLAGS) || IS_ENABLED(CONFIG_CONTEXT_TRACKING))
Linus Torvalds1da177e2005-04-16 15:20:36 -070033/*
Russell King3302cad2015-08-20 16:13:37 +010034 * This is the fast syscall return path. We do as little as possible here,
35 * such as avoiding writing r0 to the stack. We only use this path if we
36 * have tracing and context tracking disabled - the overheads from those
37 * features make this path too inefficient.
Linus Torvalds1da177e2005-04-16 15:20:36 -070038 */
39ret_fast_syscall:
Catalin Marinasc4c57162009-02-16 11:42:09 +010040 UNWIND(.fnstart )
41 UNWIND(.cantunwind )
Russell King3302cad2015-08-20 16:13:37 +010042 disable_irq_notrace @ disable interrupts
Russell King1b979372015-05-15 11:02:23 +010043 ldr r1, [tsk, #TI_FLAGS] @ re-check for syscall tracing
Russell King3302cad2015-08-20 16:13:37 +010044 tst r1, #_TIF_SYSCALL_WORK | _TIF_WORK_MASK
Linus Torvalds1da177e2005-04-16 15:20:36 -070045 bne fast_work_pending
Russell Kingf4dc9a42005-04-26 15:20:34 +010046
Dan Williamsf80dff92007-02-16 22:16:32 +010047 /* perform architecture specific actions before user return */
48 arch_ret_to_user r1, lr
49
Catalin Marinasb86040a2009-07-24 12:32:54 +010050 restore_user_regs fast = 1, offset = S_OFF
Catalin Marinasc4c57162009-02-16 11:42:09 +010051 UNWIND(.fnend )
Russell King3302cad2015-08-20 16:13:37 +010052ENDPROC(ret_fast_syscall)
Linus Torvalds1da177e2005-04-16 15:20:36 -070053
Russell King3302cad2015-08-20 16:13:37 +010054 /* Ok, we need to do extra processing, enter the slow path. */
Linus Torvalds1da177e2005-04-16 15:20:36 -070055fast_work_pending:
56 str r0, [sp, #S_R0+S_OFF]! @ returned r0
Russell King3302cad2015-08-20 16:13:37 +010057 /* fall through to work_pending */
58#else
59/*
60 * The "replacement" ret_fast_syscall for when tracing or context tracking
61 * is enabled. As we will need to call out to some C functions, we save
62 * r0 first to avoid needing to save registers around each C function call.
63 */
64ret_fast_syscall:
65 UNWIND(.fnstart )
66 UNWIND(.cantunwind )
67 str r0, [sp, #S_R0 + S_OFF]! @ save returned r0
68 disable_irq_notrace @ disable interrupts
69 ldr r1, [tsk, #TI_FLAGS] @ re-check for syscall tracing
70 tst r1, #_TIF_SYSCALL_WORK | _TIF_WORK_MASK
71 beq no_work_pending
72 UNWIND(.fnend )
73ENDPROC(ret_fast_syscall)
74
75 /* Slower path - fall through to work_pending */
76#endif
77
78 tst r1, #_TIF_SYSCALL_WORK
79 bne __sys_trace_return_nosave
80slow_work_pending:
Linus Torvalds1da177e2005-04-16 15:20:36 -070081 mov r0, sp @ 'regs'
82 mov r2, why @ 'syscall'
Al Viro0a267fa2012-07-19 17:47:55 +010083 bl do_work_pending
Al Viro66285212012-07-19 17:48:50 +010084 cmp r0, #0
Al Viro81783782012-07-19 17:48:21 +010085 beq no_work_pending
Al Viro66285212012-07-19 17:48:50 +010086 movlt scno, #(__NR_restart_syscall - __NR_SYSCALL_BASE)
Al Viro81783782012-07-19 17:48:21 +010087 ldmia sp, {r0 - r6} @ have to reload r0 - r6
88 b local_restart @ ... and off we go
Drew Richardsone83dd372015-08-06 18:50:27 +010089ENDPROC(ret_fast_syscall)
Al Viro81783782012-07-19 17:48:21 +010090
Linus Torvalds1da177e2005-04-16 15:20:36 -070091/*
92 * "slow" syscall return path. "why" tells us if this was a real syscall.
Russell King3302cad2015-08-20 16:13:37 +010093 * IRQs may be enabled here, so always disable them. Note that we use the
94 * "notrace" version to avoid calling into the tracing code unnecessarily.
95 * do_work_pending() will update this state if necessary.
Linus Torvalds1da177e2005-04-16 15:20:36 -070096 */
97ENTRY(ret_to_user)
98ret_slow_syscall:
Russell King3302cad2015-08-20 16:13:37 +010099 disable_irq_notrace @ disable interrupts
Ming Lei9fc25522011-06-05 02:24:58 +0100100ENTRY(ret_to_user_from_irq)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700101 ldr r1, [tsk, #TI_FLAGS]
102 tst r1, #_TIF_WORK_MASK
Russell King3302cad2015-08-20 16:13:37 +0100103 bne slow_work_pending
Linus Torvalds1da177e2005-04-16 15:20:36 -0700104no_work_pending:
Russell King3302cad2015-08-20 16:13:37 +0100105 asm_trace_hardirqs_on save = 0
Russell King651e9492013-03-28 11:44:25 +0000106
Dan Williamsf80dff92007-02-16 22:16:32 +0100107 /* perform architecture specific actions before user return */
108 arch_ret_to_user r1, lr
Kevin Hilmanb0088482013-03-28 22:54:40 +0100109 ct_user_enter save = 0
Dan Williamsf80dff92007-02-16 22:16:32 +0100110
Catalin Marinasb86040a2009-07-24 12:32:54 +0100111 restore_user_regs fast = 0, offset = 0
Ming Lei9fc25522011-06-05 02:24:58 +0100112ENDPROC(ret_to_user_from_irq)
Catalin Marinas93ed3972008-08-28 11:22:32 +0100113ENDPROC(ret_to_user)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700114
115/*
116 * This is how we return from a fork.
117 */
118ENTRY(ret_from_fork)
119 bl schedule_tail
Al Viro9fff2fa2012-10-10 22:23:29 -0400120 cmp r5, #0
121 movne r0, r4
Russell King14327c62015-04-21 14:17:25 +0100122 badrne lr, 1f
Russell King6ebbf2c2014-06-30 16:29:12 +0100123 retne r5
Russell King68687c82012-10-15 00:16:49 +01001241: get_thread_info tsk
Linus Torvalds1da177e2005-04-16 15:20:36 -0700125 b ret_slow_syscall
Catalin Marinas93ed3972008-08-28 11:22:32 +0100126ENDPROC(ret_from_fork)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700127
Linus Torvalds1da177e2005-04-16 15:20:36 -0700128/*=============================================================================
129 * SWI handler
130 *-----------------------------------------------------------------------------
131 */
132
Linus Torvalds1da177e2005-04-16 15:20:36 -0700133 .align 5
134ENTRY(vector_swi)
Uwe Kleine-König19c4d592010-05-21 18:06:42 +0100135#ifdef CONFIG_CPU_V7M
136 v7m_exception_entry
137#else
Russell King5745eef62016-05-10 16:34:27 +0100138 sub sp, sp, #PT_REGS_SIZE
Russell Kingf4dc9a42005-04-26 15:20:34 +0100139 stmia sp, {r0 - r12} @ Calling r0 - r12
Catalin Marinasb86040a2009-07-24 12:32:54 +0100140 ARM( add r8, sp, #S_PC )
141 ARM( stmdb r8, {sp, lr}^ ) @ Calling sp, lr
142 THUMB( mov r8, sp )
143 THUMB( store_user_sp_lr r8, r10, S_SP ) @ calling sp, lr
Russell Kingf4dc9a42005-04-26 15:20:34 +0100144 mrs r8, spsr @ called from non-FIQ mode, so ok.
145 str lr, [sp, #S_PC] @ Save calling PC
146 str r8, [sp, #S_PSR] @ Save CPSR
147 str r0, [sp, #S_OLD_R0] @ Save OLD_R0
Uwe Kleine-König19c4d592010-05-21 18:06:42 +0100148#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -0700149 zero_fp
Russell King195b58a2014-08-28 13:08:14 +0100150 alignment_trap r10, ip, __cr_alignment
Will Deacon1aa2b3b2013-06-05 11:25:13 +0100151 enable_irq
152 ct_user_exit
153 get_thread_info tsk
154
Russell Kinge0f9f4a2005-04-26 15:19:24 +0100155 /*
156 * Get the system call number.
157 */
Nicolas Pitre3f2829a2006-01-14 16:31:29 +0000158
Nicolas Pitredd35afc2006-01-14 16:36:12 +0000159#if defined(CONFIG_OABI_COMPAT)
Nicolas Pitre3f2829a2006-01-14 16:31:29 +0000160
Nicolas Pitredd35afc2006-01-14 16:36:12 +0000161 /*
162 * If we have CONFIG_OABI_COMPAT then we need to look at the swi
163 * value to determine if it is an EABI or an old ABI call.
164 */
165#ifdef CONFIG_ARM_THUMB
166 tst r8, #PSR_T_BIT
167 movne r10, #0 @ no thumb OABI emulation
Will Deacon1aa2b3b2013-06-05 11:25:13 +0100168 USER( ldreq r10, [lr, #-4] ) @ get SWI instruction
Nicolas Pitredd35afc2006-01-14 16:36:12 +0000169#else
Will Deacon1aa2b3b2013-06-05 11:25:13 +0100170 USER( ldr r10, [lr, #-4] ) @ get SWI instruction
Nicolas Pitredd35afc2006-01-14 16:36:12 +0000171#endif
Ben Dooks457c2402013-02-12 18:59:57 +0000172 ARM_BE8(rev r10, r10) @ little endian instruction
Nicolas Pitredd35afc2006-01-14 16:36:12 +0000173
174#elif defined(CONFIG_AEABI)
175
176 /*
177 * Pure EABI user space always put syscall number into scno (r7).
178 */
Nicolas Pitre3f2829a2006-01-14 16:31:29 +0000179#elif defined(CONFIG_ARM_THUMB)
Nicolas Pitredd35afc2006-01-14 16:36:12 +0000180 /* Legacy ABI only, possibly thumb mode. */
Russell Kinge0f9f4a2005-04-26 15:19:24 +0100181 tst r8, #PSR_T_BIT @ this is SPSR from save_user_regs
182 addne scno, r7, #__NR_SYSCALL_BASE @ put OS number in
Will Deacon1aa2b3b2013-06-05 11:25:13 +0100183 USER( ldreq scno, [lr, #-4] )
Nicolas Pitredd35afc2006-01-14 16:36:12 +0000184
Russell Kinge0f9f4a2005-04-26 15:19:24 +0100185#else
Nicolas Pitredd35afc2006-01-14 16:36:12 +0000186 /* Legacy ABI only. */
Will Deacon1aa2b3b2013-06-05 11:25:13 +0100187 USER( ldr scno, [lr, #-4] ) @ get SWI instruction
Russell Kinge0f9f4a2005-04-26 15:19:24 +0100188#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -0700189
Russell King2190fed2015-08-20 10:32:02 +0100190 uaccess_disable tbl
191
Nicolas Pitredd35afc2006-01-14 16:36:12 +0000192 adr tbl, sys_call_table @ load syscall table pointer
Nicolas Pitredd35afc2006-01-14 16:36:12 +0000193
194#if defined(CONFIG_OABI_COMPAT)
195 /*
196 * If the swi argument is zero, this is an EABI call and we do nothing.
197 *
198 * If this is an old ABI call, get the syscall number into scno and
199 * get the old ABI syscall table address.
200 */
201 bics r10, r10, #0xff000000
202 eorne scno, r10, #__NR_OABI_SYSCALL_BASE
203 ldrne tbl, =sys_oabi_call_table
204#elif !defined(CONFIG_AEABI)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700205 bic scno, scno, #0xff000000 @ mask off SWI op-code
Russell Kinge0f9f4a2005-04-26 15:19:24 +0100206 eor scno, scno, #__NR_SYSCALL_BASE @ check OS number
Nicolas Pitre3f2829a2006-01-14 16:31:29 +0000207#endif
Nicolas Pitredd35afc2006-01-14 16:36:12 +0000208
Al Viro81783782012-07-19 17:48:21 +0100209local_restart:
Nicolas Pitre70c70d92010-08-26 15:08:35 -0700210 ldr r10, [tsk, #TI_FLAGS] @ check for syscall tracing
Nicolas Pitre3f2829a2006-01-14 16:31:29 +0000211 stmdb sp!, {r4, r5} @ push fifth and sixth args
Nicolas Pitre70c70d92010-08-26 15:08:35 -0700212
Nathaniel Husted29ef73b2012-01-03 14:23:09 -0500213 tst r10, #_TIF_SYSCALL_WORK @ are we tracing syscalls?
Linus Torvalds1da177e2005-04-16 15:20:36 -0700214 bne __sys_trace
215
Linus Torvalds1da177e2005-04-16 15:20:36 -0700216 cmp scno, #NR_syscalls @ check upper syscall limit
Russell King14327c62015-04-21 14:17:25 +0100217 badr lr, ret_fast_syscall @ return address
Linus Torvalds1da177e2005-04-16 15:20:36 -0700218 ldrcc pc, [tbl, scno, lsl #2] @ call sys_* routine
219
220 add r1, sp, #S_OFF
Will Deacond95bc252013-09-19 10:32:20 +01002212: cmp scno, #(__ARM_NR_BASE - __NR_SYSCALL_BASE)
Russell Kinge0f9f4a2005-04-26 15:19:24 +0100222 eor r0, scno, #__NR_SYSCALL_BASE @ put OS number back
Will Deacon377747c2013-05-13 19:16:34 +0100223 bcs arm_syscall
Will Deacond95bc252013-09-19 10:32:20 +0100224 mov why, #0 @ no longer a real syscall
Linus Torvalds1da177e2005-04-16 15:20:36 -0700225 b sys_ni_syscall @ not private func
Will Deacon1aa2b3b2013-06-05 11:25:13 +0100226
227#if defined(CONFIG_OABI_COMPAT) || !defined(CONFIG_AEABI)
228 /*
229 * We failed to handle a fault trying to access the page
230 * containing the swi instruction, but we're not really in a
231 * position to return -EFAULT. Instead, return back to the
232 * instruction and re-enter the user fault handling path trying
233 * to page it in. This will likely result in sending SEGV to the
234 * current task.
235 */
2369001:
237 sub lr, lr, #4
238 str lr, [sp, #S_PC]
239 b ret_fast_syscall
240#endif
Catalin Marinas93ed3972008-08-28 11:22:32 +0100241ENDPROC(vector_swi)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700242
243 /*
244 * This is the really slow path. We're going to be doing
245 * context switches, and waiting for our parent to respond.
246 */
247__sys_trace:
Will Deaconad722542012-07-06 15:50:14 +0100248 mov r1, scno
249 add r0, sp, #S_OFF
250 bl syscall_trace_enter
Linus Torvalds1da177e2005-04-16 15:20:36 -0700251
Russell King14327c62015-04-21 14:17:25 +0100252 badr lr, __sys_trace_return @ return address
Nicolas Pitre3f471122006-01-14 19:30:04 +0000253 mov scno, r0 @ syscall number (possibly new)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700254 add r1, sp, #S_R0 + S_OFF @ pointer to regs
255 cmp scno, #NR_syscalls @ check upper syscall limit
Will Deaconc7aa00d2012-07-19 17:49:22 +0100256 ldmccia r1, {r0 - r6} @ have to reload r0 - r6
257 stmccia sp, {r4, r5} @ and update the stack args
Linus Torvalds1da177e2005-04-16 15:20:36 -0700258 ldrcc pc, [tbl, scno, lsl #2] @ call sys_* routine
Kees Cookad75b512012-11-15 22:12:17 +0100259 cmp scno, #-1 @ skip the syscall?
260 bne 2b
261 add sp, sp, #S_OFF @ restore stack
262 b ret_slow_syscall
Linus Torvalds1da177e2005-04-16 15:20:36 -0700263
264__sys_trace_return:
265 str r0, [sp, #S_R0 + S_OFF]! @ save returned r0
Will Deaconad722542012-07-06 15:50:14 +0100266 mov r0, sp
267 bl syscall_trace_exit
Linus Torvalds1da177e2005-04-16 15:20:36 -0700268 b ret_slow_syscall
269
Russell King3302cad2015-08-20 16:13:37 +0100270__sys_trace_return_nosave:
Russell Kinge0aa3a62015-08-20 17:39:32 +0100271 enable_irq_notrace
Russell King3302cad2015-08-20 16:13:37 +0100272 mov r0, sp
273 bl syscall_trace_exit
274 b ret_slow_syscall
275
Linus Torvalds1da177e2005-04-16 15:20:36 -0700276 .align 5
277#ifdef CONFIG_ALIGNMENT_TRAP
278 .type __cr_alignment, #object
279__cr_alignment:
280 .word cr_alignment
281#endif
Nicolas Pitredd35afc2006-01-14 16:36:12 +0000282 .ltorg
283
Russell King96a8fae2016-10-18 19:57:01 +0100284 .macro syscall_table_start, sym
285 .equ __sys_nr, 0
286 .type \sym, #object
287ENTRY(\sym)
288 .endm
289
290 .macro syscall, nr, func
291 .ifgt __sys_nr - \nr
292 .error "Duplicated/unorded system call entry"
293 .endif
294 .rept \nr - __sys_nr
295 .long sys_ni_syscall
296 .endr
297 .long \func
298 .equ __sys_nr, \nr + 1
299 .endm
300
301 .macro syscall_table_end, sym
302 .ifgt __sys_nr - __NR_syscalls
303 .error "System call table too big"
304 .endif
305 .rept __NR_syscalls - __sys_nr
306 .long sys_ni_syscall
307 .endr
308 .size \sym, . - \sym
309 .endm
310
311#define NATIVE(nr, func) syscall nr, func
312
Nicolas Pitredd35afc2006-01-14 16:36:12 +0000313/*
314 * This is the syscall table declaration for native ABI syscalls.
315 * With EABI a couple syscalls are obsolete and defined as sys_ni_syscall.
316 */
Russell King96a8fae2016-10-18 19:57:01 +0100317 syscall_table_start sys_call_table
318#define COMPAT(nr, native, compat) syscall nr, native
Nicolas Pitredd35afc2006-01-14 16:36:12 +0000319#ifdef CONFIG_AEABI
Russell King96a8fae2016-10-18 19:57:01 +0100320#include <calls-eabi.S>
Nicolas Pitredd35afc2006-01-14 16:36:12 +0000321#else
Russell King96a8fae2016-10-18 19:57:01 +0100322#include <calls-oabi.S>
Nicolas Pitredd35afc2006-01-14 16:36:12 +0000323#endif
Russell King96a8fae2016-10-18 19:57:01 +0100324#undef COMPAT
325 syscall_table_end sys_call_table
Linus Torvalds1da177e2005-04-16 15:20:36 -0700326
327/*============================================================================
328 * Special system call wrappers
329 */
330@ r0 = syscall number
Russell King567bd982005-12-17 15:25:42 +0000331@ r8 = syscall table
Linus Torvalds1da177e2005-04-16 15:20:36 -0700332sys_syscall:
Paul Brook52475932006-05-16 14:25:55 +0100333 bic scno, r0, #__NR_OABI_SYSCALL_BASE
Linus Torvalds1da177e2005-04-16 15:20:36 -0700334 cmp scno, #__NR_syscall - __NR_SYSCALL_BASE
335 cmpne scno, #NR_syscalls @ check range
336 stmloia sp, {r5, r6} @ shuffle args
337 movlo r0, r1
338 movlo r1, r2
339 movlo r2, r3
340 movlo r3, r4
341 ldrlo pc, [tbl, scno, lsl #2]
342 b sys_ni_syscall
Catalin Marinas93ed3972008-08-28 11:22:32 +0100343ENDPROC(sys_syscall)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700344
Linus Torvalds1da177e2005-04-16 15:20:36 -0700345sys_sigreturn_wrapper:
346 add r0, sp, #S_OFF
Al Viro653d48b2010-09-17 14:34:39 +0100347 mov why, #0 @ prevent syscall restart handling
Linus Torvalds1da177e2005-04-16 15:20:36 -0700348 b sys_sigreturn
Catalin Marinas93ed3972008-08-28 11:22:32 +0100349ENDPROC(sys_sigreturn_wrapper)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700350
351sys_rt_sigreturn_wrapper:
352 add r0, sp, #S_OFF
Al Viro653d48b2010-09-17 14:34:39 +0100353 mov why, #0 @ prevent syscall restart handling
Linus Torvalds1da177e2005-04-16 15:20:36 -0700354 b sys_rt_sigreturn
Catalin Marinas93ed3972008-08-28 11:22:32 +0100355ENDPROC(sys_rt_sigreturn_wrapper)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700356
Nicolas Pitre713c4812006-01-14 16:35:03 +0000357sys_statfs64_wrapper:
358 teq r1, #88
359 moveq r1, #84
360 b sys_statfs64
Catalin Marinas93ed3972008-08-28 11:22:32 +0100361ENDPROC(sys_statfs64_wrapper)
Nicolas Pitre713c4812006-01-14 16:35:03 +0000362
363sys_fstatfs64_wrapper:
364 teq r1, #88
365 moveq r1, #84
366 b sys_fstatfs64
Catalin Marinas93ed3972008-08-28 11:22:32 +0100367ENDPROC(sys_fstatfs64_wrapper)
Nicolas Pitre713c4812006-01-14 16:35:03 +0000368
Linus Torvalds1da177e2005-04-16 15:20:36 -0700369/*
370 * Note: off_4k (r5) is always units of 4K. If we can't do the requested
371 * offset, we return EINVAL.
372 */
373sys_mmap2:
374#if PAGE_SHIFT > 12
375 tst r5, #PGOFF_MASK
376 moveq r5, r5, lsr #PAGE_SHIFT - 12
377 streq r5, [sp, #4]
Al Virof8b72562009-11-30 17:37:04 -0500378 beq sys_mmap_pgoff
Linus Torvalds1da177e2005-04-16 15:20:36 -0700379 mov r0, #-EINVAL
Russell King6ebbf2c2014-06-30 16:29:12 +0100380 ret lr
Linus Torvalds1da177e2005-04-16 15:20:36 -0700381#else
382 str r5, [sp, #4]
Al Virof8b72562009-11-30 17:37:04 -0500383 b sys_mmap_pgoff
Linus Torvalds1da177e2005-04-16 15:20:36 -0700384#endif
Catalin Marinas93ed3972008-08-28 11:22:32 +0100385ENDPROC(sys_mmap2)
Nicolas Pitre687ad012006-01-14 16:35:31 +0000386
387#ifdef CONFIG_OABI_COMPAT
Nicolas Pitredd35afc2006-01-14 16:36:12 +0000388
Nicolas Pitre687ad012006-01-14 16:35:31 +0000389/*
390 * These are syscalls with argument register differences
391 */
392
393sys_oabi_pread64:
394 stmia sp, {r3, r4}
395 b sys_pread64
Catalin Marinas93ed3972008-08-28 11:22:32 +0100396ENDPROC(sys_oabi_pread64)
Nicolas Pitre687ad012006-01-14 16:35:31 +0000397
398sys_oabi_pwrite64:
399 stmia sp, {r3, r4}
400 b sys_pwrite64
Catalin Marinas93ed3972008-08-28 11:22:32 +0100401ENDPROC(sys_oabi_pwrite64)
Nicolas Pitre687ad012006-01-14 16:35:31 +0000402
403sys_oabi_truncate64:
404 mov r3, r2
405 mov r2, r1
406 b sys_truncate64
Catalin Marinas93ed3972008-08-28 11:22:32 +0100407ENDPROC(sys_oabi_truncate64)
Nicolas Pitre687ad012006-01-14 16:35:31 +0000408
409sys_oabi_ftruncate64:
410 mov r3, r2
411 mov r2, r1
412 b sys_ftruncate64
Catalin Marinas93ed3972008-08-28 11:22:32 +0100413ENDPROC(sys_oabi_ftruncate64)
Nicolas Pitre687ad012006-01-14 16:35:31 +0000414
415sys_oabi_readahead:
416 str r3, [sp]
417 mov r3, r2
418 mov r2, r1
419 b sys_readahead
Catalin Marinas93ed3972008-08-28 11:22:32 +0100420ENDPROC(sys_oabi_readahead)
Nicolas Pitre687ad012006-01-14 16:35:31 +0000421
Nicolas Pitredd35afc2006-01-14 16:36:12 +0000422/*
423 * Let's declare a second syscall table for old ABI binaries
424 * using the compatibility syscall entries.
425 */
Russell King96a8fae2016-10-18 19:57:01 +0100426 syscall_table_start sys_oabi_call_table
427#define COMPAT(nr, native, compat) syscall nr, compat
428#include <calls-oabi.S>
429 syscall_table_end sys_oabi_call_table
Nicolas Pitredd35afc2006-01-14 16:36:12 +0000430
Nicolas Pitre687ad012006-01-14 16:35:31 +0000431#endif
432