1/* System Call Table 2 * 3 * Copyright (C) 1999-2004 Matthew Wilcox <willy at parisc-linux.org> 4 * Copyright (C) 2000-2001 John Marvin <jsm at parisc-linux.org> 5 * Copyright (C) 2000 Alan Modra <amodra at parisc-linux.org> 6 * Copyright (C) 2000-2003 Paul Bame <bame at parisc-linux.org> 7 * Copyright (C) 2000 Philipp Rumpf <prumpf with tux.org> 8 * Copyright (C) 2000 Michael Ang <mang with subcarrier.org> 9 * Copyright (C) 2000 David Huggins-Daines <dhd with pobox.org> 10 * Copyright (C) 2000 Grant Grundler <grundler at parisc-linux.org> 11 * Copyright (C) 2001 Richard Hirst <rhirst with parisc-linux.org> 12 * Copyright (C) 2001-2002 Ryan Bradetich <rbrad at parisc-linux.org> 13 * Copyright (C) 2001-2007 Helge Deller <deller at parisc-linux.org> 14 * Copyright (C) 2000-2001 Thomas Bogendoerfer <tsbogend at parisc-linux.org> 15 * Copyright (C) 2002 Randolph Chung <tausq with parisc-linux.org> 16 * Copyright (C) 2005-2006 Kyle McMartin <kyle at parisc-linux.org> 17 * 18 * This program is free software; you can redistribute it and/or modify 19 * it under the terms of the GNU General Public License as published by 20 * the Free Software Foundation; either version 2 of the License, or 21 * (at your option) any later version. 22 * 23 * This program is distributed in the hope that it will be useful, 24 * but WITHOUT ANY WARRANTY; without even the implied warranty of 25 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 26 * GNU General Public License for more details. 27 * 28 * You should have received a copy of the GNU General Public License 29 * along with this program; if not, write to the Free Software 30 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 31 */ 32 33#if defined(CONFIG_64BIT) && !defined(SYSCALL_TABLE_64BIT) 34/* Use ENTRY_SAME for 32-bit syscalls which are the same on wide and 35 * narrow palinux. Use ENTRY_DIFF for those where a 32-bit specific 36 * implementation is required on wide palinux. Use ENTRY_COMP where 37 * the compatibility layer has a useful 32-bit implementation. 38 */ 39#define ENTRY_SAME(_name_) .dword sys_##_name_ 40#define ENTRY_DIFF(_name_) .dword sys32_##_name_ 41#define ENTRY_UHOH(_name_) .dword sys32_##unimplemented 42#define ENTRY_OURS(_name_) .dword parisc_##_name_ 43#define ENTRY_COMP(_name_) .dword compat_sys_##_name_ 44#elif defined(CONFIG_64BIT) && defined(SYSCALL_TABLE_64BIT) 45#define ENTRY_SAME(_name_) .dword sys_##_name_ 46#define ENTRY_DIFF(_name_) .dword sys_##_name_ 47#define ENTRY_UHOH(_name_) .dword sys_##_name_ 48#define ENTRY_OURS(_name_) .dword sys_##_name_ 49#define ENTRY_COMP(_name_) .dword sys_##_name_ 50#else 51#define ENTRY_SAME(_name_) .word sys_##_name_ 52#define ENTRY_DIFF(_name_) .word sys_##_name_ 53#define ENTRY_UHOH(_name_) .word sys_##_name_ 54#define ENTRY_OURS(_name_) .word parisc_##_name_ 55#define ENTRY_COMP(_name_) .word sys_##_name_ 56#endif 57 5890: ENTRY_SAME(restart_syscall) /* 0 */ 5991: ENTRY_SAME(exit) 60 ENTRY_SAME(fork_wrapper) 61 ENTRY_SAME(read) 62 ENTRY_SAME(write) 63 ENTRY_COMP(open) /* 5 */ 64 ENTRY_SAME(close) 65 ENTRY_SAME(waitpid) 66 ENTRY_SAME(creat) 67 ENTRY_SAME(link) 68 ENTRY_SAME(unlink) /* 10 */ 69 ENTRY_COMP(execve) 70 ENTRY_SAME(chdir) 71 /* See comments in kernel/time.c!!! Maybe we don't need this? */ 72 ENTRY_COMP(time) 73 ENTRY_SAME(mknod) 74 ENTRY_SAME(chmod) /* 15 */ 75 ENTRY_SAME(lchown) 76 ENTRY_SAME(socket) 77 /* struct stat is MAYBE identical wide and narrow ?? */ 78 ENTRY_COMP(newstat) 79 ENTRY_COMP(lseek) 80 ENTRY_SAME(getpid) /* 20 */ 81 /* the 'void * data' parameter may need re-packing in wide */ 82 ENTRY_COMP(mount) 83 /* concerned about struct sockaddr in wide/narrow */ 84 /* ---> I think sockaddr is OK unless the compiler packs the struct */ 85 /* differently to align the char array */ 86 ENTRY_SAME(bind) 87 ENTRY_SAME(setuid) 88 ENTRY_SAME(getuid) 89 ENTRY_COMP(stime) /* 25 */ 90 ENTRY_COMP(ptrace) 91 ENTRY_SAME(alarm) 92 /* see stat comment */ 93 ENTRY_COMP(newfstat) 94 ENTRY_SAME(pause) 95 /* struct utimbuf uses time_t which might vary */ 96 ENTRY_COMP(utime) /* 30 */ 97 /* struct sockaddr... */ 98 ENTRY_SAME(connect) 99 ENTRY_SAME(listen) 100 ENTRY_SAME(access) 101 ENTRY_SAME(nice) 102 /* struct sockaddr... */ 103 ENTRY_SAME(accept) /* 35 */ 104 ENTRY_SAME(sync) 105 ENTRY_SAME(kill) 106 ENTRY_SAME(rename) 107 ENTRY_SAME(mkdir) 108 ENTRY_SAME(rmdir) /* 40 */ 109 ENTRY_SAME(dup) 110 ENTRY_SAME(pipe) 111 ENTRY_COMP(times) 112 /* struct sockaddr... */ 113 ENTRY_SAME(getsockname) 114 /* it seems possible brk() could return a >4G pointer... */ 115 ENTRY_SAME(brk) /* 45 */ 116 ENTRY_SAME(setgid) 117 ENTRY_SAME(getgid) 118 ENTRY_SAME(signal) 119 ENTRY_SAME(geteuid) 120 ENTRY_SAME(getegid) /* 50 */ 121 ENTRY_SAME(acct) 122 ENTRY_SAME(umount) 123 /* struct sockaddr... */ 124 ENTRY_SAME(getpeername) 125 ENTRY_COMP(ioctl) 126 ENTRY_COMP(fcntl) /* 55 */ 127 ENTRY_SAME(socketpair) 128 ENTRY_SAME(setpgid) 129 ENTRY_SAME(send) 130 ENTRY_SAME(newuname) 131 ENTRY_SAME(umask) /* 60 */ 132 ENTRY_SAME(chroot) 133 ENTRY_COMP(ustat) 134 ENTRY_SAME(dup2) 135 ENTRY_SAME(getppid) 136 ENTRY_SAME(getpgrp) /* 65 */ 137 ENTRY_SAME(setsid) 138 ENTRY_SAME(pivot_root) 139 /* I don't like this */ 140 ENTRY_UHOH(sgetmask) 141 ENTRY_UHOH(ssetmask) 142 ENTRY_SAME(setreuid) /* 70 */ 143 ENTRY_SAME(setregid) 144 ENTRY_SAME(mincore) 145 ENTRY_COMP(sigpending) 146 ENTRY_SAME(sethostname) 147 /* Following 3 have linux-common-code structs containing longs -( */ 148 ENTRY_COMP(setrlimit) /* 75 */ 149 ENTRY_COMP(getrlimit) 150 ENTRY_COMP(getrusage) 151 /* struct timeval and timezone are maybe?? consistent wide and narrow */ 152 ENTRY_COMP(gettimeofday) 153 ENTRY_COMP(settimeofday) 154 ENTRY_SAME(getgroups) /* 80 */ 155 ENTRY_SAME(setgroups) 156 /* struct socketaddr... */ 157 ENTRY_SAME(sendto) 158 ENTRY_SAME(symlink) 159 /* see stat comment */ 160 ENTRY_COMP(newlstat) 161 ENTRY_SAME(readlink) /* 85 */ 162 ENTRY_SAME(ni_syscall) /* was uselib */ 163 ENTRY_SAME(swapon) 164 ENTRY_SAME(reboot) 165 ENTRY_SAME(mmap2) 166 ENTRY_SAME(mmap) /* 90 */ 167 ENTRY_SAME(munmap) 168 ENTRY_COMP(truncate) 169 ENTRY_COMP(ftruncate) 170 ENTRY_SAME(fchmod) 171 ENTRY_SAME(fchown) /* 95 */ 172 ENTRY_SAME(getpriority) 173 ENTRY_SAME(setpriority) 174 ENTRY_SAME(recv) 175 ENTRY_COMP(statfs) 176 ENTRY_COMP(fstatfs) /* 100 */ 177 ENTRY_SAME(stat64) 178 ENTRY_SAME(ni_syscall) /* was socketcall */ 179 ENTRY_SAME(syslog) 180 /* even though manpage says struct timeval contains longs, ours has 181 * time_t and suseconds_t -- both of which are safe wide/narrow */ 182 ENTRY_COMP(setitimer) 183 ENTRY_COMP(getitimer) /* 105 */ 184 ENTRY_SAME(capget) 185 ENTRY_SAME(capset) 186 ENTRY_OURS(pread64) 187 ENTRY_OURS(pwrite64) 188 ENTRY_SAME(getcwd) /* 110 */ 189 ENTRY_SAME(vhangup) 190 ENTRY_SAME(fstat64) 191 ENTRY_SAME(vfork_wrapper) 192 /* struct rusage contains longs... */ 193 ENTRY_COMP(wait4) 194 ENTRY_SAME(swapoff) /* 115 */ 195 ENTRY_COMP(sysinfo) 196 ENTRY_SAME(shutdown) 197 ENTRY_SAME(fsync) 198 ENTRY_SAME(madvise) 199 ENTRY_SAME(clone_wrapper) /* 120 */ 200 ENTRY_SAME(setdomainname) 201 ENTRY_COMP(sendfile) 202 /* struct sockaddr... */ 203 ENTRY_SAME(recvfrom) 204 /* struct timex contains longs */ 205 ENTRY_COMP(adjtimex) 206 ENTRY_SAME(mprotect) /* 125 */ 207 /* old_sigset_t forced to 32 bits. Beware glibc sigset_t */ 208 ENTRY_COMP(sigprocmask) 209 ENTRY_SAME(ni_syscall) /* create_module */ 210 ENTRY_SAME(init_module) 211 ENTRY_SAME(delete_module) 212 ENTRY_SAME(ni_syscall) /* 130: get_kernel_syms */ 213 /* time_t inside struct dqblk */ 214 ENTRY_SAME(quotactl) 215 ENTRY_SAME(getpgid) 216 ENTRY_SAME(fchdir) 217 ENTRY_SAME(bdflush) 218 ENTRY_SAME(sysfs) /* 135 */ 219 ENTRY_OURS(personality) 220 ENTRY_SAME(ni_syscall) /* for afs_syscall */ 221 ENTRY_SAME(setfsuid) 222 ENTRY_SAME(setfsgid) 223 /* I think this might work */ 224 ENTRY_SAME(llseek) /* 140 */ 225 ENTRY_COMP(getdents) 226 /* it is POSSIBLE that select will be OK because even though fd_set 227 * contains longs, the macros and sizes are clever. */ 228 ENTRY_COMP(select) 229 ENTRY_SAME(flock) 230 ENTRY_SAME(msync) 231 /* struct iovec contains pointers */ 232 ENTRY_COMP(readv) /* 145 */ 233 ENTRY_COMP(writev) 234 ENTRY_SAME(getsid) 235 ENTRY_SAME(fdatasync) 236 /* struct __sysctl_args is a mess */ 237 ENTRY_COMP(sysctl) 238 ENTRY_SAME(mlock) /* 150 */ 239 ENTRY_SAME(munlock) 240 ENTRY_SAME(mlockall) 241 ENTRY_SAME(munlockall) 242 /* struct sched_param is ok for now */ 243 ENTRY_SAME(sched_setparam) 244 ENTRY_SAME(sched_getparam) /* 155 */ 245 ENTRY_SAME(sched_setscheduler) 246 ENTRY_SAME(sched_getscheduler) 247 ENTRY_SAME(sched_yield) 248 ENTRY_SAME(sched_get_priority_max) 249 ENTRY_SAME(sched_get_priority_min) /* 160 */ 250 ENTRY_COMP(sched_rr_get_interval) 251 ENTRY_COMP(nanosleep) 252 ENTRY_SAME(mremap) 253 ENTRY_SAME(setresuid) 254 ENTRY_SAME(getresuid) /* 165 */ 255 ENTRY_COMP(sigaltstack) 256 ENTRY_SAME(ni_syscall) /* query_module */ 257 ENTRY_SAME(poll) 258 /* structs contain pointers and an in_addr... */ 259 ENTRY_SAME(ni_syscall) /* was nfsservctl */ 260 ENTRY_SAME(setresgid) /* 170 */ 261 ENTRY_SAME(getresgid) 262 ENTRY_SAME(prctl) 263 /* signals need a careful review */ 264 ENTRY_SAME(rt_sigreturn_wrapper) 265 ENTRY_COMP(rt_sigaction) 266 ENTRY_COMP(rt_sigprocmask) /* 175 */ 267 ENTRY_COMP(rt_sigpending) 268 ENTRY_COMP(rt_sigtimedwait) 269 /* even though the struct siginfo_t is different, it appears like 270 * all the paths use values which should be same wide and narrow. 271 * Also the struct is padded to 128 bytes which means we don't have 272 * to worry about faulting trying to copy in a larger 64-bit 273 * struct from a 32-bit user-space app. 274 */ 275 ENTRY_COMP(rt_sigqueueinfo) 276 ENTRY_COMP(rt_sigsuspend) 277 ENTRY_SAME(chown) /* 180 */ 278 /* setsockopt() used by iptables: SO_SET_REPLACE/SO_SET_ADD_COUNTERS */ 279 ENTRY_COMP(setsockopt) 280 ENTRY_COMP(getsockopt) 281 ENTRY_COMP(sendmsg) 282 ENTRY_COMP(recvmsg) 283 ENTRY_SAME(semop) /* 185 */ 284 ENTRY_SAME(semget) 285 ENTRY_COMP(semctl) 286 ENTRY_COMP(msgsnd) 287 ENTRY_COMP(msgrcv) 288 ENTRY_SAME(msgget) /* 190 */ 289 ENTRY_COMP(msgctl) 290 ENTRY_COMP(shmat) 291 ENTRY_SAME(shmdt) 292 ENTRY_SAME(shmget) 293 ENTRY_COMP(shmctl) /* 195 */ 294 ENTRY_SAME(ni_syscall) /* streams1 */ 295 ENTRY_SAME(ni_syscall) /* streams2 */ 296 ENTRY_SAME(lstat64) 297 ENTRY_OURS(truncate64) 298 ENTRY_OURS(ftruncate64) /* 200 */ 299 ENTRY_SAME(getdents64) 300 ENTRY_COMP(fcntl64) 301 ENTRY_SAME(ni_syscall) /* attrctl -- dead */ 302 ENTRY_SAME(ni_syscall) /* acl_get -- dead */ 303 ENTRY_SAME(ni_syscall) /* 205 (acl_set -- dead) */ 304 ENTRY_SAME(gettid) 305 ENTRY_OURS(readahead) 306 ENTRY_SAME(tkill) 307 ENTRY_COMP(sendfile64) 308 ENTRY_COMP(futex) /* 210 */ 309 ENTRY_COMP(sched_setaffinity) 310 ENTRY_COMP(sched_getaffinity) 311 ENTRY_SAME(ni_syscall) /* set_thread_area */ 312 ENTRY_SAME(ni_syscall) /* get_thread_area */ 313 ENTRY_COMP(io_setup) /* 215 */ 314 ENTRY_SAME(io_destroy) 315 ENTRY_COMP(io_getevents) 316 ENTRY_COMP(io_submit) 317 ENTRY_SAME(io_cancel) 318 ENTRY_SAME(alloc_hugepages) /* 220 */ 319 ENTRY_SAME(free_hugepages) 320 ENTRY_SAME(exit_group) 321 ENTRY_COMP(lookup_dcookie) 322 ENTRY_SAME(epoll_create) 323 ENTRY_SAME(epoll_ctl) /* 225 */ 324 ENTRY_SAME(epoll_wait) 325 ENTRY_SAME(remap_file_pages) 326 ENTRY_COMP(semtimedop) 327 ENTRY_COMP(mq_open) 328 ENTRY_SAME(mq_unlink) /* 230 */ 329 ENTRY_COMP(mq_timedsend) 330 ENTRY_COMP(mq_timedreceive) 331 ENTRY_COMP(mq_notify) 332 ENTRY_COMP(mq_getsetattr) 333 ENTRY_COMP(waitid) /* 235 */ 334 ENTRY_OURS(fadvise64_64) 335 ENTRY_SAME(set_tid_address) 336 ENTRY_SAME(setxattr) 337 ENTRY_SAME(lsetxattr) 338 ENTRY_SAME(fsetxattr) /* 240 */ 339 ENTRY_SAME(getxattr) 340 ENTRY_SAME(lgetxattr) 341 ENTRY_SAME(fgetxattr) 342 ENTRY_SAME(listxattr) 343 ENTRY_SAME(llistxattr) /* 245 */ 344 ENTRY_SAME(flistxattr) 345 ENTRY_SAME(removexattr) 346 ENTRY_SAME(lremovexattr) 347 ENTRY_SAME(fremovexattr) 348 ENTRY_COMP(timer_create) /* 250 */ 349 ENTRY_COMP(timer_settime) 350 ENTRY_COMP(timer_gettime) 351 ENTRY_SAME(timer_getoverrun) 352 ENTRY_SAME(timer_delete) 353 ENTRY_COMP(clock_settime) /* 255 */ 354 ENTRY_COMP(clock_gettime) 355 ENTRY_COMP(clock_getres) 356 ENTRY_COMP(clock_nanosleep) 357 ENTRY_SAME(tgkill) 358 ENTRY_COMP(mbind) /* 260 */ 359 ENTRY_COMP(get_mempolicy) 360 ENTRY_COMP(set_mempolicy) 361 ENTRY_SAME(ni_syscall) /* 263: reserved for vserver */ 362 ENTRY_SAME(add_key) 363 ENTRY_SAME(request_key) /* 265 */ 364 ENTRY_SAME(keyctl) 365 ENTRY_SAME(ioprio_set) 366 ENTRY_SAME(ioprio_get) 367 ENTRY_SAME(inotify_init) 368 ENTRY_SAME(inotify_add_watch) /* 270 */ 369 ENTRY_SAME(inotify_rm_watch) 370 ENTRY_SAME(migrate_pages) 371 ENTRY_COMP(pselect6) 372 ENTRY_COMP(ppoll) 373 ENTRY_COMP(openat) /* 275 */ 374 ENTRY_SAME(mkdirat) 375 ENTRY_SAME(mknodat) 376 ENTRY_SAME(fchownat) 377 ENTRY_COMP(futimesat) 378 ENTRY_SAME(fstatat64) /* 280 */ 379 ENTRY_SAME(unlinkat) 380 ENTRY_SAME(renameat) 381 ENTRY_SAME(linkat) 382 ENTRY_SAME(symlinkat) 383 ENTRY_SAME(readlinkat) /* 285 */ 384 ENTRY_SAME(fchmodat) 385 ENTRY_SAME(faccessat) 386 ENTRY_SAME(unshare) 387 ENTRY_COMP(set_robust_list) 388 ENTRY_COMP(get_robust_list) /* 290 */ 389 ENTRY_SAME(splice) 390 ENTRY_OURS(sync_file_range) 391 ENTRY_SAME(tee) 392 ENTRY_COMP(vmsplice) 393 ENTRY_COMP(move_pages) /* 295 */ 394 ENTRY_SAME(getcpu) 395 ENTRY_COMP(epoll_pwait) 396 ENTRY_COMP(statfs64) 397 ENTRY_COMP(fstatfs64) 398 ENTRY_COMP(kexec_load) /* 300 */ 399 ENTRY_COMP(utimensat) 400 ENTRY_COMP(signalfd) 401 ENTRY_SAME(ni_syscall) /* was timerfd */ 402 ENTRY_SAME(eventfd) 403 ENTRY_OURS(fallocate) /* 305 */ 404 ENTRY_SAME(timerfd_create) 405 ENTRY_COMP(timerfd_settime) 406 ENTRY_COMP(timerfd_gettime) 407 ENTRY_COMP(signalfd4) 408 ENTRY_SAME(eventfd2) /* 310 */ 409 ENTRY_SAME(epoll_create1) 410 ENTRY_SAME(dup3) 411 ENTRY_SAME(pipe2) 412 ENTRY_SAME(inotify_init1) 413 ENTRY_COMP(preadv) /* 315 */ 414 ENTRY_COMP(pwritev) 415 ENTRY_COMP(rt_tgsigqueueinfo) 416 ENTRY_SAME(perf_event_open) 417 ENTRY_COMP(recvmmsg) 418 ENTRY_SAME(accept4) /* 320 */ 419 ENTRY_SAME(prlimit64) 420 ENTRY_SAME(fanotify_init) 421 ENTRY_DIFF(fanotify_mark) 422 ENTRY_COMP(clock_adjtime) 423 ENTRY_SAME(name_to_handle_at) /* 325 */ 424 ENTRY_COMP(open_by_handle_at) 425 ENTRY_SAME(syncfs) 426 ENTRY_SAME(setns) 427 ENTRY_COMP(sendmmsg) 428 ENTRY_COMP(process_vm_readv) /* 330 */ 429 ENTRY_COMP(process_vm_writev) 430 ENTRY_SAME(kcmp) 431 ENTRY_SAME(finit_module) 432 ENTRY_SAME(sched_setattr) 433 ENTRY_SAME(sched_getattr) /* 335 */ 434 ENTRY_COMP(utimes) 435 ENTRY_SAME(renameat2) 436 ENTRY_SAME(seccomp) 437 ENTRY_SAME(getrandom) 438 ENTRY_SAME(memfd_create) /* 340 */ 439 ENTRY_SAME(bpf) 440 ENTRY_COMP(execveat) 441 442 443.ifne (. - 90b) - (__NR_Linux_syscalls * (91b - 90b)) 444.error "size of syscall table does not fit value of __NR_Linux_syscalls" 445.endif 446 447#undef ENTRY_SAME 448#undef ENTRY_DIFF 449#undef ENTRY_UHOH 450#undef ENTRY_COMP 451#undef ENTRY_OURS 452