xref: /linux/arch/mips/kernel/scall32-o32.S (revision c04030e16dbea2f7581f82cc6688695927f6ac5b)
11da177e4SLinus Torvalds/*
21da177e4SLinus Torvalds * This file is subject to the terms and conditions of the GNU General Public
31da177e4SLinus Torvalds * License.  See the file "COPYING" in the main directory of this archive
41da177e4SLinus Torvalds * for more details.
51da177e4SLinus Torvalds *
61da177e4SLinus Torvalds * Copyright (C) 1995, 96, 97, 98, 99, 2000, 01, 02 by Ralf Baechle
71da177e4SLinus Torvalds * Copyright (C) 2001 MIPS Technologies, Inc.
81da177e4SLinus Torvalds * Copyright (C) 2004 Thiemo Seufer
91da177e4SLinus Torvalds */
101da177e4SLinus Torvalds#include <linux/config.h>
111da177e4SLinus Torvalds#include <linux/errno.h>
121da177e4SLinus Torvalds#include <asm/asm.h>
131da177e4SLinus Torvalds#include <asm/asmmacro.h>
141da177e4SLinus Torvalds#include <asm/mipsregs.h>
151da177e4SLinus Torvalds#include <asm/regdef.h>
161da177e4SLinus Torvalds#include <asm/stackframe.h>
171da177e4SLinus Torvalds#include <asm/isadep.h>
181da177e4SLinus Torvalds#include <asm/sysmips.h>
191da177e4SLinus Torvalds#include <asm/thread_info.h>
201da177e4SLinus Torvalds#include <asm/unistd.h>
211da177e4SLinus Torvalds#include <asm/war.h>
22048eb582SSam Ravnborg#include <asm/asm-offsets.h>
231da177e4SLinus Torvalds
241da177e4SLinus Torvalds/* Highest syscall used of any syscall flavour */
251da177e4SLinus Torvalds#define MAX_SYSCALL_NO	__NR_O32_Linux + __NR_O32_Linux_syscalls
261da177e4SLinus Torvalds
271da177e4SLinus Torvalds	.align  5
281da177e4SLinus TorvaldsNESTED(handle_sys, PT_SIZE, sp)
291da177e4SLinus Torvalds	.set	noat
301da177e4SLinus Torvalds	SAVE_SOME
311da177e4SLinus Torvalds	STI
321da177e4SLinus Torvalds	.set	at
331da177e4SLinus Torvalds
341da177e4SLinus Torvalds	lw	t1, PT_EPC(sp)		# skip syscall on return
351da177e4SLinus Torvalds
361da177e4SLinus Torvalds#if defined(CONFIG_BINFMT_IRIX)
371da177e4SLinus Torvalds	sltiu	t0, v0, MAX_SYSCALL_NO + 1 # check syscall number
381da177e4SLinus Torvalds#else
391da177e4SLinus Torvalds	subu	v0, v0, __NR_O32_Linux	# check syscall number
401da177e4SLinus Torvalds	sltiu	t0, v0, __NR_O32_Linux_syscalls + 1
411da177e4SLinus Torvalds#endif
421da177e4SLinus Torvalds	addiu	t1, 4			# skip to next instruction
431da177e4SLinus Torvalds	sw	t1, PT_EPC(sp)
441da177e4SLinus Torvalds	beqz	t0, illegal_syscall
451da177e4SLinus Torvalds
461da177e4SLinus Torvalds	sll	t0, v0, 3
471da177e4SLinus Torvalds	la	t1, sys_call_table
481da177e4SLinus Torvalds	addu	t1, t0
491da177e4SLinus Torvalds	lw	t2, (t1)		# syscall routine
501da177e4SLinus Torvalds	lw	t3, 4(t1)		# >= 0 if we need stack arguments
511da177e4SLinus Torvalds	beqz	t2, illegal_syscall
521da177e4SLinus Torvalds
531da177e4SLinus Torvalds	sw	a3, PT_R26(sp)		# save a3 for syscall restarting
541da177e4SLinus Torvalds	bgez	t3, stackargs
551da177e4SLinus Torvalds
561da177e4SLinus Torvaldsstack_done:
571da177e4SLinus Torvalds	lw	t0, TI_FLAGS($28)	# syscall tracing enabled?
581da177e4SLinus Torvalds	li	t1, _TIF_SYSCALL_TRACE | _TIF_SYSCALL_AUDIT
591da177e4SLinus Torvalds	and	t0, t1
601da177e4SLinus Torvalds	bnez	t0, syscall_trace_entry	# -> yes
611da177e4SLinus Torvalds
621da177e4SLinus Torvalds	jalr	t2			# Do The Real Thing (TM)
631da177e4SLinus Torvalds
641da177e4SLinus Torvalds	li	t0, -EMAXERRNO - 1	# error?
651da177e4SLinus Torvalds	sltu	t0, t0, v0
661da177e4SLinus Torvalds	sw	t0, PT_R7(sp)		# set error flag
671da177e4SLinus Torvalds	beqz	t0, 1f
681da177e4SLinus Torvalds
691da177e4SLinus Torvalds	negu	v0			# error
701da177e4SLinus Torvalds	sw	v0, PT_R0(sp)		# set flag for syscall
711da177e4SLinus Torvalds					# restarting
721da177e4SLinus Torvalds1:	sw	v0, PT_R2(sp)		# result
731da177e4SLinus Torvalds
741da177e4SLinus Torvaldso32_syscall_exit:
751da177e4SLinus Torvalds	local_irq_disable		# make sure need_resched and
761da177e4SLinus Torvalds					# signals dont change between
771da177e4SLinus Torvalds					# sampling and return
781da177e4SLinus Torvalds	lw	a2, TI_FLAGS($28)	# current->work
791da177e4SLinus Torvalds	li	t0, _TIF_ALLWORK_MASK
801da177e4SLinus Torvalds	and	t0, a2
811da177e4SLinus Torvalds	bnez	t0, o32_syscall_exit_work
821da177e4SLinus Torvalds
831da177e4SLinus Torvalds	j	restore_partial
841da177e4SLinus Torvalds
851da177e4SLinus Torvaldso32_syscall_exit_work:
861da177e4SLinus Torvalds	j	syscall_exit_work_partial
871da177e4SLinus Torvalds
881da177e4SLinus Torvalds/* ------------------------------------------------------------------------ */
891da177e4SLinus Torvalds
901da177e4SLinus Torvaldssyscall_trace_entry:
911da177e4SLinus Torvalds	SAVE_STATIC
921da177e4SLinus Torvalds	move	s0, t2
931da177e4SLinus Torvalds	move	a0, sp
941da177e4SLinus Torvalds	li	a1, 0
951da177e4SLinus Torvalds	jal	do_syscall_trace
961da177e4SLinus Torvalds
9704a7052cSRalf Baechle	move	t0, s0
9804a7052cSRalf Baechle	RESTORE_STATIC
991da177e4SLinus Torvalds	lw	a0, PT_R4(sp)		# Restore argument registers
1001da177e4SLinus Torvalds	lw	a1, PT_R5(sp)
1011da177e4SLinus Torvalds	lw	a2, PT_R6(sp)
1021da177e4SLinus Torvalds	lw	a3, PT_R7(sp)
10304a7052cSRalf Baechle	jalr	t0
1041da177e4SLinus Torvalds
1051da177e4SLinus Torvalds	li	t0, -EMAXERRNO - 1	# error?
1061da177e4SLinus Torvalds	sltu	t0, t0, v0
1071da177e4SLinus Torvalds	sw	t0, PT_R7(sp)		# set error flag
1081da177e4SLinus Torvalds	beqz	t0, 1f
1091da177e4SLinus Torvalds
1101da177e4SLinus Torvalds	negu	v0			# error
1111da177e4SLinus Torvalds	sw	v0, PT_R0(sp)		# set flag for syscall
1121da177e4SLinus Torvalds					# restarting
1131da177e4SLinus Torvalds1:	sw	v0, PT_R2(sp)		# result
1141da177e4SLinus Torvalds
1151da177e4SLinus Torvalds	j	syscall_exit
1161da177e4SLinus Torvalds
1171da177e4SLinus Torvalds/* ------------------------------------------------------------------------ */
1181da177e4SLinus Torvalds
1191da177e4SLinus Torvalds	/*
1201da177e4SLinus Torvalds	 * More than four arguments.  Try to deal with it by copying the
1211da177e4SLinus Torvalds	 * stack arguments from the user stack to the kernel stack.
1221da177e4SLinus Torvalds	 * This Sucks (TM).
1231da177e4SLinus Torvalds	 */
1241da177e4SLinus Torvaldsstackargs:
1251da177e4SLinus Torvalds	lw	t0, PT_R29(sp)		# get old user stack pointer
1261da177e4SLinus Torvalds
1271da177e4SLinus Torvalds	/*
1281da177e4SLinus Torvalds	 * We intentionally keep the kernel stack a little below the top of
1291da177e4SLinus Torvalds	 * userspace so we don't have to do a slower byte accurate check here.
1301da177e4SLinus Torvalds	 */
1311da177e4SLinus Torvalds	lw	t5, TI_ADDR_LIMIT($28)
1321da177e4SLinus Torvalds	addu	t4, t0, 32
1331da177e4SLinus Torvalds	and	t5, t4
1341da177e4SLinus Torvalds	bltz	t5, bad_stack		# -> sp is bad
1351da177e4SLinus Torvalds
1361da177e4SLinus Torvalds	/* Ok, copy the args from the luser stack to the kernel stack.
1371da177e4SLinus Torvalds	 * t3 is the precomputed number of instruction bytes needed to
1381da177e4SLinus Torvalds	 * load or store arguments 6-8.
1391da177e4SLinus Torvalds	 */
1401da177e4SLinus Torvalds
1411da177e4SLinus Torvalds	la	t1, 5f			# load up to 3 arguments
1421da177e4SLinus Torvalds	subu	t1, t3
1431da177e4SLinus Torvalds1:	lw	t5, 16(t0)		# argument #5 from usp
1441da177e4SLinus Torvalds	.set    push
1451da177e4SLinus Torvalds	.set    noreorder
1461da177e4SLinus Torvalds	.set	nomacro
1471da177e4SLinus Torvalds	jr	t1
1481da177e4SLinus Torvalds	 addiu	t1, 6f - 5f
1491da177e4SLinus Torvalds
1501da177e4SLinus Torvalds2:	lw	t8, 28(t0)		# argument #8 from usp
1511da177e4SLinus Torvalds3:	lw	t7, 24(t0)		# argument #7 from usp
1521da177e4SLinus Torvalds4:	lw	t6, 20(t0)		# argument #6 from usp
1531da177e4SLinus Torvalds5:	jr	t1
1541da177e4SLinus Torvalds	 sw	t5, 16(sp)		# argument #5 to ksp
1551da177e4SLinus Torvalds
1561da177e4SLinus Torvalds	sw	t8, 28(sp)		# argument #8 to ksp
1571da177e4SLinus Torvalds	sw	t7, 24(sp)		# argument #7 to ksp
1581da177e4SLinus Torvalds	sw	t6, 20(sp)		# argument #6 to ksp
1591da177e4SLinus Torvalds6:	j	stack_done		# go back
1601da177e4SLinus Torvalds	 nop
1611da177e4SLinus Torvalds	.set	pop
1621da177e4SLinus Torvalds
1631da177e4SLinus Torvalds	.section __ex_table,"a"
1641da177e4SLinus Torvalds	PTR	1b,bad_stack
1651da177e4SLinus Torvalds	PTR	2b,bad_stack
1661da177e4SLinus Torvalds	PTR	3b,bad_stack
1671da177e4SLinus Torvalds	PTR	4b,bad_stack
1681da177e4SLinus Torvalds	.previous
1691da177e4SLinus Torvalds
1701da177e4SLinus Torvalds	/*
1711da177e4SLinus Torvalds	 * The stackpointer for a call with more than 4 arguments is bad.
1721da177e4SLinus Torvalds	 * We probably should handle this case a bit more drastic.
1731da177e4SLinus Torvalds	 */
1741da177e4SLinus Torvaldsbad_stack:
1751da177e4SLinus Torvalds	negu	v0				# error
1761da177e4SLinus Torvalds	sw	v0, PT_R0(sp)
1771da177e4SLinus Torvalds	sw	v0, PT_R2(sp)
1781da177e4SLinus Torvalds	li	t0, 1				# set error flag
1791da177e4SLinus Torvalds	sw	t0, PT_R7(sp)
1801da177e4SLinus Torvalds	j	o32_syscall_exit
1811da177e4SLinus Torvalds
1821da177e4SLinus Torvalds	/*
1831da177e4SLinus Torvalds	 * The system call does not exist in this kernel
1841da177e4SLinus Torvalds	 */
1851da177e4SLinus Torvaldsillegal_syscall:
1861da177e4SLinus Torvalds	li	v0, -ENOSYS			# error
1871da177e4SLinus Torvalds	sw	v0, PT_R2(sp)
1881da177e4SLinus Torvalds	li	t0, 1				# set error flag
1891da177e4SLinus Torvalds	sw	t0, PT_R7(sp)
1901da177e4SLinus Torvalds	j	o32_syscall_exit
1911da177e4SLinus Torvalds	END(handle_sys)
1921da177e4SLinus Torvalds
1931da177e4SLinus Torvalds	LEAF(mips_atomic_set)
1941da177e4SLinus Torvalds	andi	v0, a1, 3			# must be word aligned
1951da177e4SLinus Torvalds	bnez	v0, bad_alignment
1961da177e4SLinus Torvalds
1971da177e4SLinus Torvalds	lw	v1, TI_ADDR_LIMIT($28)		# in legal address range?
1981da177e4SLinus Torvalds	addiu	a0, a1, 4
1991da177e4SLinus Torvalds	or	a0, a0, a1
2001da177e4SLinus Torvalds	and	a0, a0, v1
2011da177e4SLinus Torvalds	bltz	a0, bad_address
2021da177e4SLinus Torvalds
2031da177e4SLinus Torvalds#ifdef CONFIG_CPU_HAS_LLSC
2041da177e4SLinus Torvalds	/* Ok, this is the ll/sc case.  World is sane :-)  */
2051da177e4SLinus Torvalds1:	ll	v0, (a1)
2061da177e4SLinus Torvalds	move	a0, a2
2071da177e4SLinus Torvalds2:	sc	a0, (a1)
2081da177e4SLinus Torvalds#if R10000_LLSC_WAR
2091da177e4SLinus Torvalds	beqzl	a0, 1b
2101da177e4SLinus Torvalds#else
2111da177e4SLinus Torvalds	beqz	a0, 1b
2121da177e4SLinus Torvalds#endif
2131da177e4SLinus Torvalds
2141da177e4SLinus Torvalds	.section __ex_table,"a"
2151da177e4SLinus Torvalds	PTR	1b, bad_stack
2161da177e4SLinus Torvalds	PTR	2b, bad_stack
2171da177e4SLinus Torvalds	.previous
2181da177e4SLinus Torvalds#else
2191da177e4SLinus Torvalds	sw	a1, 16(sp)
2201da177e4SLinus Torvalds	sw	a2, 20(sp)
2211da177e4SLinus Torvalds
2221da177e4SLinus Torvalds	move	a0, sp
2231da177e4SLinus Torvalds	move	a2, a1
2241da177e4SLinus Torvalds	li	a1, 1
2251da177e4SLinus Torvalds	jal	do_page_fault
2261da177e4SLinus Torvalds
2271da177e4SLinus Torvalds	lw	a1, 16(sp)
2281da177e4SLinus Torvalds	lw	a2, 20(sp)
2291da177e4SLinus Torvalds
2301da177e4SLinus Torvalds	/*
2311da177e4SLinus Torvalds	 * At this point the page should be readable and writable unless
2321da177e4SLinus Torvalds	 * there was no more memory available.
2331da177e4SLinus Torvalds	 */
2341da177e4SLinus Torvalds1:	lw	v0, (a1)
2351da177e4SLinus Torvalds2:	sw	a2, (a1)
2361da177e4SLinus Torvalds
2371da177e4SLinus Torvalds	.section __ex_table,"a"
2381da177e4SLinus Torvalds	PTR	1b, no_mem
2391da177e4SLinus Torvalds	PTR	2b, no_mem
2401da177e4SLinus Torvalds	.previous
2411da177e4SLinus Torvalds#endif
2421da177e4SLinus Torvalds
2431da177e4SLinus Torvalds	sw	zero, PT_R7(sp)		# success
2441da177e4SLinus Torvalds	sw	v0, PT_R2(sp)		# result
2451da177e4SLinus Torvalds
246edcb98d1SRalf Baechle	j	o32_syscall_exit	# continue like a normal syscall
2471da177e4SLinus Torvalds
2481da177e4SLinus Torvaldsno_mem:	li	v0, -ENOMEM
2491da177e4SLinus Torvalds	jr	ra
2501da177e4SLinus Torvalds
2511da177e4SLinus Torvaldsbad_address:
2521da177e4SLinus Torvalds	li	v0, -EFAULT
2531da177e4SLinus Torvalds	jr	ra
2541da177e4SLinus Torvalds
2551da177e4SLinus Torvaldsbad_alignment:
2561da177e4SLinus Torvalds	li	v0, -EINVAL
2571da177e4SLinus Torvalds	jr	ra
2581da177e4SLinus Torvalds	END(mips_atomic_set)
2591da177e4SLinus Torvalds
2601da177e4SLinus Torvalds	LEAF(sys_sysmips)
2611da177e4SLinus Torvalds	beq	a0, MIPS_ATOMIC_SET, mips_atomic_set
2621da177e4SLinus Torvalds	j	_sys_sysmips
2631da177e4SLinus Torvalds	END(sys_sysmips)
2641da177e4SLinus Torvalds
2651da177e4SLinus Torvalds	LEAF(sys_syscall)
2661da177e4SLinus Torvalds#if defined(CONFIG_BINFMT_IRIX)
2671da177e4SLinus Torvalds	sltiu	v0, a0, MAX_SYSCALL_NO + 1 # check syscall number
2681da177e4SLinus Torvalds#else
2691da177e4SLinus Torvalds	subu	t0, a0, __NR_O32_Linux	# check syscall number
2701da177e4SLinus Torvalds	sltiu	v0, t0, __NR_O32_Linux_syscalls + 1
2711da177e4SLinus Torvalds#endif
2721da177e4SLinus Torvalds	sll	t1, t0, 3
2731da177e4SLinus Torvalds	beqz	v0, einval
2741da177e4SLinus Torvalds
2751da177e4SLinus Torvalds	lw	t2, sys_call_table(t1)		# syscall routine
2761da177e4SLinus Torvalds
2771da177e4SLinus Torvalds#if defined(CONFIG_BINFMT_IRIX)
2781da177e4SLinus Torvalds	li	v1, 4000			# nr of sys_syscall
2791da177e4SLinus Torvalds#else
2801da177e4SLinus Torvalds	li	v1, 4000 - __NR_O32_Linux	# index of sys_syscall
2811da177e4SLinus Torvalds#endif
2821da177e4SLinus Torvalds	beq	t0, v1, einval			# do not recurse
2831da177e4SLinus Torvalds
2841da177e4SLinus Torvalds	/* Some syscalls like execve get their arguments from struct pt_regs
2851da177e4SLinus Torvalds	   and claim zero arguments in the syscall table. Thus we have to
2861da177e4SLinus Torvalds	   assume the worst case and shuffle around all potential arguments.
2871da177e4SLinus Torvalds	   If you want performance, don't use indirect syscalls. */
2881da177e4SLinus Torvalds
2891da177e4SLinus Torvalds	move	a0, a1				# shift argument registers
2901da177e4SLinus Torvalds	move	a1, a2
2911da177e4SLinus Torvalds	move	a2, a3
2921da177e4SLinus Torvalds	lw	a3, 16(sp)
2931da177e4SLinus Torvalds	lw	t4, 20(sp)
2941da177e4SLinus Torvalds	lw	t5, 24(sp)
2951da177e4SLinus Torvalds	lw	t6, 28(sp)
2961da177e4SLinus Torvalds	sw	t4, 16(sp)
2971da177e4SLinus Torvalds	sw	t5, 20(sp)
2981da177e4SLinus Torvalds	sw	t6, 24(sp)
2991da177e4SLinus Torvalds	sw	a0, PT_R4(sp)			# .. and push back a0 - a3, some
3001da177e4SLinus Torvalds	sw	a1, PT_R5(sp)			# syscalls expect them there
3011da177e4SLinus Torvalds	sw	a2, PT_R6(sp)
3021da177e4SLinus Torvalds	sw	a3, PT_R7(sp)
3031da177e4SLinus Torvalds	sw	a3, PT_R26(sp)			# update a3 for syscall restarting
3041da177e4SLinus Torvalds	jr	t2
3051da177e4SLinus Torvalds	/* Unreached */
3061da177e4SLinus Torvalds
3071da177e4SLinus Torvaldseinval:	li	v0, -EINVAL
3081da177e4SLinus Torvalds	jr	ra
3091da177e4SLinus Torvalds	END(sys_syscall)
3101da177e4SLinus Torvalds
3111da177e4SLinus Torvalds	.macro	fifty ptr, nargs, from=1, to=50
3121da177e4SLinus Torvalds	sys	\ptr		\nargs
3131da177e4SLinus Torvalds	.if	\to-\from
3141da177e4SLinus Torvalds	fifty	\ptr,\nargs,"(\from+1)",\to
3151da177e4SLinus Torvalds	.endif
3161da177e4SLinus Torvalds	.endm
3171da177e4SLinus Torvalds
3181da177e4SLinus Torvalds	.macro	mille ptr, nargs, from=1, to=20
3191da177e4SLinus Torvalds	fifty	\ptr,\nargs
3201da177e4SLinus Torvalds	.if	\to-\from
3211da177e4SLinus Torvalds	mille	\ptr,\nargs,"(\from+1)",\to
3221da177e4SLinus Torvalds	.endif
3231da177e4SLinus Torvalds	.endm
3241da177e4SLinus Torvalds
3251da177e4SLinus Torvalds	.macro	syscalltable
3261da177e4SLinus Torvalds#if defined(CONFIG_BINFMT_IRIX)
3271da177e4SLinus Torvalds	mille	sys_ni_syscall		0	/*    0 -  999 SVR4 flavour */
3281da177e4SLinus Torvalds	mille	sys_ni_syscall		0	/* 1000 - 1999 32-bit IRIX */
3291da177e4SLinus Torvalds	mille	sys_ni_syscall		0	/* 2000 - 2999 BSD43 flavour */
3301da177e4SLinus Torvalds	mille	sys_ni_syscall		0	/* 3000 - 3999 POSIX flavour */
3311da177e4SLinus Torvalds#endif
3321da177e4SLinus Torvalds
3331da177e4SLinus Torvalds	sys	sys_syscall		8	/* 4000 */
3341da177e4SLinus Torvalds	sys	sys_exit		1
3351da177e4SLinus Torvalds	sys	sys_fork		0
3361da177e4SLinus Torvalds	sys	sys_read		3
3371da177e4SLinus Torvalds	sys	sys_write		3
3381da177e4SLinus Torvalds	sys	sys_open		3	/* 4005 */
3391da177e4SLinus Torvalds	sys	sys_close		1
3401da177e4SLinus Torvalds	sys	sys_waitpid		3
3411da177e4SLinus Torvalds	sys	sys_creat		2
3421da177e4SLinus Torvalds	sys	sys_link		2
3431da177e4SLinus Torvalds	sys	sys_unlink		1	/* 4010 */
3441da177e4SLinus Torvalds	sys	sys_execve		0
3451da177e4SLinus Torvalds	sys	sys_chdir		1
3461da177e4SLinus Torvalds	sys	sys_time		1
3471da177e4SLinus Torvalds	sys	sys_mknod		3
3481da177e4SLinus Torvalds	sys	sys_chmod		2	/* 4015 */
3491da177e4SLinus Torvalds	sys	sys_lchown		3
3501da177e4SLinus Torvalds	sys	sys_ni_syscall		0
3511da177e4SLinus Torvalds	sys	sys_ni_syscall		0	/* was sys_stat */
3521da177e4SLinus Torvalds	sys	sys_lseek		3
3531da177e4SLinus Torvalds	sys	sys_getpid		0	/* 4020 */
3541da177e4SLinus Torvalds	sys	sys_mount		5
3551da177e4SLinus Torvalds	sys	sys_oldumount		1
3561da177e4SLinus Torvalds	sys	sys_setuid		1
3571da177e4SLinus Torvalds	sys	sys_getuid		0
3581da177e4SLinus Torvalds	sys	sys_stime		1	/* 4025 */
3591da177e4SLinus Torvalds	sys	sys_ptrace		4
3601da177e4SLinus Torvalds	sys	sys_alarm		1
3611da177e4SLinus Torvalds	sys	sys_ni_syscall		0	/* was sys_fstat */
3621da177e4SLinus Torvalds	sys	sys_pause		0
3631da177e4SLinus Torvalds	sys	sys_utime		2	/* 4030 */
3641da177e4SLinus Torvalds	sys	sys_ni_syscall		0
3651da177e4SLinus Torvalds	sys	sys_ni_syscall		0
3661da177e4SLinus Torvalds	sys	sys_access		2
3671da177e4SLinus Torvalds	sys	sys_nice		1
3681da177e4SLinus Torvalds	sys	sys_ni_syscall		0	/* 4035 */
3691da177e4SLinus Torvalds	sys	sys_sync		0
3701da177e4SLinus Torvalds	sys	sys_kill		2
3711da177e4SLinus Torvalds	sys	sys_rename		2
3721da177e4SLinus Torvalds	sys	sys_mkdir		2
3731da177e4SLinus Torvalds	sys	sys_rmdir		1	/* 4040 */
3741da177e4SLinus Torvalds	sys	sys_dup			1
3751da177e4SLinus Torvalds	sys	sys_pipe		0
3761da177e4SLinus Torvalds	sys	sys_times		1
3771da177e4SLinus Torvalds	sys	sys_ni_syscall		0
3781da177e4SLinus Torvalds	sys	sys_brk			1	/* 4045 */
3791da177e4SLinus Torvalds	sys	sys_setgid		1
3801da177e4SLinus Torvalds	sys	sys_getgid		0
3811da177e4SLinus Torvalds	sys	sys_ni_syscall		0	/* was signal(2) */
3821da177e4SLinus Torvalds	sys	sys_geteuid		0
3831da177e4SLinus Torvalds	sys	sys_getegid		0	/* 4050 */
3841da177e4SLinus Torvalds	sys	sys_acct		1
3851da177e4SLinus Torvalds	sys	sys_umount		2
3861da177e4SLinus Torvalds	sys	sys_ni_syscall		0
3871da177e4SLinus Torvalds	sys	sys_ioctl		3
3881da177e4SLinus Torvalds	sys	sys_fcntl		3	/* 4055 */
3891da177e4SLinus Torvalds	sys	sys_ni_syscall		2
3901da177e4SLinus Torvalds	sys	sys_setpgid		2
3911da177e4SLinus Torvalds	sys	sys_ni_syscall		0
3921da177e4SLinus Torvalds	sys	sys_olduname		1
3931da177e4SLinus Torvalds	sys	sys_umask		1	/* 4060 */
3941da177e4SLinus Torvalds	sys	sys_chroot		1
3951da177e4SLinus Torvalds	sys	sys_ustat		2
3961da177e4SLinus Torvalds	sys	sys_dup2		2
3971da177e4SLinus Torvalds	sys	sys_getppid		0
3981da177e4SLinus Torvalds	sys	sys_getpgrp		0	/* 4065 */
3991da177e4SLinus Torvalds	sys	sys_setsid		0
4001da177e4SLinus Torvalds	sys	sys_sigaction		3
4011da177e4SLinus Torvalds	sys	sys_sgetmask		0
4021da177e4SLinus Torvalds	sys	sys_ssetmask		1
4031da177e4SLinus Torvalds	sys	sys_setreuid		2	/* 4070 */
4041da177e4SLinus Torvalds	sys	sys_setregid		2
4051da177e4SLinus Torvalds	sys	sys_sigsuspend		0
4061da177e4SLinus Torvalds	sys	sys_sigpending		1
4071da177e4SLinus Torvalds	sys	sys_sethostname		2
4081da177e4SLinus Torvalds	sys	sys_setrlimit		2	/* 4075 */
4091da177e4SLinus Torvalds	sys	sys_getrlimit		2
4101da177e4SLinus Torvalds	sys	sys_getrusage		2
4111da177e4SLinus Torvalds	sys	sys_gettimeofday	2
4121da177e4SLinus Torvalds	sys	sys_settimeofday	2
4131da177e4SLinus Torvalds	sys	sys_getgroups		2	/* 4080 */
4141da177e4SLinus Torvalds	sys	sys_setgroups		2
4151da177e4SLinus Torvalds	sys	sys_ni_syscall		0	/* old_select */
4161da177e4SLinus Torvalds	sys	sys_symlink		2
4171da177e4SLinus Torvalds	sys	sys_ni_syscall		0	/* was sys_lstat */
4181da177e4SLinus Torvalds	sys	sys_readlink		3	/* 4085 */
4191da177e4SLinus Torvalds	sys	sys_uselib		1
4201da177e4SLinus Torvalds	sys	sys_swapon		2
4211da177e4SLinus Torvalds	sys	sys_reboot		3
4221da177e4SLinus Torvalds	sys	old_readdir		3
4231da177e4SLinus Torvalds	sys	old_mmap		6	/* 4090 */
4241da177e4SLinus Torvalds	sys	sys_munmap		2
4251da177e4SLinus Torvalds	sys	sys_truncate		2
4261da177e4SLinus Torvalds	sys	sys_ftruncate		2
4271da177e4SLinus Torvalds	sys	sys_fchmod		2
4281da177e4SLinus Torvalds	sys	sys_fchown		3	/* 4095 */
4291da177e4SLinus Torvalds	sys	sys_getpriority		2
4301da177e4SLinus Torvalds	sys	sys_setpriority		3
4311da177e4SLinus Torvalds	sys	sys_ni_syscall		0
4321da177e4SLinus Torvalds	sys	sys_statfs		2
4331da177e4SLinus Torvalds	sys	sys_fstatfs		2	/* 4100 */
4341da177e4SLinus Torvalds	sys	sys_ni_syscall		0	/* was ioperm(2) */
4351da177e4SLinus Torvalds	sys	sys_socketcall		2
4361da177e4SLinus Torvalds	sys	sys_syslog		3
4371da177e4SLinus Torvalds	sys	sys_setitimer		3
4381da177e4SLinus Torvalds	sys	sys_getitimer		2	/* 4105 */
4391da177e4SLinus Torvalds	sys	sys_newstat		2
4401da177e4SLinus Torvalds	sys	sys_newlstat		2
4411da177e4SLinus Torvalds	sys	sys_newfstat		2
4421da177e4SLinus Torvalds	sys	sys_uname		1
4431da177e4SLinus Torvalds	sys	sys_ni_syscall		0	/* 4110 was iopl(2) */
4441da177e4SLinus Torvalds	sys	sys_vhangup		0
4451da177e4SLinus Torvalds	sys	sys_ni_syscall		0	/* was sys_idle() */
4461da177e4SLinus Torvalds	sys	sys_ni_syscall		0	/* was sys_vm86 */
4471da177e4SLinus Torvalds	sys	sys_wait4		4
4481da177e4SLinus Torvalds	sys	sys_swapoff		1	/* 4115 */
4491da177e4SLinus Torvalds	sys	sys_sysinfo		1
4501da177e4SLinus Torvalds	sys	sys_ipc			6
4511da177e4SLinus Torvalds	sys	sys_fsync		1
4521da177e4SLinus Torvalds	sys	sys_sigreturn		0
4531da177e4SLinus Torvalds	sys	sys_clone		0	/* 4120 */
4541da177e4SLinus Torvalds	sys	sys_setdomainname	2
4551da177e4SLinus Torvalds	sys	sys_newuname		1
4561da177e4SLinus Torvalds	sys	sys_ni_syscall		0	/* sys_modify_ldt */
4571da177e4SLinus Torvalds	sys	sys_adjtimex		1
4581da177e4SLinus Torvalds	sys	sys_mprotect		3	/* 4125 */
4591da177e4SLinus Torvalds	sys	sys_sigprocmask		3
4601da177e4SLinus Torvalds	sys	sys_ni_syscall		0	/* was create_module */
4611da177e4SLinus Torvalds	sys	sys_init_module		5
4621da177e4SLinus Torvalds	sys	sys_delete_module	1
4631da177e4SLinus Torvalds	sys	sys_ni_syscall		0	/* 4130	was get_kernel_syms */
4641da177e4SLinus Torvalds	sys	sys_quotactl		4
4651da177e4SLinus Torvalds	sys	sys_getpgid		1
4661da177e4SLinus Torvalds	sys	sys_fchdir		1
4671da177e4SLinus Torvalds	sys	sys_bdflush		2
4681da177e4SLinus Torvalds	sys	sys_sysfs		3	/* 4135 */
4691da177e4SLinus Torvalds	sys	sys_personality		1
4701da177e4SLinus Torvalds	sys	sys_ni_syscall		0	/* for afs_syscall */
4711da177e4SLinus Torvalds	sys	sys_setfsuid		1
4721da177e4SLinus Torvalds	sys	sys_setfsgid		1
4731da177e4SLinus Torvalds	sys	sys_llseek		5	/* 4140 */
4741da177e4SLinus Torvalds	sys	sys_getdents		3
4751da177e4SLinus Torvalds	sys	sys_select		5
4761da177e4SLinus Torvalds	sys	sys_flock		2
4771da177e4SLinus Torvalds	sys	sys_msync		3
4781da177e4SLinus Torvalds	sys	sys_readv		3	/* 4145 */
4791da177e4SLinus Torvalds	sys	sys_writev		3
4801da177e4SLinus Torvalds	sys	sys_cacheflush		3
4811da177e4SLinus Torvalds	sys	sys_cachectl		3
4821da177e4SLinus Torvalds	sys	sys_sysmips		4
4831da177e4SLinus Torvalds	sys	sys_ni_syscall		0	/* 4150 */
4841da177e4SLinus Torvalds	sys	sys_getsid		1
4851da177e4SLinus Torvalds	sys	sys_fdatasync		1
4861da177e4SLinus Torvalds	sys	sys_sysctl		1
4871da177e4SLinus Torvalds	sys	sys_mlock		2
4881da177e4SLinus Torvalds	sys	sys_munlock		2	/* 4155 */
4891da177e4SLinus Torvalds	sys	sys_mlockall		1
4901da177e4SLinus Torvalds	sys	sys_munlockall		0
4911da177e4SLinus Torvalds	sys	sys_sched_setparam	2
4921da177e4SLinus Torvalds	sys	sys_sched_getparam	2
4931da177e4SLinus Torvalds	sys	sys_sched_setscheduler	3	/* 4160 */
4941da177e4SLinus Torvalds	sys	sys_sched_getscheduler	1
4951da177e4SLinus Torvalds	sys	sys_sched_yield		0
4961da177e4SLinus Torvalds	sys	sys_sched_get_priority_max 1
4971da177e4SLinus Torvalds	sys	sys_sched_get_priority_min 1
4981da177e4SLinus Torvalds	sys	sys_sched_rr_get_interval 2	/* 4165 */
4991da177e4SLinus Torvalds	sys	sys_nanosleep,		2
5001da177e4SLinus Torvalds	sys	sys_mremap,		4
5011da177e4SLinus Torvalds	sys	sys_accept		3
5021da177e4SLinus Torvalds	sys	sys_bind		3
5031da177e4SLinus Torvalds	sys	sys_connect		3	/* 4170 */
5041da177e4SLinus Torvalds	sys	sys_getpeername		3
5051da177e4SLinus Torvalds	sys	sys_getsockname		3
5061da177e4SLinus Torvalds	sys	sys_getsockopt		5
5071da177e4SLinus Torvalds	sys	sys_listen		2
5081da177e4SLinus Torvalds	sys	sys_recv		4	/* 4175 */
5091da177e4SLinus Torvalds	sys	sys_recvfrom		6
5101da177e4SLinus Torvalds	sys	sys_recvmsg		3
5111da177e4SLinus Torvalds	sys	sys_send		4
5121da177e4SLinus Torvalds	sys	sys_sendmsg		3
5131da177e4SLinus Torvalds	sys	sys_sendto		6	/* 4180 */
5141da177e4SLinus Torvalds	sys	sys_setsockopt		5
5151da177e4SLinus Torvalds	sys	sys_shutdown		2
5161da177e4SLinus Torvalds	sys	sys_socket		3
5171da177e4SLinus Torvalds	sys	sys_socketpair		4
5181da177e4SLinus Torvalds	sys	sys_setresuid		3	/* 4185 */
5191da177e4SLinus Torvalds	sys	sys_getresuid		3
5201da177e4SLinus Torvalds	sys	sys_ni_syscall		0	/* was sys_query_module */
5211da177e4SLinus Torvalds	sys	sys_poll		3
5221da177e4SLinus Torvalds	sys	sys_nfsservctl		3
5231da177e4SLinus Torvalds	sys	sys_setresgid		3	/* 4190 */
5241da177e4SLinus Torvalds	sys	sys_getresgid		3
5251da177e4SLinus Torvalds	sys	sys_prctl		5
5261da177e4SLinus Torvalds	sys	sys_rt_sigreturn	0
5271da177e4SLinus Torvalds	sys	sys_rt_sigaction	4
5281da177e4SLinus Torvalds	sys	sys_rt_sigprocmask	4	/* 4195 */
5291da177e4SLinus Torvalds	sys	sys_rt_sigpending	2
5301da177e4SLinus Torvalds	sys	sys_rt_sigtimedwait	4
5311da177e4SLinus Torvalds	sys	sys_rt_sigqueueinfo	3
5321da177e4SLinus Torvalds	sys	sys_rt_sigsuspend	0
5331da177e4SLinus Torvalds	sys	sys_pread64		6	/* 4200 */
5341da177e4SLinus Torvalds	sys	sys_pwrite64		6
5351da177e4SLinus Torvalds	sys	sys_chown		3
5361da177e4SLinus Torvalds	sys	sys_getcwd		2
5371da177e4SLinus Torvalds	sys	sys_capget		2
5381da177e4SLinus Torvalds	sys	sys_capset		2	/* 4205 */
5391da177e4SLinus Torvalds	sys	sys_sigaltstack		0
5401da177e4SLinus Torvalds	sys	sys_sendfile		4
5411da177e4SLinus Torvalds	sys	sys_ni_syscall		0
5421da177e4SLinus Torvalds	sys	sys_ni_syscall		0
5431da177e4SLinus Torvalds	sys	sys_mmap2		6	/* 4210 */
5441da177e4SLinus Torvalds	sys	sys_truncate64		4
5451da177e4SLinus Torvalds	sys	sys_ftruncate64		4
5461da177e4SLinus Torvalds	sys	sys_stat64		2
5471da177e4SLinus Torvalds	sys	sys_lstat64		2
5481da177e4SLinus Torvalds	sys	sys_fstat64		2	/* 4215 */
5491da177e4SLinus Torvalds	sys	sys_pivot_root		2
5501da177e4SLinus Torvalds	sys	sys_mincore		3
5511da177e4SLinus Torvalds	sys	sys_madvise		3
5521da177e4SLinus Torvalds	sys	sys_getdents64		3
5531da177e4SLinus Torvalds	sys	sys_fcntl64		3	/* 4220 */
5541da177e4SLinus Torvalds	sys	sys_ni_syscall		0
5551da177e4SLinus Torvalds	sys	sys_gettid		0
5561da177e4SLinus Torvalds	sys	sys_readahead		5
5571da177e4SLinus Torvalds	sys	sys_setxattr		5
5581da177e4SLinus Torvalds	sys	sys_lsetxattr		5	/* 4225 */
5591da177e4SLinus Torvalds	sys	sys_fsetxattr		5
5601da177e4SLinus Torvalds	sys	sys_getxattr		4
5611da177e4SLinus Torvalds	sys	sys_lgetxattr		4
5621da177e4SLinus Torvalds	sys	sys_fgetxattr		4
5631da177e4SLinus Torvalds	sys	sys_listxattr		3	/* 4230 */
5641da177e4SLinus Torvalds	sys	sys_llistxattr		3
5651da177e4SLinus Torvalds	sys	sys_flistxattr		3
5661da177e4SLinus Torvalds	sys	sys_removexattr		2
5671da177e4SLinus Torvalds	sys	sys_lremovexattr	2
5681da177e4SLinus Torvalds	sys	sys_fremovexattr	2	/* 4235 */
5691da177e4SLinus Torvalds	sys	sys_tkill		2
5701da177e4SLinus Torvalds	sys	sys_sendfile64		5
57190a67b59SThiemo Seufer	sys	sys_futex		6
5721da177e4SLinus Torvalds	sys	sys_sched_setaffinity	3
5731da177e4SLinus Torvalds	sys	sys_sched_getaffinity	3	/* 4240 */
5741da177e4SLinus Torvalds	sys	sys_io_setup		2
5751da177e4SLinus Torvalds	sys	sys_io_destroy		1
5761da177e4SLinus Torvalds	sys	sys_io_getevents	5
5771da177e4SLinus Torvalds	sys	sys_io_submit		3
5781da177e4SLinus Torvalds	sys	sys_io_cancel		3	/* 4245 */
5791da177e4SLinus Torvalds	sys	sys_exit_group		1
5800d507d61SRalf Baechle	sys	sys_lookup_dcookie	4
5811da177e4SLinus Torvalds	sys	sys_epoll_create	1
5821da177e4SLinus Torvalds	sys	sys_epoll_ctl		4
5831da177e4SLinus Torvalds	sys	sys_epoll_wait		3	/* 4250 */
5841da177e4SLinus Torvalds	sys	sys_remap_file_pages	5
5851da177e4SLinus Torvalds	sys	sys_set_tid_address	1
5861da177e4SLinus Torvalds	sys	sys_restart_syscall	0
5871da177e4SLinus Torvalds	sys	sys_fadvise64_64	7
5881da177e4SLinus Torvalds	sys	sys_statfs64		3	/* 4255 */
5891da177e4SLinus Torvalds	sys	sys_fstatfs64		2
5901da177e4SLinus Torvalds	sys	sys_timer_create	3
5911da177e4SLinus Torvalds	sys	sys_timer_settime	4
5921da177e4SLinus Torvalds	sys	sys_timer_gettime	2
5931da177e4SLinus Torvalds	sys	sys_timer_getoverrun	1	/* 4260 */
5941da177e4SLinus Torvalds	sys	sys_timer_delete	1
5951da177e4SLinus Torvalds	sys	sys_clock_settime	2
5961da177e4SLinus Torvalds	sys	sys_clock_gettime	2
5971da177e4SLinus Torvalds	sys	sys_clock_getres	2
5981da177e4SLinus Torvalds	sys	sys_clock_nanosleep	4	/* 4265 */
5991da177e4SLinus Torvalds	sys	sys_tgkill		3
6001da177e4SLinus Torvalds	sys	sys_utimes		2
6011da177e4SLinus Torvalds	sys	sys_mbind		4
6021da177e4SLinus Torvalds	sys	sys_ni_syscall		0	/* sys_get_mempolicy */
6031da177e4SLinus Torvalds	sys	sys_ni_syscall		0	/* 4270 sys_set_mempolicy */
6041da177e4SLinus Torvalds	sys	sys_mq_open		4
6051da177e4SLinus Torvalds	sys	sys_mq_unlink		1
6061da177e4SLinus Torvalds	sys	sys_mq_timedsend	5
6071da177e4SLinus Torvalds	sys	sys_mq_timedreceive	5
6081da177e4SLinus Torvalds	sys	sys_mq_notify		2	/* 4275 */
6091da177e4SLinus Torvalds	sys	sys_mq_getsetattr	3
6101da177e4SLinus Torvalds	sys	sys_ni_syscall		0	/* sys_vserver */
611a19050f3SRalf Baechle	sys	sys_waitid		5
6121da177e4SLinus Torvalds	sys	sys_ni_syscall		0	/* available, was setaltroot */
613e50c0a8fSRalf Baechle	sys	sys_add_key		5	/* 4280 */
6141da177e4SLinus Torvalds	sys	sys_request_key		4
6151da177e4SLinus Torvalds	sys	sys_keyctl		5
6163c37026dSRalf Baechle	sys	sys_set_thread_area	1
6177db36c85SRalf Baechle	sys	sys_inotify_init	0
6187db36c85SRalf Baechle	sys	sys_inotify_add_watch	3	/* 4285 */
6197db36c85SRalf Baechle	sys	sys_inotify_rm_watch	2
62072bf8914SRalf Baechle	sys	sys_migrate_pages	4
62172bf8914SRalf Baechle	sys	sys_openat		4
62272bf8914SRalf Baechle	sys	sys_mkdirat		3
62372bf8914SRalf Baechle	sys	sys_mknodat		4	/* 4290 */
62472bf8914SRalf Baechle	sys	sys_fchownat		5
62572bf8914SRalf Baechle	sys	sys_futimesat		3
626326a6257SYoichi Yuasa	sys	sys_fstatat64		4
62772bf8914SRalf Baechle	sys	sys_unlinkat		3
62872bf8914SRalf Baechle	sys	sys_renameat		4	/* 4295 */
629*c04030e1SUlrich Drepper	sys	sys_linkat		5
63072bf8914SRalf Baechle	sys	sys_symlinkat		3
63172bf8914SRalf Baechle	sys	sys_readlinkat		4
63272bf8914SRalf Baechle	sys	sys_fchmodat		3
63372bf8914SRalf Baechle	sys	sys_faccessat		3	/* 4300 */
63472bf8914SRalf Baechle	sys	sys_pselect6		6
63572bf8914SRalf Baechle	sys	sys_ppoll		5
63672bf8914SRalf Baechle	sys	sys_unshare		1
6371da177e4SLinus Torvalds	.endm
6381da177e4SLinus Torvalds
6391da177e4SLinus Torvalds	/* We pre-compute the number of _instruction_ bytes needed to
6401da177e4SLinus Torvalds	   load or store the arguments 6-8. Negative values are ignored. */
6411da177e4SLinus Torvalds
6421da177e4SLinus Torvalds	.macro  sys function, nargs
6431da177e4SLinus Torvalds	PTR	\function
6441da177e4SLinus Torvalds	LONG	(\nargs << 2) - (5 << 2)
6451da177e4SLinus Torvalds	.endm
6461da177e4SLinus Torvalds
6471da177e4SLinus Torvalds	.align	3
6481da177e4SLinus Torvalds	.type	sys_call_table,@object
6491da177e4SLinus TorvaldsEXPORT(sys_call_table)
6501da177e4SLinus Torvalds	syscalltable
6511da177e4SLinus Torvalds	.size	sys_call_table, . - sys_call_table
652