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 compatability 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 ENTRY_SAME(restart_syscall) /* 0 */
60 ENTRY_SAME(fork_wrapper)
63 ENTRY_SAME(open) /* 5 */
68 ENTRY_SAME(unlink) /* 10 */
69 ENTRY_DIFF(execve_wrapper)
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_SAME(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 /* These 2 would've worked if someone had defined struct timespec
251 * carefully, like timeval for example (which is about the same).
252 * Unfortunately it contains a long :-( */
253 ENTRY_DIFF(sched_rr_get_interval)
254 ENTRY_COMP(nanosleep)
256 ENTRY_SAME(setresuid)
257 ENTRY_SAME(getresuid) /* 165 */
258 ENTRY_DIFF(sigaltstack_wrapper)
259 ENTRY_SAME(ni_syscall) /* query_module */
261 /* structs contain pointers and an in_addr... */
262 ENTRY_COMP(nfsservctl)
263 ENTRY_SAME(setresgid) /* 170 */
264 ENTRY_SAME(getresgid)
266 /* signals need a careful review */
267 ENTRY_SAME(rt_sigreturn_wrapper)
268 ENTRY_DIFF(rt_sigaction)
269 ENTRY_DIFF(rt_sigprocmask) /* 175 */
270 ENTRY_DIFF(rt_sigpending)
271 ENTRY_COMP(rt_sigtimedwait)
272 /* even though the struct siginfo_t is different, it appears like
273 * all the paths use values which should be same wide and narrow.
274 * Also the struct is padded to 128 bytes which means we don't have
275 * to worry about faulting trying to copy in a larger 64-bit
276 * struct from a 32-bit user-space app.
278 ENTRY_COMP(rt_sigqueueinfo)
279 ENTRY_COMP(rt_sigsuspend)
280 ENTRY_SAME(chown) /* 180 */
281 /* setsockopt() used by iptables: SO_SET_REPLACE/SO_SET_ADD_COUNTERS */
282 ENTRY_COMP(setsockopt)
283 ENTRY_COMP(getsockopt)
286 ENTRY_SAME(semop) /* 185 */
291 ENTRY_SAME(msgget) /* 190 */
296 ENTRY_SAME(shmctl) /* 195 */
297 ENTRY_SAME(ni_syscall) /* streams1 */
298 ENTRY_SAME(ni_syscall) /* streams2 */
300 ENTRY_OURS(truncate64)
301 ENTRY_OURS(ftruncate64) /* 200 */
302 ENTRY_SAME(getdents64)
304 ENTRY_SAME(ni_syscall) /* attrctl -- dead */
305 ENTRY_SAME(ni_syscall) /* acl_get -- dead */
306 ENTRY_SAME(ni_syscall) /* 205 (acl_set -- dead) */
308 ENTRY_OURS(readahead)
310 ENTRY_SAME(sendfile64)
311 ENTRY_COMP(futex) /* 210 */
312 ENTRY_COMP(sched_setaffinity)
313 ENTRY_COMP(sched_getaffinity)
314 ENTRY_SAME(ni_syscall) /* set_thread_area */
315 ENTRY_SAME(ni_syscall) /* get_thread_area */
316 ENTRY_SAME(io_setup) /* 215 */
317 ENTRY_SAME(io_destroy)
318 ENTRY_SAME(io_getevents)
319 ENTRY_SAME(io_submit)
320 ENTRY_SAME(io_cancel)
321 ENTRY_SAME(alloc_hugepages) /* 220 */
322 ENTRY_SAME(free_hugepages)
323 ENTRY_SAME(exit_group)
324 ENTRY_DIFF(lookup_dcookie)
325 ENTRY_SAME(epoll_create)
326 ENTRY_SAME(epoll_ctl) /* 225 */
327 ENTRY_SAME(epoll_wait)
328 ENTRY_SAME(remap_file_pages)
329 ENTRY_SAME(semtimedop)
331 ENTRY_SAME(mq_unlink) /* 230 */
332 ENTRY_SAME(mq_timedsend)
333 ENTRY_SAME(mq_timedreceive)
334 ENTRY_SAME(mq_notify)
335 ENTRY_SAME(mq_getsetattr)
336 ENTRY_COMP(waitid) /* 235 */
337 ENTRY_OURS(fadvise64_64)
338 ENTRY_SAME(set_tid_address)
340 ENTRY_SAME(lsetxattr)
341 ENTRY_SAME(fsetxattr) /* 240 */
343 ENTRY_SAME(lgetxattr)
344 ENTRY_SAME(fgetxattr)
345 ENTRY_SAME(listxattr)
346 ENTRY_SAME(llistxattr) /* 245 */
347 ENTRY_SAME(flistxattr)
348 ENTRY_SAME(removexattr)
349 ENTRY_SAME(lremovexattr)
350 ENTRY_SAME(fremovexattr)
351 ENTRY_COMP(timer_create) /* 250 */
352 ENTRY_COMP(timer_settime)
353 ENTRY_COMP(timer_gettime)
354 ENTRY_SAME(timer_getoverrun)
355 ENTRY_SAME(timer_delete)
356 ENTRY_COMP(clock_settime) /* 255 */
357 ENTRY_COMP(clock_gettime)
358 ENTRY_COMP(clock_getres)
359 ENTRY_COMP(clock_nanosleep)
361 ENTRY_COMP(mbind) /* 260 */
362 ENTRY_COMP(get_mempolicy)
363 ENTRY_COMP(set_mempolicy)
364 ENTRY_SAME(ni_syscall) /* 263: reserved for vserver */
366 ENTRY_SAME(request_key) /* 265 */
368 ENTRY_SAME(ioprio_set)
369 ENTRY_SAME(ioprio_get)
370 ENTRY_SAME(inotify_init)
371 ENTRY_SAME(inotify_add_watch) /* 270 */
372 ENTRY_SAME(inotify_rm_watch)
373 ENTRY_SAME(migrate_pages)
376 ENTRY_COMP(openat) /* 275 */
380 ENTRY_COMP(futimesat)
381 ENTRY_SAME(fstatat64) /* 280 */
385 ENTRY_SAME(symlinkat)
386 ENTRY_SAME(readlinkat) /* 285 */
388 ENTRY_SAME(faccessat)
390 ENTRY_COMP(set_robust_list)
391 ENTRY_COMP(get_robust_list) /* 290 */
393 ENTRY_OURS(sync_file_range)
396 ENTRY_COMP(move_pages) /* 295 */
398 ENTRY_SAME(epoll_pwait)
400 ENTRY_COMP(fstatfs64)
401 ENTRY_COMP(kexec_load) /* 300 */
402 ENTRY_COMP(utimensat)
404 ENTRY_SAME(ni_syscall) /* was timerfd */
406 ENTRY_COMP(fallocate) /* 305 */
407 ENTRY_SAME(timerfd_create)
408 ENTRY_COMP(timerfd_settime)
409 ENTRY_COMP(timerfd_gettime)
410 ENTRY_COMP(signalfd4)
411 ENTRY_SAME(eventfd2) /* 310 */
412 ENTRY_SAME(epoll_create1)
415 ENTRY_SAME(inotify_init1)