2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
6 * Copyright (C) 1995, 96, 97, 98, 99, 2000, 01, 02 by Ralf Baechle
7 * Copyright (C) 1999, 2000 Silicon Graphics, Inc.
8 * Copyright (C) 2001 MIPS Technologies, Inc.
10 #include <linux/errno.h>
12 #include <asm/asmmacro.h>
13 #include <asm/irqflags.h>
14 #include <asm/mipsregs.h>
15 #include <asm/regdef.h>
16 #include <asm/stackframe.h>
17 #include <asm/asm-offsets.h>
18 #include <asm/sysmips.h>
19 #include <asm/thread_info.h>
20 #include <asm/unistd.h>
23 #ifndef CONFIG_BINFMT_ELF32
24 /* Neither O32 nor N32, so define handle_sys here */
25 #define handle_sys64 handle_sys
29 NESTED(handle_sys64, PT_SIZE, sp)
30 #if !defined(CONFIG_MIPS32_O32) && !defined(CONFIG_MIPS32_N32)
32 * When 32-bit compatibility is configured scall_o32.S
42 dsubu t0, v0, __NR_64_Linux # check syscall number
43 sltiu t0, t0, __NR_64_Linux_syscalls + 1
44 #if !defined(CONFIG_MIPS32_O32) && !defined(CONFIG_MIPS32_N32)
45 ld t1, PT_EPC(sp) # skip syscall on return
46 daddiu t1, 4 # skip to next instruction
49 beqz t0, illegal_syscall
51 dsll t0, v0, 3 # offset into table
52 ld t2, (sys_call_table - (__NR_64_Linux * 8))(t0)
55 sd a3, PT_R26(sp) # save a3 for syscall restarting
57 li t1, _TIF_SYSCALL_TRACE | _TIF_SYSCALL_AUDIT
58 LONG_L t0, TI_FLAGS($28) # syscall tracing enabled?
60 bnez t0, syscall_trace_entry
62 jalr t2 # Do The Real Thing (TM)
64 li t0, -EMAXERRNO - 1 # error?
66 sd t0, PT_R7(sp) # set error flag
70 sd v0, PT_R0(sp) # set flag for syscall
72 1: sd v0, PT_R2(sp) # result
75 local_irq_disable # make sure need_resched and
76 # signals dont change between
78 LONG_L a2, TI_FLAGS($28) # current->work
79 li t0, _TIF_ALLWORK_MASK
81 bnez t0, n64_syscall_exit_work
85 n64_syscall_exit_work:
86 j syscall_exit_work_partial
88 /* ------------------------------------------------------------------------ */
99 ld a0, PT_R4(sp) # Restore argument registers
107 li t0, -EMAXERRNO - 1 # error?
109 sd t0, PT_R7(sp) # set error flag
113 sd v0, PT_R0(sp) # set flag for syscall restarting
114 1: sd v0, PT_R2(sp) # result
119 /* This also isn't a 64-bit syscall, throw an error. */
120 li v0, ENOSYS # error
122 li t0, 1 # set error flag
129 PTR sys_read /* 5000 */
134 PTR sys_newfstat /* 5005 */
139 PTR sys_mprotect /* 5010 */
143 PTR sys_rt_sigprocmask
144 PTR sys_ioctl /* 5015 */
149 PTR sys_access /* 5020 */
154 PTR sys_msync /* 5025 */
159 PTR sys_shmctl /* 5030 */
164 PTR sys_getitimer /* 5035 */
169 PTR sys_socket /* 5040 */
174 PTR sys_sendmsg /* 5045 */
179 PTR sys_getsockname /* 5050 */
184 PTR sys_clone /* 5055 */
189 PTR sys_kill /* 5060 */
194 PTR sys_shmdt /* 5065 */
199 PTR sys_fcntl /* 5070 */
204 PTR sys_ftruncate /* 5075 */
209 PTR sys_rename /* 5080 */
214 PTR sys_unlink /* 5085 */
219 PTR sys_chown /* 5090 */
224 PTR sys_getrlimit /* 5095 */
229 PTR sys_getuid /* 5100 */
234 PTR sys_geteuid /* 5105 */
239 PTR sys_setsid /* 5110 */
244 PTR sys_setresuid /* 5115 */
249 PTR sys_setfsuid /* 5120 */
254 PTR sys_rt_sigpending /* 5125 */
255 PTR sys_rt_sigtimedwait
256 PTR sys_rt_sigqueueinfo
257 PTR sys_rt_sigsuspend
259 PTR sys_utime /* 5130 */
264 PTR sys_fstatfs /* 5135 */
268 PTR sys_sched_setparam
269 PTR sys_sched_getparam /* 5140 */
270 PTR sys_sched_setscheduler
271 PTR sys_sched_getscheduler
272 PTR sys_sched_get_priority_max
273 PTR sys_sched_get_priority_min
274 PTR sys_sched_rr_get_interval /* 5145 */
279 PTR sys_vhangup /* 5150 */
284 PTR sys_setrlimit /* 5155 */
289 PTR sys_mount /* 5160 */
294 PTR sys_sethostname /* 5165 */
295 PTR sys_setdomainname
296 PTR sys_ni_syscall /* was create_module */
298 PTR sys_delete_module
299 PTR sys_ni_syscall /* 5170, was get_kernel_syms */
300 PTR sys_ni_syscall /* was query_module */
303 PTR sys_ni_syscall /* res. for getpmsg */
304 PTR sys_ni_syscall /* 5175 for putpmsg */
305 PTR sys_ni_syscall /* res. for afs_syscall */
306 PTR sys_ni_syscall /* res. for security */
309 PTR sys_setxattr /* 5180 */
314 PTR sys_fgetxattr /* 5185 */
319 PTR sys_lremovexattr /* 5190 */
324 PTR sys_sched_setaffinity /* 5195 */
325 PTR sys_sched_getaffinity
329 PTR sys_io_setup /* 5200 */
334 PTR sys_exit_group /* 5205 */
335 PTR sys_lookup_dcookie
339 PTR sys_remap_file_pages /* 5210 */
341 PTR sys_set_tid_address
342 PTR sys_restart_syscall
344 PTR sys_fadvise64_64 /* 5215 */
346 PTR sys_timer_settime
347 PTR sys_timer_gettime
348 PTR sys_timer_getoverrun
349 PTR sys_timer_delete /* 5220 */
350 PTR sys_clock_settime
351 PTR sys_clock_gettime
353 PTR sys_clock_nanosleep
354 PTR sys_tgkill /* 5225 */
357 PTR sys_ni_syscall /* sys_get_mempolicy */
358 PTR sys_ni_syscall /* sys_set_mempolicy */
359 PTR sys_mq_open /* 5230 */
362 PTR sys_mq_timedreceive
364 PTR sys_mq_getsetattr /* 5235 */
365 PTR sys_ni_syscall /* sys_vserver */
367 PTR sys_ni_syscall /* available, was setaltroot */
369 PTR sys_request_key /* 5240 */
371 PTR sys_set_thread_area
373 PTR sys_inotify_add_watch
374 PTR sys_inotify_rm_watch /* 5245 */
375 PTR sys_migrate_pages
379 PTR sys_fchownat /* 5250 */
384 PTR sys_linkat /* 5255 */
389 PTR sys_pselect6 /* 5260 */
393 PTR sys_sync_file_range
394 PTR sys_tee /* 5265 */
397 PTR sys_set_robust_list
398 PTR sys_get_robust_list
399 PTR sys_kexec_load /* 5270 */
404 PTR sys_utimensat /* 5275 */
409 PTR sys_timerfd_create /* 5280 */
410 PTR sys_timerfd_gettime
411 PTR sys_timerfd_settime
414 PTR sys_epoll_create1 /* 5285 */
417 PTR sys_inotify_init1
419 PTR sys_pwritev /* 5390 */
420 PTR sys_rt_tgsigqueueinfo
421 PTR sys_perf_event_open
423 .size sys_call_table,.-sys_call_table