xref: /linux/arch/mips/kernel/scall32-o32.S (revision 7928eb0370d1133d0d8cd2f5ddfca19c309079d5)
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 *
6192ef366SRalf Baechle * Copyright (C) 1995-99, 2000- 02, 06 Ralf Baechle <ralf@linux-mips.org>
71da177e4SLinus Torvalds * Copyright (C) 2001 MIPS Technologies, Inc.
81da177e4SLinus Torvalds * Copyright (C) 2004 Thiemo Seufer
986bdb277SMarkos Chandras * Copyright (C) 2014 Imagination Technologies Ltd.
101da177e4SLinus Torvalds */
111da177e4SLinus Torvalds#include <linux/errno.h>
121da177e4SLinus Torvalds#include <asm/asm.h>
131da177e4SLinus Torvalds#include <asm/asmmacro.h>
14192ef366SRalf Baechle#include <asm/irqflags.h>
151da177e4SLinus Torvalds#include <asm/mipsregs.h>
161da177e4SLinus Torvalds#include <asm/regdef.h>
171da177e4SLinus Torvalds#include <asm/stackframe.h>
181da177e4SLinus Torvalds#include <asm/isadep.h>
191da177e4SLinus Torvalds#include <asm/sysmips.h>
201da177e4SLinus Torvalds#include <asm/thread_info.h>
211da177e4SLinus Torvalds#include <asm/unistd.h>
221da177e4SLinus Torvalds#include <asm/war.h>
23048eb582SSam Ravnborg#include <asm/asm-offsets.h>
241da177e4SLinus Torvalds
251da177e4SLinus Torvalds/* Highest syscall used of any syscall flavour */
261da177e4SLinus Torvalds#define MAX_SYSCALL_NO	__NR_O32_Linux + __NR_O32_Linux_syscalls
271da177e4SLinus Torvalds
281da177e4SLinus Torvalds	.align	5
291da177e4SLinus TorvaldsNESTED(handle_sys, PT_SIZE, sp)
301da177e4SLinus Torvalds	.set	noat
311da177e4SLinus Torvalds	SAVE_SOME
32eae6c0daSAtsushi Nemoto	TRACE_IRQS_ON_RELOAD
331da177e4SLinus Torvalds	STI
341da177e4SLinus Torvalds	.set	at
351da177e4SLinus Torvalds
361da177e4SLinus Torvalds	lw	t1, PT_EPC(sp)		# skip syscall on return
371da177e4SLinus Torvalds
381da177e4SLinus Torvalds	subu	v0, v0, __NR_O32_Linux	# check syscall number
391da177e4SLinus Torvalds	sltiu	t0, v0, __NR_O32_Linux_syscalls + 1
401da177e4SLinus Torvalds	addiu	t1, 4			# skip to next instruction
411da177e4SLinus Torvalds	sw	t1, PT_EPC(sp)
421da177e4SLinus Torvalds	beqz	t0, illegal_syscall
431da177e4SLinus Torvalds
4446e12c07SRalf Baechle	sll	t0, v0, 2
451da177e4SLinus Torvalds	la	t1, sys_call_table
461da177e4SLinus Torvalds	addu	t1, t0
471da177e4SLinus Torvalds	lw	t2, (t1)		# syscall routine
481da177e4SLinus Torvalds	beqz	t2, illegal_syscall
491da177e4SLinus Torvalds
501da177e4SLinus Torvalds	sw	a3, PT_R26(sp)		# save a3 for syscall restarting
511da177e4SLinus Torvalds
5246e12c07SRalf Baechle	/*
5346e12c07SRalf Baechle	 * More than four arguments.  Try to deal with it by copying the
5446e12c07SRalf Baechle	 * stack arguments from the user stack to the kernel stack.
5546e12c07SRalf Baechle	 * This Sucks (TM).
5646e12c07SRalf Baechle	 */
5746e12c07SRalf Baechle	lw	t0, PT_R29(sp)		# get old user stack pointer
5846e12c07SRalf Baechle
5946e12c07SRalf Baechle	/*
6046e12c07SRalf Baechle	 * We intentionally keep the kernel stack a little below the top of
6146e12c07SRalf Baechle	 * userspace so we don't have to do a slower byte accurate check here.
6246e12c07SRalf Baechle	 */
6346e12c07SRalf Baechle	lw	t5, TI_ADDR_LIMIT($28)
6446e12c07SRalf Baechle	addu	t4, t0, 32
6546e12c07SRalf Baechle	and	t5, t4
6646e12c07SRalf Baechle	bltz	t5, bad_stack		# -> sp is bad
6746e12c07SRalf Baechle
6846e12c07SRalf Baechle	/*
6946e12c07SRalf Baechle	 * Ok, copy the args from the luser stack to the kernel stack.
7046e12c07SRalf Baechle	 */
7146e12c07SRalf Baechle
7246e12c07SRalf Baechle	.set    push
7346e12c07SRalf Baechle	.set    noreorder
7446e12c07SRalf Baechle	.set	nomacro
7546e12c07SRalf Baechle
76*7928eb03SRalf Baechleload_a4: user_lw(t5, 16(t0))		# argument #5 from usp
77*7928eb03SRalf Baechleload_a5: user_lw(t6, 20(t0))		# argument #6 from usp
78*7928eb03SRalf Baechleload_a6: user_lw(t7, 24(t0))		# argument #7 from usp
79*7928eb03SRalf Baechleload_a7: user_lw(t8, 28(t0))		# argument #8 from usp
80*7928eb03SRalf Baechleloads_done:
8146e12c07SRalf Baechle
8246e12c07SRalf Baechle	sw	t5, 16(sp)		# argument #5 to ksp
8346e12c07SRalf Baechle	sw	t6, 20(sp)		# argument #6 to ksp
8446e12c07SRalf Baechle	sw	t7, 24(sp)		# argument #7 to ksp
8546e12c07SRalf Baechle	sw	t8, 28(sp)		# argument #8 to ksp
8646e12c07SRalf Baechle	.set	pop
8746e12c07SRalf Baechle
8846e12c07SRalf Baechle	.section __ex_table,"a"
89*7928eb03SRalf Baechle	PTR	load_a4, bad_stack_a4
90*7928eb03SRalf Baechle	PTR	load_a5, bad_stack_a5
91*7928eb03SRalf Baechle	PTR	load_a6, bad_stack_a6
92*7928eb03SRalf Baechle	PTR	load_a7, bad_stack_a7
9346e12c07SRalf Baechle	.previous
9446e12c07SRalf Baechle
951da177e4SLinus Torvalds	lw	t0, TI_FLAGS($28)	# syscall tracing enabled?
96e7f3b48aSRalf Baechle	li	t1, _TIF_WORK_SYSCALL_ENTRY
971da177e4SLinus Torvalds	and	t0, t1
981da177e4SLinus Torvalds	bnez	t0, syscall_trace_entry # -> yes
991da177e4SLinus Torvalds
1001da177e4SLinus Torvalds	jalr	t2			# Do The Real Thing (TM)
1011da177e4SLinus Torvalds
1021da177e4SLinus Torvalds	li	t0, -EMAXERRNO - 1	# error?
1031da177e4SLinus Torvalds	sltu	t0, t0, v0
1041da177e4SLinus Torvalds	sw	t0, PT_R7(sp)		# set error flag
1051da177e4SLinus Torvalds	beqz	t0, 1f
1061da177e4SLinus Torvalds
1078f5a00ebSAl Viro	lw	t1, PT_R2(sp)		# syscall number
1081da177e4SLinus Torvalds	negu	v0			# error
1098f5a00ebSAl Viro	sw	t1, PT_R0(sp)		# save it for syscall restarting
1101da177e4SLinus Torvalds1:	sw	v0, PT_R2(sp)		# result
1111da177e4SLinus Torvalds
1121da177e4SLinus Torvaldso32_syscall_exit:
11302f884edSAl Viro	j	syscall_exit_partial
1141da177e4SLinus Torvalds
1151da177e4SLinus Torvalds/* ------------------------------------------------------------------------ */
1161da177e4SLinus Torvalds
1171da177e4SLinus Torvaldssyscall_trace_entry:
1181da177e4SLinus Torvalds	SAVE_STATIC
1191da177e4SLinus Torvalds	move	s0, t2
1201da177e4SLinus Torvalds	move	a0, sp
1214c21b8fdSMarkos Chandras
1224c21b8fdSMarkos Chandras	/*
1234c21b8fdSMarkos Chandras	 * syscall number is in v0 unless we called syscall(__NR_###)
1244c21b8fdSMarkos Chandras	 * where the real syscall number is in a0
1254c21b8fdSMarkos Chandras	 */
1264c21b8fdSMarkos Chandras	addiu	a1, v0,  __NR_O32_Linux
1274c21b8fdSMarkos Chandras	bnez	v0, 1f /* __NR_syscall at offset 0 */
1284c21b8fdSMarkos Chandras	lw	a1, PT_R4(sp)
1294c21b8fdSMarkos Chandras
1304c21b8fdSMarkos Chandras1:	jal	syscall_trace_enter
1311da177e4SLinus Torvalds
1329d37c405SMarkos Chandras	bltz	v0, 2f			# seccomp failed? Skip syscall
1339d37c405SMarkos Chandras
13404a7052cSRalf Baechle	move	t0, s0
13504a7052cSRalf Baechle	RESTORE_STATIC
1361da177e4SLinus Torvalds	lw	a0, PT_R4(sp)		# Restore argument registers
1371da177e4SLinus Torvalds	lw	a1, PT_R5(sp)
1381da177e4SLinus Torvalds	lw	a2, PT_R6(sp)
1391da177e4SLinus Torvalds	lw	a3, PT_R7(sp)
14004a7052cSRalf Baechle	jalr	t0
1411da177e4SLinus Torvalds
1421da177e4SLinus Torvalds	li	t0, -EMAXERRNO - 1	# error?
1431da177e4SLinus Torvalds	sltu	t0, t0, v0
1441da177e4SLinus Torvalds	sw	t0, PT_R7(sp)		# set error flag
1451da177e4SLinus Torvalds	beqz	t0, 1f
1461da177e4SLinus Torvalds
1478f5a00ebSAl Viro	lw	t1, PT_R2(sp)		# syscall number
1481da177e4SLinus Torvalds	negu	v0			# error
1498f5a00ebSAl Viro	sw	t1, PT_R0(sp)		# save it for syscall restarting
1501da177e4SLinus Torvalds1:	sw	v0, PT_R2(sp)		# result
1511da177e4SLinus Torvalds
1529d37c405SMarkos Chandras2:	j	syscall_exit
1531da177e4SLinus Torvalds
1541da177e4SLinus Torvalds/* ------------------------------------------------------------------------ */
1551da177e4SLinus Torvalds
1561da177e4SLinus Torvalds	/*
157*7928eb03SRalf Baechle	 * Our open-coded access area sanity test for the stack pointer
158*7928eb03SRalf Baechle	 * failed. We probably should handle this case a bit more drastic.
1591da177e4SLinus Torvalds	 */
1601da177e4SLinus Torvaldsbad_stack:
1615b89c004SAl Viro	li	v0, EFAULT
1621da177e4SLinus Torvalds	sw	v0, PT_R2(sp)
1631da177e4SLinus Torvalds	li	t0, 1				# set error flag
1641da177e4SLinus Torvalds	sw	t0, PT_R7(sp)
1651da177e4SLinus Torvalds	j	o32_syscall_exit
1661da177e4SLinus Torvalds
167*7928eb03SRalf Baechlebad_stack_a4:
168*7928eb03SRalf Baechle	li	t5, 0
169*7928eb03SRalf Baechle	b	load_a5
170*7928eb03SRalf Baechle
171*7928eb03SRalf Baechlebad_stack_a5:
172*7928eb03SRalf Baechle	li	t6, 0
173*7928eb03SRalf Baechle	b	load_a6
174*7928eb03SRalf Baechle
175*7928eb03SRalf Baechlebad_stack_a6:
176*7928eb03SRalf Baechle	li	t7, 0
177*7928eb03SRalf Baechle	b	load_a7
178*7928eb03SRalf Baechle
179*7928eb03SRalf Baechlebad_stack_a7:
180*7928eb03SRalf Baechle	li	t8, 0
181*7928eb03SRalf Baechle	b	loads_done
182*7928eb03SRalf Baechle
1831da177e4SLinus Torvalds	/*
1841da177e4SLinus Torvalds	 * The system call does not exist in this kernel
1851da177e4SLinus Torvalds	 */
1861da177e4SLinus Torvaldsillegal_syscall:
187bda8229bSAtsushi Nemoto	li	v0, ENOSYS			# error
1881da177e4SLinus Torvalds	sw	v0, PT_R2(sp)
1891da177e4SLinus Torvalds	li	t0, 1				# set error flag
1901da177e4SLinus Torvalds	sw	t0, PT_R7(sp)
1911da177e4SLinus Torvalds	j	o32_syscall_exit
1921da177e4SLinus Torvalds	END(handle_sys)
1931da177e4SLinus Torvalds
1941da177e4SLinus Torvalds	LEAF(sys_syscall)
1951da177e4SLinus Torvalds	subu	t0, a0, __NR_O32_Linux	# check syscall number
1961da177e4SLinus Torvalds	sltiu	v0, t0, __NR_O32_Linux_syscalls + 1
197e807f957SVlad Malov	beqz	t0, einval		# do not recurse
19846e12c07SRalf Baechle	sll	t1, t0, 2
1991da177e4SLinus Torvalds	beqz	v0, einval
2001da177e4SLinus Torvalds	lw	t2, sys_call_table(t1)		# syscall routine
201e967ef02SEd Swierk	sw	a0, PT_R2(sp)			# call routine directly on restart
2021da177e4SLinus Torvalds
2031da177e4SLinus Torvalds	/* Some syscalls like execve get their arguments from struct pt_regs
2041da177e4SLinus Torvalds	   and claim zero arguments in the syscall table. Thus we have to
2051da177e4SLinus Torvalds	   assume the worst case and shuffle around all potential arguments.
2061da177e4SLinus Torvalds	   If you want performance, don't use indirect syscalls. */
2071da177e4SLinus Torvalds
2081da177e4SLinus Torvalds	move	a0, a1				# shift argument registers
2091da177e4SLinus Torvalds	move	a1, a2
2101da177e4SLinus Torvalds	move	a2, a3
2111da177e4SLinus Torvalds	lw	a3, 16(sp)
2121da177e4SLinus Torvalds	lw	t4, 20(sp)
2131da177e4SLinus Torvalds	lw	t5, 24(sp)
2141da177e4SLinus Torvalds	lw	t6, 28(sp)
2151da177e4SLinus Torvalds	sw	t4, 16(sp)
2161da177e4SLinus Torvalds	sw	t5, 20(sp)
2171da177e4SLinus Torvalds	sw	t6, 24(sp)
2181da177e4SLinus Torvalds	sw	a0, PT_R4(sp)			# .. and push back a0 - a3, some
2191da177e4SLinus Torvalds	sw	a1, PT_R5(sp)			# syscalls expect them there
2201da177e4SLinus Torvalds	sw	a2, PT_R6(sp)
2211da177e4SLinus Torvalds	sw	a3, PT_R7(sp)
2221da177e4SLinus Torvalds	sw	a3, PT_R26(sp)			# update a3 for syscall restarting
2231da177e4SLinus Torvalds	jr	t2
2241da177e4SLinus Torvalds	/* Unreached */
2251da177e4SLinus Torvalds
226fb498e25SAtsushi Nemotoeinval: li	v0, -ENOSYS
2271da177e4SLinus Torvalds	jr	ra
2281da177e4SLinus Torvalds	END(sys_syscall)
2291da177e4SLinus Torvalds
23046e12c07SRalf Baechle	.align	2
23146e12c07SRalf Baechle	.type	sys_call_table, @object
23246e12c07SRalf BaechleEXPORT(sys_call_table)
23346e12c07SRalf Baechle	PTR	sys_syscall			/* 4000 */
23446e12c07SRalf Baechle	PTR	sys_exit
23546e12c07SRalf Baechle	PTR	__sys_fork
23646e12c07SRalf Baechle	PTR	sys_read
23746e12c07SRalf Baechle	PTR	sys_write
23846e12c07SRalf Baechle	PTR	sys_open			/* 4005 */
23946e12c07SRalf Baechle	PTR	sys_close
24046e12c07SRalf Baechle	PTR	sys_waitpid
24146e12c07SRalf Baechle	PTR	sys_creat
24246e12c07SRalf Baechle	PTR	sys_link
24346e12c07SRalf Baechle	PTR	sys_unlink			/* 4010 */
24446e12c07SRalf Baechle	PTR	sys_execve
24546e12c07SRalf Baechle	PTR	sys_chdir
24646e12c07SRalf Baechle	PTR	sys_time
24746e12c07SRalf Baechle	PTR	sys_mknod
24846e12c07SRalf Baechle	PTR	sys_chmod			/* 4015 */
24946e12c07SRalf Baechle	PTR	sys_lchown
25046e12c07SRalf Baechle	PTR	sys_ni_syscall
25146e12c07SRalf Baechle	PTR	sys_ni_syscall			/* was sys_stat */
25246e12c07SRalf Baechle	PTR	sys_lseek
25346e12c07SRalf Baechle	PTR	sys_getpid			/* 4020 */
25446e12c07SRalf Baechle	PTR	sys_mount
25546e12c07SRalf Baechle	PTR	sys_oldumount
25646e12c07SRalf Baechle	PTR	sys_setuid
25746e12c07SRalf Baechle	PTR	sys_getuid
25846e12c07SRalf Baechle	PTR	sys_stime			/* 4025 */
25946e12c07SRalf Baechle	PTR	sys_ptrace
26046e12c07SRalf Baechle	PTR	sys_alarm
26146e12c07SRalf Baechle	PTR	sys_ni_syscall			/* was sys_fstat */
26246e12c07SRalf Baechle	PTR	sys_pause
26346e12c07SRalf Baechle	PTR	sys_utime			/* 4030 */
26446e12c07SRalf Baechle	PTR	sys_ni_syscall
26546e12c07SRalf Baechle	PTR	sys_ni_syscall
26646e12c07SRalf Baechle	PTR	sys_access
26746e12c07SRalf Baechle	PTR	sys_nice
26846e12c07SRalf Baechle	PTR	sys_ni_syscall			/* 4035 */
26946e12c07SRalf Baechle	PTR	sys_sync
27046e12c07SRalf Baechle	PTR	sys_kill
27146e12c07SRalf Baechle	PTR	sys_rename
27246e12c07SRalf Baechle	PTR	sys_mkdir
27346e12c07SRalf Baechle	PTR	sys_rmdir			/* 4040 */
27446e12c07SRalf Baechle	PTR	sys_dup
27546e12c07SRalf Baechle	PTR	sysm_pipe
27646e12c07SRalf Baechle	PTR	sys_times
27746e12c07SRalf Baechle	PTR	sys_ni_syscall
27846e12c07SRalf Baechle	PTR	sys_brk				/* 4045 */
27946e12c07SRalf Baechle	PTR	sys_setgid
28046e12c07SRalf Baechle	PTR	sys_getgid
28146e12c07SRalf Baechle	PTR	sys_ni_syscall			/* was signal(2) */
28246e12c07SRalf Baechle	PTR	sys_geteuid
28346e12c07SRalf Baechle	PTR	sys_getegid			/* 4050 */
28446e12c07SRalf Baechle	PTR	sys_acct
28546e12c07SRalf Baechle	PTR	sys_umount
28646e12c07SRalf Baechle	PTR	sys_ni_syscall
28746e12c07SRalf Baechle	PTR	sys_ioctl
28846e12c07SRalf Baechle	PTR	sys_fcntl			/* 4055 */
28946e12c07SRalf Baechle	PTR	sys_ni_syscall
29046e12c07SRalf Baechle	PTR	sys_setpgid
29146e12c07SRalf Baechle	PTR	sys_ni_syscall
29246e12c07SRalf Baechle	PTR	sys_olduname
29346e12c07SRalf Baechle	PTR	sys_umask			/* 4060 */
29446e12c07SRalf Baechle	PTR	sys_chroot
29546e12c07SRalf Baechle	PTR	sys_ustat
29646e12c07SRalf Baechle	PTR	sys_dup2
29746e12c07SRalf Baechle	PTR	sys_getppid
29846e12c07SRalf Baechle	PTR	sys_getpgrp			/* 4065 */
29946e12c07SRalf Baechle	PTR	sys_setsid
30046e12c07SRalf Baechle	PTR	sys_sigaction
30146e12c07SRalf Baechle	PTR	sys_sgetmask
30246e12c07SRalf Baechle	PTR	sys_ssetmask
30346e12c07SRalf Baechle	PTR	sys_setreuid			/* 4070 */
30446e12c07SRalf Baechle	PTR	sys_setregid
30546e12c07SRalf Baechle	PTR	sys_sigsuspend
30646e12c07SRalf Baechle	PTR	sys_sigpending
30746e12c07SRalf Baechle	PTR	sys_sethostname
30846e12c07SRalf Baechle	PTR	sys_setrlimit			/* 4075 */
30946e12c07SRalf Baechle	PTR	sys_getrlimit
31046e12c07SRalf Baechle	PTR	sys_getrusage
31146e12c07SRalf Baechle	PTR	sys_gettimeofday
31246e12c07SRalf Baechle	PTR	sys_settimeofday
31346e12c07SRalf Baechle	PTR	sys_getgroups			/* 4080 */
31446e12c07SRalf Baechle	PTR	sys_setgroups
31546e12c07SRalf Baechle	PTR	sys_ni_syscall			/* old_select */
31646e12c07SRalf Baechle	PTR	sys_symlink
31746e12c07SRalf Baechle	PTR	sys_ni_syscall			/* was sys_lstat */
31846e12c07SRalf Baechle	PTR	sys_readlink			/* 4085 */
31946e12c07SRalf Baechle	PTR	sys_uselib
32046e12c07SRalf Baechle	PTR	sys_swapon
32146e12c07SRalf Baechle	PTR	sys_reboot
32246e12c07SRalf Baechle	PTR	sys_old_readdir
32346e12c07SRalf Baechle	PTR	sys_mips_mmap			/* 4090 */
32446e12c07SRalf Baechle	PTR	sys_munmap
32546e12c07SRalf Baechle	PTR	sys_truncate
32646e12c07SRalf Baechle	PTR	sys_ftruncate
32746e12c07SRalf Baechle	PTR	sys_fchmod
32846e12c07SRalf Baechle	PTR	sys_fchown			/* 4095 */
32946e12c07SRalf Baechle	PTR	sys_getpriority
33046e12c07SRalf Baechle	PTR	sys_setpriority
33146e12c07SRalf Baechle	PTR	sys_ni_syscall
33246e12c07SRalf Baechle	PTR	sys_statfs
33346e12c07SRalf Baechle	PTR	sys_fstatfs			/* 4100 */
33446e12c07SRalf Baechle	PTR	sys_ni_syscall			/* was ioperm(2) */
33546e12c07SRalf Baechle	PTR	sys_socketcall
33646e12c07SRalf Baechle	PTR	sys_syslog
33746e12c07SRalf Baechle	PTR	sys_setitimer
33846e12c07SRalf Baechle	PTR	sys_getitimer			/* 4105 */
33946e12c07SRalf Baechle	PTR	sys_newstat
34046e12c07SRalf Baechle	PTR	sys_newlstat
34146e12c07SRalf Baechle	PTR	sys_newfstat
34246e12c07SRalf Baechle	PTR	sys_uname
34346e12c07SRalf Baechle	PTR	sys_ni_syscall			/* 4110 was iopl(2) */
34446e12c07SRalf Baechle	PTR	sys_vhangup
34546e12c07SRalf Baechle	PTR	sys_ni_syscall			/* was sys_idle() */
34646e12c07SRalf Baechle	PTR	sys_ni_syscall			/* was sys_vm86 */
34746e12c07SRalf Baechle	PTR	sys_wait4
34846e12c07SRalf Baechle	PTR	sys_swapoff			/* 4115 */
34946e12c07SRalf Baechle	PTR	sys_sysinfo
35046e12c07SRalf Baechle	PTR	sys_ipc
35146e12c07SRalf Baechle	PTR	sys_fsync
35246e12c07SRalf Baechle	PTR	sys_sigreturn
35346e12c07SRalf Baechle	PTR	__sys_clone			/* 4120 */
35446e12c07SRalf Baechle	PTR	sys_setdomainname
35546e12c07SRalf Baechle	PTR	sys_newuname
35646e12c07SRalf Baechle	PTR	sys_ni_syscall			/* sys_modify_ldt */
35746e12c07SRalf Baechle	PTR	sys_adjtimex
35846e12c07SRalf Baechle	PTR	sys_mprotect			/* 4125 */
35946e12c07SRalf Baechle	PTR	sys_sigprocmask
36046e12c07SRalf Baechle	PTR	sys_ni_syscall			/* was create_module */
36146e12c07SRalf Baechle	PTR	sys_init_module
36246e12c07SRalf Baechle	PTR	sys_delete_module
36346e12c07SRalf Baechle	PTR	sys_ni_syscall			/* 4130 was get_kernel_syms */
36446e12c07SRalf Baechle	PTR	sys_quotactl
36546e12c07SRalf Baechle	PTR	sys_getpgid
36646e12c07SRalf Baechle	PTR	sys_fchdir
36746e12c07SRalf Baechle	PTR	sys_bdflush
36846e12c07SRalf Baechle	PTR	sys_sysfs			/* 4135 */
36946e12c07SRalf Baechle	PTR	sys_personality
37046e12c07SRalf Baechle	PTR	sys_ni_syscall			/* for afs_syscall */
37146e12c07SRalf Baechle	PTR	sys_setfsuid
37246e12c07SRalf Baechle	PTR	sys_setfsgid
37346e12c07SRalf Baechle	PTR	sys_llseek			/* 4140 */
37446e12c07SRalf Baechle	PTR	sys_getdents
37546e12c07SRalf Baechle	PTR	sys_select
37646e12c07SRalf Baechle	PTR	sys_flock
37746e12c07SRalf Baechle	PTR	sys_msync
37846e12c07SRalf Baechle	PTR	sys_readv			/* 4145 */
37946e12c07SRalf Baechle	PTR	sys_writev
38046e12c07SRalf Baechle	PTR	sys_cacheflush
38146e12c07SRalf Baechle	PTR	sys_cachectl
38246e12c07SRalf Baechle	PTR	sys_sysmips
38346e12c07SRalf Baechle	PTR	sys_ni_syscall			/* 4150 */
38446e12c07SRalf Baechle	PTR	sys_getsid
38546e12c07SRalf Baechle	PTR	sys_fdatasync
38646e12c07SRalf Baechle	PTR	sys_sysctl
38746e12c07SRalf Baechle	PTR	sys_mlock
38846e12c07SRalf Baechle	PTR	sys_munlock			/* 4155 */
38946e12c07SRalf Baechle	PTR	sys_mlockall
39046e12c07SRalf Baechle	PTR	sys_munlockall
39146e12c07SRalf Baechle	PTR	sys_sched_setparam
39246e12c07SRalf Baechle	PTR	sys_sched_getparam
39346e12c07SRalf Baechle	PTR	sys_sched_setscheduler		/* 4160 */
39446e12c07SRalf Baechle	PTR	sys_sched_getscheduler
39546e12c07SRalf Baechle	PTR	sys_sched_yield
39646e12c07SRalf Baechle	PTR	sys_sched_get_priority_max
39746e12c07SRalf Baechle	PTR	sys_sched_get_priority_min
39846e12c07SRalf Baechle	PTR	sys_sched_rr_get_interval	/* 4165 */
39946e12c07SRalf Baechle	PTR	sys_nanosleep
40046e12c07SRalf Baechle	PTR	sys_mremap
40146e12c07SRalf Baechle	PTR	sys_accept
40246e12c07SRalf Baechle	PTR	sys_bind
40346e12c07SRalf Baechle	PTR	sys_connect			/* 4170 */
40446e12c07SRalf Baechle	PTR	sys_getpeername
40546e12c07SRalf Baechle	PTR	sys_getsockname
40646e12c07SRalf Baechle	PTR	sys_getsockopt
40746e12c07SRalf Baechle	PTR	sys_listen
40846e12c07SRalf Baechle	PTR	sys_recv			/* 4175 */
40946e12c07SRalf Baechle	PTR	sys_recvfrom
41046e12c07SRalf Baechle	PTR	sys_recvmsg
41146e12c07SRalf Baechle	PTR	sys_send
41246e12c07SRalf Baechle	PTR	sys_sendmsg
41346e12c07SRalf Baechle	PTR	sys_sendto			/* 4180 */
41446e12c07SRalf Baechle	PTR	sys_setsockopt
41546e12c07SRalf Baechle	PTR	sys_shutdown
41646e12c07SRalf Baechle	PTR	sys_socket
41746e12c07SRalf Baechle	PTR	sys_socketpair
41846e12c07SRalf Baechle	PTR	sys_setresuid			/* 4185 */
41946e12c07SRalf Baechle	PTR	sys_getresuid
42046e12c07SRalf Baechle	PTR	sys_ni_syscall			/* was sys_query_module */
42146e12c07SRalf Baechle	PTR	sys_poll
42246e12c07SRalf Baechle	PTR	sys_ni_syscall			/* was nfsservctl */
42346e12c07SRalf Baechle	PTR	sys_setresgid			/* 4190 */
42446e12c07SRalf Baechle	PTR	sys_getresgid
42546e12c07SRalf Baechle	PTR	sys_prctl
42646e12c07SRalf Baechle	PTR	sys_rt_sigreturn
42746e12c07SRalf Baechle	PTR	sys_rt_sigaction
42846e12c07SRalf Baechle	PTR	sys_rt_sigprocmask		/* 4195 */
42946e12c07SRalf Baechle	PTR	sys_rt_sigpending
43046e12c07SRalf Baechle	PTR	sys_rt_sigtimedwait
43146e12c07SRalf Baechle	PTR	sys_rt_sigqueueinfo
43246e12c07SRalf Baechle	PTR	sys_rt_sigsuspend
43346e12c07SRalf Baechle	PTR	sys_pread64			/* 4200 */
43446e12c07SRalf Baechle	PTR	sys_pwrite64
43546e12c07SRalf Baechle	PTR	sys_chown
43646e12c07SRalf Baechle	PTR	sys_getcwd
43746e12c07SRalf Baechle	PTR	sys_capget
43846e12c07SRalf Baechle	PTR	sys_capset			/* 4205 */
43946e12c07SRalf Baechle	PTR	sys_sigaltstack
44046e12c07SRalf Baechle	PTR	sys_sendfile
44146e12c07SRalf Baechle	PTR	sys_ni_syscall
44246e12c07SRalf Baechle	PTR	sys_ni_syscall
44346e12c07SRalf Baechle	PTR	sys_mips_mmap2			/* 4210 */
44446e12c07SRalf Baechle	PTR	sys_truncate64
44546e12c07SRalf Baechle	PTR	sys_ftruncate64
44646e12c07SRalf Baechle	PTR	sys_stat64
44746e12c07SRalf Baechle	PTR	sys_lstat64
44846e12c07SRalf Baechle	PTR	sys_fstat64			/* 4215 */
44946e12c07SRalf Baechle	PTR	sys_pivot_root
45046e12c07SRalf Baechle	PTR	sys_mincore
45146e12c07SRalf Baechle	PTR	sys_madvise
45246e12c07SRalf Baechle	PTR	sys_getdents64
45346e12c07SRalf Baechle	PTR	sys_fcntl64			/* 4220 */
45446e12c07SRalf Baechle	PTR	sys_ni_syscall
45546e12c07SRalf Baechle	PTR	sys_gettid
45646e12c07SRalf Baechle	PTR	sys_readahead
45746e12c07SRalf Baechle	PTR	sys_setxattr
45846e12c07SRalf Baechle	PTR	sys_lsetxattr			/* 4225 */
45946e12c07SRalf Baechle	PTR	sys_fsetxattr
46046e12c07SRalf Baechle	PTR	sys_getxattr
46146e12c07SRalf Baechle	PTR	sys_lgetxattr
46246e12c07SRalf Baechle	PTR	sys_fgetxattr
46346e12c07SRalf Baechle	PTR	sys_listxattr			/* 4230 */
46446e12c07SRalf Baechle	PTR	sys_llistxattr
46546e12c07SRalf Baechle	PTR	sys_flistxattr
46646e12c07SRalf Baechle	PTR	sys_removexattr
46746e12c07SRalf Baechle	PTR	sys_lremovexattr
46846e12c07SRalf Baechle	PTR	sys_fremovexattr		/* 4235 */
46946e12c07SRalf Baechle	PTR	sys_tkill
47046e12c07SRalf Baechle	PTR	sys_sendfile64
47146e12c07SRalf Baechle	PTR	sys_futex
472f088fc84SRalf Baechle#ifdef CONFIG_MIPS_MT_FPAFF
473f088fc84SRalf Baechle	/*
474f088fc84SRalf Baechle	 * For FPU affinity scheduling on MIPS MT processors, we need to
475f088fc84SRalf Baechle	 * intercept sys_sched_xxxaffinity() calls until we get a proper hook
4760a0fca9dSViresh Kumar	 * in kernel/sched/core.c.  Considered only temporary we only support
4770a0fca9dSViresh Kumar	 * these hooks for the 32-bit kernel - there is no MIPS64 MT processor
4780a0fca9dSViresh Kumar	 * atm.
479f088fc84SRalf Baechle	 */
48046e12c07SRalf Baechle	PTR	mipsmt_sys_sched_setaffinity
48146e12c07SRalf Baechle	PTR	mipsmt_sys_sched_getaffinity
482f088fc84SRalf Baechle#else
48346e12c07SRalf Baechle	PTR	sys_sched_setaffinity
48446e12c07SRalf Baechle	PTR	sys_sched_getaffinity		/* 4240 */
485f088fc84SRalf Baechle#endif /* CONFIG_MIPS_MT_FPAFF */
48646e12c07SRalf Baechle	PTR	sys_io_setup
48746e12c07SRalf Baechle	PTR	sys_io_destroy
48846e12c07SRalf Baechle	PTR	sys_io_getevents
48946e12c07SRalf Baechle	PTR	sys_io_submit
49046e12c07SRalf Baechle	PTR	sys_io_cancel			/* 4245 */
49146e12c07SRalf Baechle	PTR	sys_exit_group
49246e12c07SRalf Baechle	PTR	sys_lookup_dcookie
49346e12c07SRalf Baechle	PTR	sys_epoll_create
49446e12c07SRalf Baechle	PTR	sys_epoll_ctl
49546e12c07SRalf Baechle	PTR	sys_epoll_wait			/* 4250 */
49646e12c07SRalf Baechle	PTR	sys_remap_file_pages
49746e12c07SRalf Baechle	PTR	sys_set_tid_address
49846e12c07SRalf Baechle	PTR	sys_restart_syscall
49946e12c07SRalf Baechle	PTR	sys_fadvise64_64
50046e12c07SRalf Baechle	PTR	sys_statfs64			/* 4255 */
50146e12c07SRalf Baechle	PTR	sys_fstatfs64
50246e12c07SRalf Baechle	PTR	sys_timer_create
50346e12c07SRalf Baechle	PTR	sys_timer_settime
50446e12c07SRalf Baechle	PTR	sys_timer_gettime
50546e12c07SRalf Baechle	PTR	sys_timer_getoverrun		/* 4260 */
50646e12c07SRalf Baechle	PTR	sys_timer_delete
50746e12c07SRalf Baechle	PTR	sys_clock_settime
50846e12c07SRalf Baechle	PTR	sys_clock_gettime
50946e12c07SRalf Baechle	PTR	sys_clock_getres
51046e12c07SRalf Baechle	PTR	sys_clock_nanosleep		/* 4265 */
51146e12c07SRalf Baechle	PTR	sys_tgkill
51246e12c07SRalf Baechle	PTR	sys_utimes
51346e12c07SRalf Baechle	PTR	sys_mbind
5141ff1ad6bSHuacai Chen	PTR	sys_get_mempolicy
5151ff1ad6bSHuacai Chen	PTR	sys_set_mempolicy		/* 4270 */
51646e12c07SRalf Baechle	PTR	sys_mq_open
51746e12c07SRalf Baechle	PTR	sys_mq_unlink
51846e12c07SRalf Baechle	PTR	sys_mq_timedsend
51946e12c07SRalf Baechle	PTR	sys_mq_timedreceive
52046e12c07SRalf Baechle	PTR	sys_mq_notify			/* 4275 */
52146e12c07SRalf Baechle	PTR	sys_mq_getsetattr
52246e12c07SRalf Baechle	PTR	sys_ni_syscall			/* sys_vserver */
52346e12c07SRalf Baechle	PTR	sys_waitid
52446e12c07SRalf Baechle	PTR	sys_ni_syscall			/* available, was setaltroot */
52546e12c07SRalf Baechle	PTR	sys_add_key			/* 4280 */
52646e12c07SRalf Baechle	PTR	sys_request_key
52746e12c07SRalf Baechle	PTR	sys_keyctl
52846e12c07SRalf Baechle	PTR	sys_set_thread_area
52946e12c07SRalf Baechle	PTR	sys_inotify_init
53046e12c07SRalf Baechle	PTR	sys_inotify_add_watch		/* 4285 */
53146e12c07SRalf Baechle	PTR	sys_inotify_rm_watch
53246e12c07SRalf Baechle	PTR	sys_migrate_pages
53346e12c07SRalf Baechle	PTR	sys_openat
53446e12c07SRalf Baechle	PTR	sys_mkdirat
53546e12c07SRalf Baechle	PTR	sys_mknodat			/* 4290 */
53646e12c07SRalf Baechle	PTR	sys_fchownat
53746e12c07SRalf Baechle	PTR	sys_futimesat
53846e12c07SRalf Baechle	PTR	sys_fstatat64
53946e12c07SRalf Baechle	PTR	sys_unlinkat
54046e12c07SRalf Baechle	PTR	sys_renameat			/* 4295 */
54146e12c07SRalf Baechle	PTR	sys_linkat
54246e12c07SRalf Baechle	PTR	sys_symlinkat
54346e12c07SRalf Baechle	PTR	sys_readlinkat
54446e12c07SRalf Baechle	PTR	sys_fchmodat
54546e12c07SRalf Baechle	PTR	sys_faccessat			/* 4300 */
54646e12c07SRalf Baechle	PTR	sys_pselect6
54746e12c07SRalf Baechle	PTR	sys_ppoll
54846e12c07SRalf Baechle	PTR	sys_unshare
54946e12c07SRalf Baechle	PTR	sys_splice
55046e12c07SRalf Baechle	PTR	sys_sync_file_range		/* 4305 */
55146e12c07SRalf Baechle	PTR	sys_tee
55246e12c07SRalf Baechle	PTR	sys_vmsplice
55346e12c07SRalf Baechle	PTR	sys_move_pages
55446e12c07SRalf Baechle	PTR	sys_set_robust_list
55546e12c07SRalf Baechle	PTR	sys_get_robust_list		/* 4310 */
55646e12c07SRalf Baechle	PTR	sys_kexec_load
55746e12c07SRalf Baechle	PTR	sys_getcpu
55846e12c07SRalf Baechle	PTR	sys_epoll_pwait
55946e12c07SRalf Baechle	PTR	sys_ioprio_set
56046e12c07SRalf Baechle	PTR	sys_ioprio_get			/* 4315 */
56146e12c07SRalf Baechle	PTR	sys_utimensat
56246e12c07SRalf Baechle	PTR	sys_signalfd
56346e12c07SRalf Baechle	PTR	sys_ni_syscall			/* was timerfd */
56446e12c07SRalf Baechle	PTR	sys_eventfd
56546e12c07SRalf Baechle	PTR	sys_fallocate			/* 4320 */
56646e12c07SRalf Baechle	PTR	sys_timerfd_create
56746e12c07SRalf Baechle	PTR	sys_timerfd_gettime
56846e12c07SRalf Baechle	PTR	sys_timerfd_settime
56946e12c07SRalf Baechle	PTR	sys_signalfd4
57046e12c07SRalf Baechle	PTR	sys_eventfd2			/* 4325 */
57146e12c07SRalf Baechle	PTR	sys_epoll_create1
57246e12c07SRalf Baechle	PTR	sys_dup3
57346e12c07SRalf Baechle	PTR	sys_pipe2
57446e12c07SRalf Baechle	PTR	sys_inotify_init1
57546e12c07SRalf Baechle	PTR	sys_preadv			/* 4330 */
57646e12c07SRalf Baechle	PTR	sys_pwritev
57746e12c07SRalf Baechle	PTR	sys_rt_tgsigqueueinfo
57846e12c07SRalf Baechle	PTR	sys_perf_event_open
57946e12c07SRalf Baechle	PTR	sys_accept4
58046e12c07SRalf Baechle	PTR	sys_recvmmsg			/* 4335 */
58146e12c07SRalf Baechle	PTR	sys_fanotify_init
58246e12c07SRalf Baechle	PTR	sys_fanotify_mark
58346e12c07SRalf Baechle	PTR	sys_prlimit64
58446e12c07SRalf Baechle	PTR	sys_name_to_handle_at
58546e12c07SRalf Baechle	PTR	sys_open_by_handle_at		/* 4340 */
58646e12c07SRalf Baechle	PTR	sys_clock_adjtime
58746e12c07SRalf Baechle	PTR	sys_syncfs
58846e12c07SRalf Baechle	PTR	sys_sendmmsg
58946e12c07SRalf Baechle	PTR	sys_setns
59046e12c07SRalf Baechle	PTR	sys_process_vm_readv		/* 4345 */
59146e12c07SRalf Baechle	PTR	sys_process_vm_writev
59246e12c07SRalf Baechle	PTR	sys_kcmp
59346e12c07SRalf Baechle	PTR	sys_finit_module
5946776254bSJames Hogan	PTR	sys_sched_setattr
5956776254bSJames Hogan	PTR	sys_sched_getattr		/* 4350 */
596367f0b50SRalf Baechle	PTR	sys_renameat2
5978855d608SKees Cook	PTR	sys_seccomp
59842944521SRalf Baechle	PTR	sys_getrandom
59942944521SRalf Baechle	PTR	sys_memfd_create
6005df4c8dbSRalf Baechle	PTR	sys_bpf				/* 4355 */
601389cdc5dSRalf Baechle	PTR	sys_execveat
602