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>
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.
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.
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
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.
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_
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_
58 90: ENTRY_SAME(restart_syscall) /* 0 */
60 ENTRY_SAME(fork_wrapper)
63 ENTRY_COMP(open) /* 5 */
68 ENTRY_SAME(unlink) /* 10 */
71 /* See comments in kernel/time.c!!! Maybe we don't need this? */
74 ENTRY_SAME(chmod) /* 15 */
77 /* struct stat is MAYBE identical wide and narrow ?? */
80 ENTRY_SAME(getpid) /* 20 */
81 /* the 'void * data' parameter may need re-packing in wide */
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 */
89 ENTRY_COMP(stime) /* 25 */
92 /* see stat comment */
95 /* struct utimbuf uses time_t which might vary */
96 ENTRY_COMP(utime) /* 30 */
97 /* struct sockaddr... */
102 /* struct sockaddr... */
103 ENTRY_SAME(accept) /* 35 */
108 ENTRY_SAME(rmdir) /* 40 */
112 /* struct sockaddr... */
113 ENTRY_SAME(getsockname)
114 /* it seems possible brk() could return a >4G pointer... */
115 ENTRY_SAME(brk) /* 45 */
120 ENTRY_SAME(getegid) /* 50 */
123 /* struct sockaddr... */
124 ENTRY_SAME(getpeername)
126 ENTRY_COMP(fcntl) /* 55 */
127 ENTRY_SAME(socketpair)
131 ENTRY_SAME(umask) /* 60 */
136 ENTRY_SAME(getpgrp) /* 65 */
138 ENTRY_SAME(pivot_root)
139 /* I don't like this */
142 ENTRY_SAME(setreuid) /* 70 */
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... */
159 /* see stat comment */
161 ENTRY_SAME(readlink) /* 85 */
162 ENTRY_SAME(ni_syscall) /* was uselib */
166 ENTRY_SAME(mmap) /* 90 */
169 ENTRY_COMP(ftruncate)
171 ENTRY_SAME(fchown) /* 95 */
172 ENTRY_SAME(getpriority)
173 ENTRY_SAME(setpriority)
176 ENTRY_COMP(fstatfs) /* 100 */
178 ENTRY_SAME(ni_syscall) /* was socketcall */
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 */
188 ENTRY_SAME(getcwd) /* 110 */
191 ENTRY_SAME(vfork_wrapper)
192 /* struct rusage contains longs... */
194 ENTRY_SAME(swapoff) /* 115 */
199 ENTRY_SAME(clone_wrapper) /* 120 */
200 ENTRY_SAME(setdomainname)
202 /* struct sockaddr... */
204 /* struct timex contains longs */
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 */
218 ENTRY_SAME(sysfs) /* 135 */
219 ENTRY_OURS(personality)
220 ENTRY_SAME(ni_syscall) /* for afs_syscall */
223 /* I think this might work */
224 ENTRY_SAME(llseek) /* 140 */
226 /* it is POSSIBLE that select will be OK because even though fd_set
227 * contains longs, the macros and sizes are clever. */
231 /* struct iovec contains pointers */
232 ENTRY_COMP(readv) /* 145 */
235 ENTRY_SAME(fdatasync)
236 /* struct __sysctl_args is a mess */
238 ENTRY_SAME(mlock) /* 150 */
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)
253 ENTRY_SAME(setresuid)
254 ENTRY_SAME(getresuid) /* 165 */
255 ENTRY_COMP(sigaltstack)
256 ENTRY_SAME(ni_syscall) /* query_module */
258 /* structs contain pointers and an in_addr... */
259 ENTRY_SAME(ni_syscall) /* was nfsservctl */
260 ENTRY_SAME(setresgid) /* 170 */
261 ENTRY_SAME(getresgid)
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.
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)
283 ENTRY_SAME(semop) /* 185 */
288 ENTRY_SAME(msgget) /* 190 */
293 ENTRY_COMP(shmctl) /* 195 */
294 ENTRY_SAME(ni_syscall) /* streams1 */
295 ENTRY_SAME(ni_syscall) /* streams2 */
297 ENTRY_OURS(truncate64)
298 ENTRY_OURS(ftruncate64) /* 200 */
299 ENTRY_SAME(getdents64)
301 ENTRY_SAME(ni_syscall) /* attrctl -- dead */
302 ENTRY_SAME(ni_syscall) /* acl_get -- dead */
303 ENTRY_SAME(ni_syscall) /* 205 (acl_set -- dead) */
305 ENTRY_OURS(readahead)
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(ni_syscall) /* 220: was alloc_hugepages */
319 ENTRY_SAME(ni_syscall) /* was 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)
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)
337 ENTRY_SAME(lsetxattr)
338 ENTRY_SAME(fsetxattr) /* 240 */
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)
358 ENTRY_COMP(mbind) /* 260 */
359 ENTRY_COMP(get_mempolicy)
360 ENTRY_COMP(set_mempolicy)
361 ENTRY_SAME(ni_syscall) /* 263: reserved for vserver */
363 ENTRY_SAME(request_key) /* 265 */
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)
373 ENTRY_COMP(openat) /* 275 */
377 ENTRY_COMP(futimesat)
378 ENTRY_SAME(fstatat64) /* 280 */
382 ENTRY_SAME(symlinkat)
383 ENTRY_SAME(readlinkat) /* 285 */
385 ENTRY_SAME(faccessat)
387 ENTRY_COMP(set_robust_list)
388 ENTRY_COMP(get_robust_list) /* 290 */
390 ENTRY_OURS(sync_file_range)
393 ENTRY_COMP(move_pages) /* 295 */
395 ENTRY_COMP(epoll_pwait)
397 ENTRY_COMP(fstatfs64)
398 ENTRY_COMP(kexec_load) /* 300 */
399 ENTRY_COMP(utimensat)
401 ENTRY_SAME(ni_syscall) /* was timerfd */
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)
412 ENTRY_SAME(inotify_init1)
413 ENTRY_COMP(preadv) /* 315 */
415 ENTRY_COMP(rt_tgsigqueueinfo)
416 ENTRY_SAME(perf_event_open)
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)
428 ENTRY_COMP(process_vm_readv) /* 330 */
429 ENTRY_COMP(process_vm_writev)
431 ENTRY_SAME(finit_module)
432 ENTRY_SAME(sched_setattr)
433 ENTRY_SAME(sched_getattr) /* 335 */
435 ENTRY_SAME(renameat2)
437 ENTRY_SAME(getrandom)
438 ENTRY_SAME(memfd_create) /* 340 */
441 ENTRY_SAME(membarrier)
442 ENTRY_SAME(userfaultfd)
443 ENTRY_SAME(mlock2) /* 345 */
444 ENTRY_SAME(copy_file_range)
448 ENTRY_COMP(io_pgetevents) /* 350 */
451 .ifne (. - 90b) - (__NR_Linux_syscalls * (91b - 90b))
452 .error "size of syscall table does not fit value of __NR_Linux_syscalls"