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 * t3 is the precomputed number of instruction bytes needed to 7146e12c07SRalf Baechle * load or store arguments 6-8. 7246e12c07SRalf Baechle */ 7346e12c07SRalf Baechle 7446e12c07SRalf Baechle .set push 7546e12c07SRalf Baechle .set noreorder 7646e12c07SRalf Baechle .set nomacro 7746e12c07SRalf Baechle 7886bdb277SMarkos Chandras1: user_lw(t5, 16(t0)) # argument #5 from usp 7986bdb277SMarkos Chandras4: user_lw(t6, 20(t0)) # argument #6 from usp 8086bdb277SMarkos Chandras3: user_lw(t7, 24(t0)) # argument #7 from usp 8186bdb277SMarkos Chandras2: user_lw(t8, 28(t0)) # argument #8 from usp 8246e12c07SRalf Baechle 8346e12c07SRalf Baechle sw t5, 16(sp) # argument #5 to ksp 8446e12c07SRalf Baechle sw t6, 20(sp) # argument #6 to ksp 8546e12c07SRalf Baechle sw t7, 24(sp) # argument #7 to ksp 8646e12c07SRalf Baechle sw t8, 28(sp) # argument #8 to ksp 8746e12c07SRalf Baechle .set pop 8846e12c07SRalf Baechle 8946e12c07SRalf Baechle .section __ex_table,"a" 9046e12c07SRalf Baechle PTR 1b,bad_stack 9146e12c07SRalf Baechle PTR 2b,bad_stack 9246e12c07SRalf Baechle PTR 3b,bad_stack 9346e12c07SRalf Baechle PTR 4b,bad_stack 9446e12c07SRalf Baechle .previous 9546e12c07SRalf Baechle 961da177e4SLinus Torvalds lw t0, TI_FLAGS($28) # syscall tracing enabled? 97e7f3b48aSRalf Baechle li t1, _TIF_WORK_SYSCALL_ENTRY 981da177e4SLinus Torvalds and t0, t1 991da177e4SLinus Torvalds bnez t0, syscall_trace_entry # -> yes 1001da177e4SLinus Torvalds 1011da177e4SLinus Torvalds jalr t2 # Do The Real Thing (TM) 1021da177e4SLinus Torvalds 1031da177e4SLinus Torvalds li t0, -EMAXERRNO - 1 # error? 1041da177e4SLinus Torvalds sltu t0, t0, v0 1051da177e4SLinus Torvalds sw t0, PT_R7(sp) # set error flag 1061da177e4SLinus Torvalds beqz t0, 1f 1071da177e4SLinus Torvalds 1088f5a00ebSAl Viro lw t1, PT_R2(sp) # syscall number 1091da177e4SLinus Torvalds negu v0 # error 1108f5a00ebSAl Viro sw t1, PT_R0(sp) # save it for syscall restarting 1111da177e4SLinus Torvalds1: sw v0, PT_R2(sp) # result 1121da177e4SLinus Torvalds 1131da177e4SLinus Torvaldso32_syscall_exit: 11402f884edSAl Viro j syscall_exit_partial 1151da177e4SLinus Torvalds 1161da177e4SLinus Torvalds/* ------------------------------------------------------------------------ */ 1171da177e4SLinus Torvalds 1181da177e4SLinus Torvaldssyscall_trace_entry: 1191da177e4SLinus Torvalds SAVE_STATIC 1201da177e4SLinus Torvalds move s0, t2 1211da177e4SLinus Torvalds move a0, sp 1224c21b8fdSMarkos Chandras 1234c21b8fdSMarkos Chandras /* 1244c21b8fdSMarkos Chandras * syscall number is in v0 unless we called syscall(__NR_###) 1254c21b8fdSMarkos Chandras * where the real syscall number is in a0 1264c21b8fdSMarkos Chandras */ 1274c21b8fdSMarkos Chandras addiu a1, v0, __NR_O32_Linux 1284c21b8fdSMarkos Chandras bnez v0, 1f /* __NR_syscall at offset 0 */ 1294c21b8fdSMarkos Chandras lw a1, PT_R4(sp) 1304c21b8fdSMarkos Chandras 1314c21b8fdSMarkos Chandras1: jal syscall_trace_enter 1321da177e4SLinus Torvalds 1339d37c405SMarkos Chandras bltz v0, 2f # seccomp failed? Skip syscall 1349d37c405SMarkos Chandras 13504a7052cSRalf Baechle move t0, s0 13604a7052cSRalf Baechle RESTORE_STATIC 1371da177e4SLinus Torvalds lw a0, PT_R4(sp) # Restore argument registers 1381da177e4SLinus Torvalds lw a1, PT_R5(sp) 1391da177e4SLinus Torvalds lw a2, PT_R6(sp) 1401da177e4SLinus Torvalds lw a3, PT_R7(sp) 14104a7052cSRalf Baechle jalr t0 1421da177e4SLinus Torvalds 1431da177e4SLinus Torvalds li t0, -EMAXERRNO - 1 # error? 1441da177e4SLinus Torvalds sltu t0, t0, v0 1451da177e4SLinus Torvalds sw t0, PT_R7(sp) # set error flag 1461da177e4SLinus Torvalds beqz t0, 1f 1471da177e4SLinus Torvalds 1488f5a00ebSAl Viro lw t1, PT_R2(sp) # syscall number 1491da177e4SLinus Torvalds negu v0 # error 1508f5a00ebSAl Viro sw t1, PT_R0(sp) # save it for syscall restarting 1511da177e4SLinus Torvalds1: sw v0, PT_R2(sp) # result 1521da177e4SLinus Torvalds 1539d37c405SMarkos Chandras2: j syscall_exit 1541da177e4SLinus Torvalds 1551da177e4SLinus Torvalds/* ------------------------------------------------------------------------ */ 1561da177e4SLinus Torvalds 1571da177e4SLinus Torvalds /* 1581da177e4SLinus Torvalds * The stackpointer for a call with more than 4 arguments is bad. 1591da177e4SLinus Torvalds * We probably should handle this case a bit more drastic. 1601da177e4SLinus Torvalds */ 1611da177e4SLinus Torvaldsbad_stack: 1625b89c004SAl Viro li v0, EFAULT 1631da177e4SLinus Torvalds sw v0, PT_R2(sp) 1641da177e4SLinus Torvalds li t0, 1 # set error flag 1651da177e4SLinus Torvalds sw t0, PT_R7(sp) 1661da177e4SLinus Torvalds j o32_syscall_exit 1671da177e4SLinus Torvalds 1681da177e4SLinus Torvalds /* 1691da177e4SLinus Torvalds * The system call does not exist in this kernel 1701da177e4SLinus Torvalds */ 1711da177e4SLinus Torvaldsillegal_syscall: 172bda8229bSAtsushi Nemoto li v0, ENOSYS # error 1731da177e4SLinus Torvalds sw v0, PT_R2(sp) 1741da177e4SLinus Torvalds li t0, 1 # set error flag 1751da177e4SLinus Torvalds sw t0, PT_R7(sp) 1761da177e4SLinus Torvalds j o32_syscall_exit 1771da177e4SLinus Torvalds END(handle_sys) 1781da177e4SLinus Torvalds 1791da177e4SLinus Torvalds LEAF(sys_syscall) 1801da177e4SLinus Torvalds subu t0, a0, __NR_O32_Linux # check syscall number 1811da177e4SLinus Torvalds sltiu v0, t0, __NR_O32_Linux_syscalls + 1 182e807f957SVlad Malov beqz t0, einval # do not recurse 18346e12c07SRalf Baechle sll t1, t0, 2 1841da177e4SLinus Torvalds beqz v0, einval 1851da177e4SLinus Torvalds lw t2, sys_call_table(t1) # syscall routine 1861da177e4SLinus Torvalds 1871da177e4SLinus Torvalds /* Some syscalls like execve get their arguments from struct pt_regs 1881da177e4SLinus Torvalds and claim zero arguments in the syscall table. Thus we have to 1891da177e4SLinus Torvalds assume the worst case and shuffle around all potential arguments. 1901da177e4SLinus Torvalds If you want performance, don't use indirect syscalls. */ 1911da177e4SLinus Torvalds 1921da177e4SLinus Torvalds move a0, a1 # shift argument registers 1931da177e4SLinus Torvalds move a1, a2 1941da177e4SLinus Torvalds move a2, a3 1951da177e4SLinus Torvalds lw a3, 16(sp) 1961da177e4SLinus Torvalds lw t4, 20(sp) 1971da177e4SLinus Torvalds lw t5, 24(sp) 1981da177e4SLinus Torvalds lw t6, 28(sp) 1991da177e4SLinus Torvalds sw t4, 16(sp) 2001da177e4SLinus Torvalds sw t5, 20(sp) 2011da177e4SLinus Torvalds sw t6, 24(sp) 2021da177e4SLinus Torvalds sw a0, PT_R4(sp) # .. and push back a0 - a3, some 2031da177e4SLinus Torvalds sw a1, PT_R5(sp) # syscalls expect them there 2041da177e4SLinus Torvalds sw a2, PT_R6(sp) 2051da177e4SLinus Torvalds sw a3, PT_R7(sp) 2061da177e4SLinus Torvalds sw a3, PT_R26(sp) # update a3 for syscall restarting 2071da177e4SLinus Torvalds jr t2 2081da177e4SLinus Torvalds /* Unreached */ 2091da177e4SLinus Torvalds 210fb498e25SAtsushi Nemotoeinval: li v0, -ENOSYS 2111da177e4SLinus Torvalds jr ra 2121da177e4SLinus Torvalds END(sys_syscall) 2131da177e4SLinus Torvalds 21446e12c07SRalf Baechle .align 2 21546e12c07SRalf Baechle .type sys_call_table, @object 21646e12c07SRalf BaechleEXPORT(sys_call_table) 21746e12c07SRalf Baechle PTR sys_syscall /* 4000 */ 21846e12c07SRalf Baechle PTR sys_exit 21946e12c07SRalf Baechle PTR __sys_fork 22046e12c07SRalf Baechle PTR sys_read 22146e12c07SRalf Baechle PTR sys_write 22246e12c07SRalf Baechle PTR sys_open /* 4005 */ 22346e12c07SRalf Baechle PTR sys_close 22446e12c07SRalf Baechle PTR sys_waitpid 22546e12c07SRalf Baechle PTR sys_creat 22646e12c07SRalf Baechle PTR sys_link 22746e12c07SRalf Baechle PTR sys_unlink /* 4010 */ 22846e12c07SRalf Baechle PTR sys_execve 22946e12c07SRalf Baechle PTR sys_chdir 23046e12c07SRalf Baechle PTR sys_time 23146e12c07SRalf Baechle PTR sys_mknod 23246e12c07SRalf Baechle PTR sys_chmod /* 4015 */ 23346e12c07SRalf Baechle PTR sys_lchown 23446e12c07SRalf Baechle PTR sys_ni_syscall 23546e12c07SRalf Baechle PTR sys_ni_syscall /* was sys_stat */ 23646e12c07SRalf Baechle PTR sys_lseek 23746e12c07SRalf Baechle PTR sys_getpid /* 4020 */ 23846e12c07SRalf Baechle PTR sys_mount 23946e12c07SRalf Baechle PTR sys_oldumount 24046e12c07SRalf Baechle PTR sys_setuid 24146e12c07SRalf Baechle PTR sys_getuid 24246e12c07SRalf Baechle PTR sys_stime /* 4025 */ 24346e12c07SRalf Baechle PTR sys_ptrace 24446e12c07SRalf Baechle PTR sys_alarm 24546e12c07SRalf Baechle PTR sys_ni_syscall /* was sys_fstat */ 24646e12c07SRalf Baechle PTR sys_pause 24746e12c07SRalf Baechle PTR sys_utime /* 4030 */ 24846e12c07SRalf Baechle PTR sys_ni_syscall 24946e12c07SRalf Baechle PTR sys_ni_syscall 25046e12c07SRalf Baechle PTR sys_access 25146e12c07SRalf Baechle PTR sys_nice 25246e12c07SRalf Baechle PTR sys_ni_syscall /* 4035 */ 25346e12c07SRalf Baechle PTR sys_sync 25446e12c07SRalf Baechle PTR sys_kill 25546e12c07SRalf Baechle PTR sys_rename 25646e12c07SRalf Baechle PTR sys_mkdir 25746e12c07SRalf Baechle PTR sys_rmdir /* 4040 */ 25846e12c07SRalf Baechle PTR sys_dup 25946e12c07SRalf Baechle PTR sysm_pipe 26046e12c07SRalf Baechle PTR sys_times 26146e12c07SRalf Baechle PTR sys_ni_syscall 26246e12c07SRalf Baechle PTR sys_brk /* 4045 */ 26346e12c07SRalf Baechle PTR sys_setgid 26446e12c07SRalf Baechle PTR sys_getgid 26546e12c07SRalf Baechle PTR sys_ni_syscall /* was signal(2) */ 26646e12c07SRalf Baechle PTR sys_geteuid 26746e12c07SRalf Baechle PTR sys_getegid /* 4050 */ 26846e12c07SRalf Baechle PTR sys_acct 26946e12c07SRalf Baechle PTR sys_umount 27046e12c07SRalf Baechle PTR sys_ni_syscall 27146e12c07SRalf Baechle PTR sys_ioctl 27246e12c07SRalf Baechle PTR sys_fcntl /* 4055 */ 27346e12c07SRalf Baechle PTR sys_ni_syscall 27446e12c07SRalf Baechle PTR sys_setpgid 27546e12c07SRalf Baechle PTR sys_ni_syscall 27646e12c07SRalf Baechle PTR sys_olduname 27746e12c07SRalf Baechle PTR sys_umask /* 4060 */ 27846e12c07SRalf Baechle PTR sys_chroot 27946e12c07SRalf Baechle PTR sys_ustat 28046e12c07SRalf Baechle PTR sys_dup2 28146e12c07SRalf Baechle PTR sys_getppid 28246e12c07SRalf Baechle PTR sys_getpgrp /* 4065 */ 28346e12c07SRalf Baechle PTR sys_setsid 28446e12c07SRalf Baechle PTR sys_sigaction 28546e12c07SRalf Baechle PTR sys_sgetmask 28646e12c07SRalf Baechle PTR sys_ssetmask 28746e12c07SRalf Baechle PTR sys_setreuid /* 4070 */ 28846e12c07SRalf Baechle PTR sys_setregid 28946e12c07SRalf Baechle PTR sys_sigsuspend 29046e12c07SRalf Baechle PTR sys_sigpending 29146e12c07SRalf Baechle PTR sys_sethostname 29246e12c07SRalf Baechle PTR sys_setrlimit /* 4075 */ 29346e12c07SRalf Baechle PTR sys_getrlimit 29446e12c07SRalf Baechle PTR sys_getrusage 29546e12c07SRalf Baechle PTR sys_gettimeofday 29646e12c07SRalf Baechle PTR sys_settimeofday 29746e12c07SRalf Baechle PTR sys_getgroups /* 4080 */ 29846e12c07SRalf Baechle PTR sys_setgroups 29946e12c07SRalf Baechle PTR sys_ni_syscall /* old_select */ 30046e12c07SRalf Baechle PTR sys_symlink 30146e12c07SRalf Baechle PTR sys_ni_syscall /* was sys_lstat */ 30246e12c07SRalf Baechle PTR sys_readlink /* 4085 */ 30346e12c07SRalf Baechle PTR sys_uselib 30446e12c07SRalf Baechle PTR sys_swapon 30546e12c07SRalf Baechle PTR sys_reboot 30646e12c07SRalf Baechle PTR sys_old_readdir 30746e12c07SRalf Baechle PTR sys_mips_mmap /* 4090 */ 30846e12c07SRalf Baechle PTR sys_munmap 30946e12c07SRalf Baechle PTR sys_truncate 31046e12c07SRalf Baechle PTR sys_ftruncate 31146e12c07SRalf Baechle PTR sys_fchmod 31246e12c07SRalf Baechle PTR sys_fchown /* 4095 */ 31346e12c07SRalf Baechle PTR sys_getpriority 31446e12c07SRalf Baechle PTR sys_setpriority 31546e12c07SRalf Baechle PTR sys_ni_syscall 31646e12c07SRalf Baechle PTR sys_statfs 31746e12c07SRalf Baechle PTR sys_fstatfs /* 4100 */ 31846e12c07SRalf Baechle PTR sys_ni_syscall /* was ioperm(2) */ 31946e12c07SRalf Baechle PTR sys_socketcall 32046e12c07SRalf Baechle PTR sys_syslog 32146e12c07SRalf Baechle PTR sys_setitimer 32246e12c07SRalf Baechle PTR sys_getitimer /* 4105 */ 32346e12c07SRalf Baechle PTR sys_newstat 32446e12c07SRalf Baechle PTR sys_newlstat 32546e12c07SRalf Baechle PTR sys_newfstat 32646e12c07SRalf Baechle PTR sys_uname 32746e12c07SRalf Baechle PTR sys_ni_syscall /* 4110 was iopl(2) */ 32846e12c07SRalf Baechle PTR sys_vhangup 32946e12c07SRalf Baechle PTR sys_ni_syscall /* was sys_idle() */ 33046e12c07SRalf Baechle PTR sys_ni_syscall /* was sys_vm86 */ 33146e12c07SRalf Baechle PTR sys_wait4 33246e12c07SRalf Baechle PTR sys_swapoff /* 4115 */ 33346e12c07SRalf Baechle PTR sys_sysinfo 33446e12c07SRalf Baechle PTR sys_ipc 33546e12c07SRalf Baechle PTR sys_fsync 33646e12c07SRalf Baechle PTR sys_sigreturn 33746e12c07SRalf Baechle PTR __sys_clone /* 4120 */ 33846e12c07SRalf Baechle PTR sys_setdomainname 33946e12c07SRalf Baechle PTR sys_newuname 34046e12c07SRalf Baechle PTR sys_ni_syscall /* sys_modify_ldt */ 34146e12c07SRalf Baechle PTR sys_adjtimex 34246e12c07SRalf Baechle PTR sys_mprotect /* 4125 */ 34346e12c07SRalf Baechle PTR sys_sigprocmask 34446e12c07SRalf Baechle PTR sys_ni_syscall /* was create_module */ 34546e12c07SRalf Baechle PTR sys_init_module 34646e12c07SRalf Baechle PTR sys_delete_module 34746e12c07SRalf Baechle PTR sys_ni_syscall /* 4130 was get_kernel_syms */ 34846e12c07SRalf Baechle PTR sys_quotactl 34946e12c07SRalf Baechle PTR sys_getpgid 35046e12c07SRalf Baechle PTR sys_fchdir 35146e12c07SRalf Baechle PTR sys_bdflush 35246e12c07SRalf Baechle PTR sys_sysfs /* 4135 */ 35346e12c07SRalf Baechle PTR sys_personality 35446e12c07SRalf Baechle PTR sys_ni_syscall /* for afs_syscall */ 35546e12c07SRalf Baechle PTR sys_setfsuid 35646e12c07SRalf Baechle PTR sys_setfsgid 35746e12c07SRalf Baechle PTR sys_llseek /* 4140 */ 35846e12c07SRalf Baechle PTR sys_getdents 35946e12c07SRalf Baechle PTR sys_select 36046e12c07SRalf Baechle PTR sys_flock 36146e12c07SRalf Baechle PTR sys_msync 36246e12c07SRalf Baechle PTR sys_readv /* 4145 */ 36346e12c07SRalf Baechle PTR sys_writev 36446e12c07SRalf Baechle PTR sys_cacheflush 36546e12c07SRalf Baechle PTR sys_cachectl 36646e12c07SRalf Baechle PTR sys_sysmips 36746e12c07SRalf Baechle PTR sys_ni_syscall /* 4150 */ 36846e12c07SRalf Baechle PTR sys_getsid 36946e12c07SRalf Baechle PTR sys_fdatasync 37046e12c07SRalf Baechle PTR sys_sysctl 37146e12c07SRalf Baechle PTR sys_mlock 37246e12c07SRalf Baechle PTR sys_munlock /* 4155 */ 37346e12c07SRalf Baechle PTR sys_mlockall 37446e12c07SRalf Baechle PTR sys_munlockall 37546e12c07SRalf Baechle PTR sys_sched_setparam 37646e12c07SRalf Baechle PTR sys_sched_getparam 37746e12c07SRalf Baechle PTR sys_sched_setscheduler /* 4160 */ 37846e12c07SRalf Baechle PTR sys_sched_getscheduler 37946e12c07SRalf Baechle PTR sys_sched_yield 38046e12c07SRalf Baechle PTR sys_sched_get_priority_max 38146e12c07SRalf Baechle PTR sys_sched_get_priority_min 38246e12c07SRalf Baechle PTR sys_sched_rr_get_interval /* 4165 */ 38346e12c07SRalf Baechle PTR sys_nanosleep 38446e12c07SRalf Baechle PTR sys_mremap 38546e12c07SRalf Baechle PTR sys_accept 38646e12c07SRalf Baechle PTR sys_bind 38746e12c07SRalf Baechle PTR sys_connect /* 4170 */ 38846e12c07SRalf Baechle PTR sys_getpeername 38946e12c07SRalf Baechle PTR sys_getsockname 39046e12c07SRalf Baechle PTR sys_getsockopt 39146e12c07SRalf Baechle PTR sys_listen 39246e12c07SRalf Baechle PTR sys_recv /* 4175 */ 39346e12c07SRalf Baechle PTR sys_recvfrom 39446e12c07SRalf Baechle PTR sys_recvmsg 39546e12c07SRalf Baechle PTR sys_send 39646e12c07SRalf Baechle PTR sys_sendmsg 39746e12c07SRalf Baechle PTR sys_sendto /* 4180 */ 39846e12c07SRalf Baechle PTR sys_setsockopt 39946e12c07SRalf Baechle PTR sys_shutdown 40046e12c07SRalf Baechle PTR sys_socket 40146e12c07SRalf Baechle PTR sys_socketpair 40246e12c07SRalf Baechle PTR sys_setresuid /* 4185 */ 40346e12c07SRalf Baechle PTR sys_getresuid 40446e12c07SRalf Baechle PTR sys_ni_syscall /* was sys_query_module */ 40546e12c07SRalf Baechle PTR sys_poll 40646e12c07SRalf Baechle PTR sys_ni_syscall /* was nfsservctl */ 40746e12c07SRalf Baechle PTR sys_setresgid /* 4190 */ 40846e12c07SRalf Baechle PTR sys_getresgid 40946e12c07SRalf Baechle PTR sys_prctl 41046e12c07SRalf Baechle PTR sys_rt_sigreturn 41146e12c07SRalf Baechle PTR sys_rt_sigaction 41246e12c07SRalf Baechle PTR sys_rt_sigprocmask /* 4195 */ 41346e12c07SRalf Baechle PTR sys_rt_sigpending 41446e12c07SRalf Baechle PTR sys_rt_sigtimedwait 41546e12c07SRalf Baechle PTR sys_rt_sigqueueinfo 41646e12c07SRalf Baechle PTR sys_rt_sigsuspend 41746e12c07SRalf Baechle PTR sys_pread64 /* 4200 */ 41846e12c07SRalf Baechle PTR sys_pwrite64 41946e12c07SRalf Baechle PTR sys_chown 42046e12c07SRalf Baechle PTR sys_getcwd 42146e12c07SRalf Baechle PTR sys_capget 42246e12c07SRalf Baechle PTR sys_capset /* 4205 */ 42346e12c07SRalf Baechle PTR sys_sigaltstack 42446e12c07SRalf Baechle PTR sys_sendfile 42546e12c07SRalf Baechle PTR sys_ni_syscall 42646e12c07SRalf Baechle PTR sys_ni_syscall 42746e12c07SRalf Baechle PTR sys_mips_mmap2 /* 4210 */ 42846e12c07SRalf Baechle PTR sys_truncate64 42946e12c07SRalf Baechle PTR sys_ftruncate64 43046e12c07SRalf Baechle PTR sys_stat64 43146e12c07SRalf Baechle PTR sys_lstat64 43246e12c07SRalf Baechle PTR sys_fstat64 /* 4215 */ 43346e12c07SRalf Baechle PTR sys_pivot_root 43446e12c07SRalf Baechle PTR sys_mincore 43546e12c07SRalf Baechle PTR sys_madvise 43646e12c07SRalf Baechle PTR sys_getdents64 43746e12c07SRalf Baechle PTR sys_fcntl64 /* 4220 */ 43846e12c07SRalf Baechle PTR sys_ni_syscall 43946e12c07SRalf Baechle PTR sys_gettid 44046e12c07SRalf Baechle PTR sys_readahead 44146e12c07SRalf Baechle PTR sys_setxattr 44246e12c07SRalf Baechle PTR sys_lsetxattr /* 4225 */ 44346e12c07SRalf Baechle PTR sys_fsetxattr 44446e12c07SRalf Baechle PTR sys_getxattr 44546e12c07SRalf Baechle PTR sys_lgetxattr 44646e12c07SRalf Baechle PTR sys_fgetxattr 44746e12c07SRalf Baechle PTR sys_listxattr /* 4230 */ 44846e12c07SRalf Baechle PTR sys_llistxattr 44946e12c07SRalf Baechle PTR sys_flistxattr 45046e12c07SRalf Baechle PTR sys_removexattr 45146e12c07SRalf Baechle PTR sys_lremovexattr 45246e12c07SRalf Baechle PTR sys_fremovexattr /* 4235 */ 45346e12c07SRalf Baechle PTR sys_tkill 45446e12c07SRalf Baechle PTR sys_sendfile64 45546e12c07SRalf Baechle PTR sys_futex 456f088fc84SRalf Baechle#ifdef CONFIG_MIPS_MT_FPAFF 457f088fc84SRalf Baechle /* 458f088fc84SRalf Baechle * For FPU affinity scheduling on MIPS MT processors, we need to 459f088fc84SRalf Baechle * intercept sys_sched_xxxaffinity() calls until we get a proper hook 4600a0fca9dSViresh Kumar * in kernel/sched/core.c. Considered only temporary we only support 4610a0fca9dSViresh Kumar * these hooks for the 32-bit kernel - there is no MIPS64 MT processor 4620a0fca9dSViresh Kumar * atm. 463f088fc84SRalf Baechle */ 46446e12c07SRalf Baechle PTR mipsmt_sys_sched_setaffinity 46546e12c07SRalf Baechle PTR mipsmt_sys_sched_getaffinity 466f088fc84SRalf Baechle#else 46746e12c07SRalf Baechle PTR sys_sched_setaffinity 46846e12c07SRalf Baechle PTR sys_sched_getaffinity /* 4240 */ 469f088fc84SRalf Baechle#endif /* CONFIG_MIPS_MT_FPAFF */ 47046e12c07SRalf Baechle PTR sys_io_setup 47146e12c07SRalf Baechle PTR sys_io_destroy 47246e12c07SRalf Baechle PTR sys_io_getevents 47346e12c07SRalf Baechle PTR sys_io_submit 47446e12c07SRalf Baechle PTR sys_io_cancel /* 4245 */ 47546e12c07SRalf Baechle PTR sys_exit_group 47646e12c07SRalf Baechle PTR sys_lookup_dcookie 47746e12c07SRalf Baechle PTR sys_epoll_create 47846e12c07SRalf Baechle PTR sys_epoll_ctl 47946e12c07SRalf Baechle PTR sys_epoll_wait /* 4250 */ 48046e12c07SRalf Baechle PTR sys_remap_file_pages 48146e12c07SRalf Baechle PTR sys_set_tid_address 48246e12c07SRalf Baechle PTR sys_restart_syscall 48346e12c07SRalf Baechle PTR sys_fadvise64_64 48446e12c07SRalf Baechle PTR sys_statfs64 /* 4255 */ 48546e12c07SRalf Baechle PTR sys_fstatfs64 48646e12c07SRalf Baechle PTR sys_timer_create 48746e12c07SRalf Baechle PTR sys_timer_settime 48846e12c07SRalf Baechle PTR sys_timer_gettime 48946e12c07SRalf Baechle PTR sys_timer_getoverrun /* 4260 */ 49046e12c07SRalf Baechle PTR sys_timer_delete 49146e12c07SRalf Baechle PTR sys_clock_settime 49246e12c07SRalf Baechle PTR sys_clock_gettime 49346e12c07SRalf Baechle PTR sys_clock_getres 49446e12c07SRalf Baechle PTR sys_clock_nanosleep /* 4265 */ 49546e12c07SRalf Baechle PTR sys_tgkill 49646e12c07SRalf Baechle PTR sys_utimes 49746e12c07SRalf Baechle PTR sys_mbind 498*1ff1ad6bSHuacai Chen PTR sys_get_mempolicy 499*1ff1ad6bSHuacai Chen PTR sys_set_mempolicy /* 4270 */ 50046e12c07SRalf Baechle PTR sys_mq_open 50146e12c07SRalf Baechle PTR sys_mq_unlink 50246e12c07SRalf Baechle PTR sys_mq_timedsend 50346e12c07SRalf Baechle PTR sys_mq_timedreceive 50446e12c07SRalf Baechle PTR sys_mq_notify /* 4275 */ 50546e12c07SRalf Baechle PTR sys_mq_getsetattr 50646e12c07SRalf Baechle PTR sys_ni_syscall /* sys_vserver */ 50746e12c07SRalf Baechle PTR sys_waitid 50846e12c07SRalf Baechle PTR sys_ni_syscall /* available, was setaltroot */ 50946e12c07SRalf Baechle PTR sys_add_key /* 4280 */ 51046e12c07SRalf Baechle PTR sys_request_key 51146e12c07SRalf Baechle PTR sys_keyctl 51246e12c07SRalf Baechle PTR sys_set_thread_area 51346e12c07SRalf Baechle PTR sys_inotify_init 51446e12c07SRalf Baechle PTR sys_inotify_add_watch /* 4285 */ 51546e12c07SRalf Baechle PTR sys_inotify_rm_watch 51646e12c07SRalf Baechle PTR sys_migrate_pages 51746e12c07SRalf Baechle PTR sys_openat 51846e12c07SRalf Baechle PTR sys_mkdirat 51946e12c07SRalf Baechle PTR sys_mknodat /* 4290 */ 52046e12c07SRalf Baechle PTR sys_fchownat 52146e12c07SRalf Baechle PTR sys_futimesat 52246e12c07SRalf Baechle PTR sys_fstatat64 52346e12c07SRalf Baechle PTR sys_unlinkat 52446e12c07SRalf Baechle PTR sys_renameat /* 4295 */ 52546e12c07SRalf Baechle PTR sys_linkat 52646e12c07SRalf Baechle PTR sys_symlinkat 52746e12c07SRalf Baechle PTR sys_readlinkat 52846e12c07SRalf Baechle PTR sys_fchmodat 52946e12c07SRalf Baechle PTR sys_faccessat /* 4300 */ 53046e12c07SRalf Baechle PTR sys_pselect6 53146e12c07SRalf Baechle PTR sys_ppoll 53246e12c07SRalf Baechle PTR sys_unshare 53346e12c07SRalf Baechle PTR sys_splice 53446e12c07SRalf Baechle PTR sys_sync_file_range /* 4305 */ 53546e12c07SRalf Baechle PTR sys_tee 53646e12c07SRalf Baechle PTR sys_vmsplice 53746e12c07SRalf Baechle PTR sys_move_pages 53846e12c07SRalf Baechle PTR sys_set_robust_list 53946e12c07SRalf Baechle PTR sys_get_robust_list /* 4310 */ 54046e12c07SRalf Baechle PTR sys_kexec_load 54146e12c07SRalf Baechle PTR sys_getcpu 54246e12c07SRalf Baechle PTR sys_epoll_pwait 54346e12c07SRalf Baechle PTR sys_ioprio_set 54446e12c07SRalf Baechle PTR sys_ioprio_get /* 4315 */ 54546e12c07SRalf Baechle PTR sys_utimensat 54646e12c07SRalf Baechle PTR sys_signalfd 54746e12c07SRalf Baechle PTR sys_ni_syscall /* was timerfd */ 54846e12c07SRalf Baechle PTR sys_eventfd 54946e12c07SRalf Baechle PTR sys_fallocate /* 4320 */ 55046e12c07SRalf Baechle PTR sys_timerfd_create 55146e12c07SRalf Baechle PTR sys_timerfd_gettime 55246e12c07SRalf Baechle PTR sys_timerfd_settime 55346e12c07SRalf Baechle PTR sys_signalfd4 55446e12c07SRalf Baechle PTR sys_eventfd2 /* 4325 */ 55546e12c07SRalf Baechle PTR sys_epoll_create1 55646e12c07SRalf Baechle PTR sys_dup3 55746e12c07SRalf Baechle PTR sys_pipe2 55846e12c07SRalf Baechle PTR sys_inotify_init1 55946e12c07SRalf Baechle PTR sys_preadv /* 4330 */ 56046e12c07SRalf Baechle PTR sys_pwritev 56146e12c07SRalf Baechle PTR sys_rt_tgsigqueueinfo 56246e12c07SRalf Baechle PTR sys_perf_event_open 56346e12c07SRalf Baechle PTR sys_accept4 56446e12c07SRalf Baechle PTR sys_recvmmsg /* 4335 */ 56546e12c07SRalf Baechle PTR sys_fanotify_init 56646e12c07SRalf Baechle PTR sys_fanotify_mark 56746e12c07SRalf Baechle PTR sys_prlimit64 56846e12c07SRalf Baechle PTR sys_name_to_handle_at 56946e12c07SRalf Baechle PTR sys_open_by_handle_at /* 4340 */ 57046e12c07SRalf Baechle PTR sys_clock_adjtime 57146e12c07SRalf Baechle PTR sys_syncfs 57246e12c07SRalf Baechle PTR sys_sendmmsg 57346e12c07SRalf Baechle PTR sys_setns 57446e12c07SRalf Baechle PTR sys_process_vm_readv /* 4345 */ 57546e12c07SRalf Baechle PTR sys_process_vm_writev 57646e12c07SRalf Baechle PTR sys_kcmp 57746e12c07SRalf Baechle PTR sys_finit_module 5786776254bSJames Hogan PTR sys_sched_setattr 5796776254bSJames Hogan PTR sys_sched_getattr /* 4350 */ 580367f0b50SRalf Baechle PTR sys_renameat2 581