xref: /netbsd-src/sys/compat/linux/arch/powerpc/syscalls.master (revision 7fa608457b817eca6e0977b37f758ae064f3c99c)
1	$NetBSD: syscalls.master,v 1.31 2007/03/04 06:01:22 christos Exp $
2
3;	@(#)syscalls.master	8.1 (Berkeley) 7/19/93
4
5; Derived from NetBSD's sys/compat/linux/arch/i386/syscalls.master
6; sys/compat/linux/arch/m68k/syscalls.master
7; and from Linux's arch/ppc/kernel/misc.S
8;
9; We have problems for a few syscalls, specially:
10; 142 ppc_select -> sys_new_select -> sys_select (Conflicts with 82 ???).
11;
12; Expect problems with the following, which have an architecture dependent
13; implementation in Linux/powerpc:
14; 29  pause
15; 42  pipe      tested. no problem.
16; 59  olduname
17; 101 ioperm
18; 109 uname
19; 117 ipc
20;
21; Most of syscalls after 182 that were introduced in Linux-2.4 are UNIMPL.
22;
23; The following are UNIMPL here. The Linux kernel implements them but just logs
24; a kernel error and returns -ENOSYS.
25; 110 iopl
26; 113 vm86
27; 123 modify_ldt
28; 198 sys_pciconfig_read
29; 199 sys_pciconfig_write
30; 200 sys_pciconfig_iobase
31;
32; Emmanuel Dreyfus <p99dreyf@criens.u-psud.fr>
33
34; NetBSD powerpc COMPAT_LINUX system call name/number "master" file.
35; (See syscalls.conf to see what it is processed into.)
36;
37; Fields: number type [type-dependent ...]
38;	number	system call number, must be in order
39;	type	one of STD, OBSOL, UNIMPL, NODEF, NOARGS, or one of
40;		the compatibility options defined in syscalls.conf.
41;
42; types:
43;	STD	always included
44;	OBSOL	obsolete, not included in system
45;	UNIMPL	unimplemented, not included in system
46;	NODEF	included, but don't define the syscall number
47;	NOARGS	included, but don't define the syscall args structure
48;	INDIR	included, but don't define the syscall args structure
49;		and allow it to be "really" varargs.
50;
51; The compat options are defined in the syscalls.conf file, and the
52; compat option name is prefixed to the syscall name.  Other than
53; that, they're like NODEF (for 'compat' options), or STD (for
54; 'libcompat' options).
55;
56; The type-dependent arguments are as follows:
57; For STD, NODEF, NOARGS, and compat syscalls:
58;	{ pseudo-proto } [alias]
59; For other syscalls:
60;	[comment]
61;
62; #ifdef's, etc. may be included, and are copied to the output files.
63; #include's are copied to the syscall names and switch definition files only.
64
65#if defined(_KERNEL_OPT)
66#include "opt_compat_netbsd.h"
67#include "opt_compat_43.h"
68#endif
69
70#include <sys/param.h>
71#include <sys/poll.h>
72#include <sys/systm.h>
73#include <sys/signal.h>
74#include <sys/mount.h>
75#include <sys/syscallargs.h>
76
77#include <compat/linux/common/linux_types.h>
78#include <compat/linux/common/linux_signal.h>
79#include <compat/linux/common/linux_siginfo.h>
80#include <compat/linux/common/linux_machdep.h>
81#include <compat/linux/common/linux_mmap.h>
82
83#include <compat/linux/linux_syscallargs.h>
84
85%%
86
870	NOARGS		{ int linux_sys_nosys(void); } syscall
881	NOARGS		{ int sys_exit(int rval); }
892	NOARGS		{ int sys_fork(void); }
903	NOARGS		{ int sys_read(int fd, char *buf, u_int nbyte); }
914	NOARGS		{ int sys_write(int fd, char *buf, u_int nbyte); }
925	STD		{ int linux_sys_open(const char *path, int flags, \
93			    int mode); }
946	NOARGS		{ int sys_close(int fd); }
957	STD		{ int linux_sys_waitpid(int pid, int *status, \
96			    int options);}
978	STD		{ int linux_sys_creat(const char *path, int mode); }
989	STD		{ int linux_sys_link(const char *path, const \
99			    char *link); }
10010	STD		{ int linux_sys_unlink(const char *path); }
10111	STD		{ int linux_sys_execve(const char *path, char **argp, \
102			    char **envp); }
10312	STD		{ int linux_sys_chdir(const char *path); }
10413	STD		{ int linux_sys_time(linux_time_t *t); }
10514	STD		{ int linux_sys_mknod(const char *path, int mode, \
106			    int dev); }
10715	STD		{ int linux_sys_chmod(const char *path, int mode); }
10816	STD		{ int linux_sys_lchown(const char *path, int uid, \
109			    int gid); }
11017	OBSOL		break
11118	OBSOL		ostat
11219	NOARGS		{ long compat_43_sys_lseek(int fd, long offset, \
113			    int whence); }
11420	NOARGS MPSAFE	{ pid_t sys_getpid(void); }
11521	UNIMPL		mount
11622	OBSOL		umount
11723	NOARGS		{ int sys_setuid(uid_t uid); }
11824	NOARGS		{ uid_t sys_getuid(void); }
11925	STD		{ int linux_sys_stime(linux_time_t *t); }
12026	STD		{ int linux_sys_ptrace(int request, int pid, \
121			    int addr, int data); }
12227	STD		{ int linux_sys_alarm(unsigned int secs); }
12328	OBSOL		ofstat
12429	STD		{ int linux_sys_pause(void); }
12530	STD		{ int linux_sys_utime(const char *path, \
126			    struct linux_utimbuf *times); }
12731	OBSOL		stty
12832	OBSOL		gtty
12933	STD		{ int linux_sys_access(const char *path, int flags); }
13034	STD		{ int linux_sys_nice(int incr); }
13135	OBSOL		ftime
13236	NOARGS		{ int sys_sync(void); }
13337	STD		{ int linux_sys_kill(int pid, int signum); }
13438	STD		{ int linux_sys_rename(const char *from, \
135			    const char *to); }
13639	STD		{ int linux_sys_mkdir(const char *path, int mode); }
13740	STD		{ int linux_sys_rmdir(const char *path); }
13841	NOARGS		{ int sys_dup(u_int fd); }
13942	STD		{ int linux_sys_pipe(int *pfds); }
14043	STD		{ int linux_sys_times(struct times *tms); }
14144	OBSOL		prof
14245	STD		{ int linux_sys_brk(char *nsize); }
14346	NOARGS		{ int sys_setgid(gid_t gid); }
14447	NOARGS		{ gid_t sys_getgid(void); }
14548	STD		{ int linux_sys_signal(int signum, \
146			    linux_handler_t handler); }
14749	NOARGS		{ uid_t sys_geteuid(void); }
14850	NOARGS		{ gid_t sys_getegid(void); }
14951	NOARGS		{ int sys_acct(char *path); }
15052	UNIMPL		umount
15153	OBSOL		lock
15254	STD		{ int linux_sys_ioctl(int fd, u_long com, \
153			    void *data); }
15455	STD		{ int linux_sys_fcntl(int fd, int cmd, void *arg); }
15556	OBSOL		mpx
15657	NOARGS		{ int sys_setpgid(int pid, int pgid); }
15758	OBSOL		ulimit
15859 	STD		{ int linux_sys_olduname(struct linux_old_utsname \
159			   *up); }
16060	NOARGS		{ int sys_umask(int newmask); }
16161	NOARGS		{ int sys_chroot(char *path); }
16262	UNIMPL		ustat
16363	NOARGS		{ int sys_dup2(u_int from, u_int to); }
16464	NOARGS		{ pid_t sys_getppid(void); }
16565	NOARGS		{ int sys_getpgrp(void); }
16666	NOARGS		{ int sys_setsid(void); }
16767	STD		{ int linux_sys_sigaction(int signum, \
168			    const struct linux_old_sigaction *nsa, \
169			    struct linux_old_sigaction *osa); }
17068	STD		{ int linux_sys_siggetmask(void); }
17169	STD		{ int linux_sys_sigsetmask(linux_old_sigset_t mask); }
17270	NOARGS		{ int sys_setreuid(uid_t ruid, uid_t euid); }
17371	NOARGS		{ int sys_setregid(gid_t rgid, gid_t egid); }
17472	STD		{ int linux_sys_sigsuspend(void *restart, \
175			    int oldmask, int mask); }
17673	STD		{ int linux_sys_sigpending(linux_old_sigset_t *set); }
17774	NOARGS		{ int compat_43_sys_sethostname(char *hostname, \
178			    u_int len);}
17975	STD		{ int linux_sys_setrlimit(u_int which, \
180			    struct orlimit *rlp); }
18176	STD		{ int linux_sys_getrlimit(u_int which, \
182			    struct orlimit *rlp); }
18377	NOARGS		{ int sys_getrusage(int who, struct rusage *rusage); }
18478	STD		{ int linux_sys_gettimeofday(struct timeval *tp, \
185			    struct timezone *tzp); }
18679	STD		{ int linux_sys_settimeofday(struct timeval *tp, \
187			    struct timezone *tzp); }
18880	NOARGS		{ int sys_getgroups(u_int gidsetsize, gid_t *gidset); }
18981	NOARGS		{ int sys_setgroups(u_int gidsetsize, gid_t *gidset); }
19082	STD		{ int linux_sys_select(int nfds, fd_set* readfds, \
191					fd_set* writefds, fd_set* exceptfds, \
192					struct timeval *timeout); }
19383	STD		{ int linux_sys_symlink(const char *path, \
194			    const char *to); }
19584	NOARGS		{ int compat_43_sys_lstat(const char *path, \
196			    struct stat43 *up); } oolstat
19785	STD		{ int linux_sys_readlink(const char *name, char *buf, \
198			    int count); }
199#ifdef EXEC_AOUT
20086	STD		{ int linux_sys_uselib(const char *path); }
201#else
20286	UNIMPL		sys_uselib
203#endif
20487	STD		{ int linux_sys_swapon(char *name); }
20588	STD		{ int linux_sys_reboot(int magic1, int magic2, \
206			    int cmd, void *arg); }
20789	STD		{ int linux_sys_readdir(int fd, void *dent, \
208			    unsigned int count); }
20990	NOARGS		{ int linux_sys_mmap(unsigned long addr, size_t len, \
210			    int prot, int flags, int fd, linux_off_t offset); }
21191	NOARGS		{ int sys_munmap(void *addr, int len); }
21292	STD		{ int linux_sys_truncate(const char *path, \
213			    long length); }
21493	NOARGS		{ int compat_43_sys_ftruncate(int fd, long length); }
21594	NOARGS		{ int sys_fchmod(int fd, int mode); }
21695	NOARGS		{ int sys___posix_fchown(int fd, int uid, int gid); }
21796	STD		{ int linux_sys_getpriority(int which, int who); }
21897	NOARGS		{ int sys_setpriority(int which, int who, int prio); }
21998	NOARGS		{ int sys_profil(void *samples, u_int size, \
220			    u_int offset, u_int scale); }
22199	STD		{ int linux_sys_statfs(const char *path, \
222			    struct linux_statfs *sp); }
223100	STD		{ int linux_sys_fstatfs(int fd, \
224			    struct linux_statfs *sp); }
225101	STD		{ int linux_sys_ioperm(unsigned int lo, \
226			    unsigned int hi, int val); }
227102	STD		{ int linux_sys_socketcall(int what, void *args); }
228103	UNIMPL		syslog
229104	NOARGS		{ int sys_setitimer(u_int which, \
230			    struct itimerval *itv, struct itimerval *oitv); }
231105	NOARGS		{ int sys_getitimer(u_int which, \
232			    struct itimerval *itv); }
233106	STD		{ int linux_sys_stat(const char *path, \
234			    struct linux_stat *sp); }
235107	STD		{ int linux_sys_lstat(const char *path, \
236			    struct linux_stat *sp); }
237108	STD		{ int linux_sys_fstat(int fd, struct linux_stat *sp); }
238109	STD		{ int linux_sys_uname(struct linux_utsname *up); }
239110	UNIMPL		iopl
240111	UNIMPL		vhangup
241112	UNIMPL		idle
242113	UNIMPL		vm86old
243114	STD		{ int linux_sys_wait4(int pid, int *status, \
244			    int options, struct rusage *rusage); }
245115	STD		{ int linux_sys_swapoff(const char *path); }
246116	STD		{ int linux_sys_sysinfo(struct linux_sysinfo *arg); }
247117	STD		{ int linux_sys_ipc(int what, int a1, int a2, int a3, \
248			    void *ptr); }
249118	NOARGS		{ int sys_fsync(int fd); }
250119	STD		{ int linux_sys_sigreturn(struct linux_sigcontext *scp); }
251120	STD		{ int linux_sys_clone(int flags, void *stack); }
252121	STD		{ int linux_sys_setdomainname(char *domainname, \
253			    int len); }
254122	STD		{ int linux_sys_new_uname(struct linux_utsname *up); }
255123	UNIMPL		modify_ldt
256124	UNIMPL		adjtimex
257125	STD		{ int linux_sys_mprotect(const void *start, \
258			    unsigned long len, int prot); }
259126	STD		{ int linux_sys_sigprocmask(int how, \
260			    const linux_old_sigset_t *set, \
261			    linux_old_sigset_t *oset); }
262127	UNIMPL		create_module
263128	UNIMPL		init_module
264129	UNIMPL		delete_module
265130	UNIMPL		get_kernel_syms
266131	UNIMPL		quotactl
267132	STD		{ int linux_sys_getpgid(int pid); }
268133	NOARGS		{ int sys_fchdir(int fd); }
269134	UNIMPL		bdflush
270135	UNIMPL		sysfs
271136	STD		{ int linux_sys_personality(int per); }
272137	UNIMPL		afs_syscall
273138	STD		{ int linux_sys_setfsuid(uid_t uid); }
274139	NOARGS		{ int linux_sys_getfsuid(void); }
275140	STD		{ int linux_sys_llseek(int fd, u_int32_t ohigh, \
276			    u_int32_t olow, void *res, int whence); }
277141	STD		{ int linux_sys_getdents(int fd, \
278			    struct linux_dirent *dent, unsigned int count); }
279142	STD		{ int linux_sys_new_select(int nfds, fd_set *readfds, \
280			    fd_set *writefds, fd_set *exceptfds, \
281			    struct timeval *timeout); }
282143	NOARGS		{ int sys_flock(int fd, int how); }
283144	STD		{ int linux_sys_msync(void *addr, int len, int fl); }
284145	NOARGS		{ int sys_readv(int fd, struct iovec *iovp, \
285				u_int iovcnt); }
286146	NOARGS		{ int sys_writev(int fd, struct iovec *iovp, \
287				u_int iovcnt); }
288147	NOARGS		{ pid_t sys_getsid(pid_t pid); }
289148	STD		{ int linux_sys_fdatasync(int fd); }
290149	STD		{ int linux_sys___sysctl(struct linux___sysctl *lsp); }
291150	NOARGS		{ int sys_mlock(void *addr, size_t len); }
292151	NOARGS		{ int sys_munlock(void *addr, size_t len); }
293152	NOARGS		{ int sys_mlockall(int flags); }
294153	NOARGS		{ int sys_munlockall(void); }
295154	STD		{ int linux_sys_sched_setparam(pid_t pid, \
296			    const struct linux_sched_param *sp); }
297155	STD		{ int linux_sys_sched_getparam(pid_t pid, \
298			    struct linux_sched_param *sp); }
299156	STD		{ int linux_sys_sched_setscheduler(pid_t pid, \
300			    int policy, const struct linux_sched_param *sp); }
301157	STD		{ int linux_sys_sched_getscheduler(pid_t pid); }
302158	STD		{ int linux_sys_sched_yield(void); }
303159	STD		{ int linux_sys_sched_get_priority_max(int policy); }
304160	STD		{ int linux_sys_sched_get_priority_min(int policy); }
305161	UNIMPL		sched_rr_get_interval
306162	NOARGS		{ int sys_nanosleep(const struct timespec *rqtp, \
307				struct timespec *rmtp); }
308163	STD		{ void *linux_sys_mremap(void *old_address, \
309			    size_t old_size, size_t new_size, u_long flags); }
310164	STD		{ int linux_sys_setresuid(uid_t ruid, uid_t euid, \
311			    uid_t suid); }
312165	STD		{ int linux_sys_getresuid(uid_t *ruid, uid_t *euid, \
313			    uid_t *suid); }
314166	UNIMPL		query_module
315167	NOARGS		{ int sys_poll(struct pollfd *fds, u_int nfds, \
316			    int timeout); }
317168	UNIMPL		nfsservctl
318169	STD		{ int linux_sys_setresgid(gid_t rgid, gid_t egid, \
319			    gid_t sgid); }
320170	STD		{ int linux_sys_getresgid(gid_t *rgid, gid_t *egid, \
321			    gid_t *sgid); }
322171	UNIMPL		prctl
323172	STD		{ int linux_sys_rt_sigreturn( \
324			    struct linux_rt_sigframe *sfp); }
325173	STD		{ int linux_sys_rt_sigaction(int signum, \
326			    const struct linux_sigaction *nsa, \
327			    struct linux_sigaction *osa, \
328			    size_t sigsetsize); }
329174	STD		{ int linux_sys_rt_sigprocmask(int how, \
330			    const linux_sigset_t *set, \
331			    linux_sigset_t *oset, \
332			    size_t sigsetsize); }
333175	STD		{ int linux_sys_rt_sigpending( \
334			    linux_sigset_t *set, \
335			    size_t sigsetsize); }
336176	UNIMPL		rt_sigtimedwait
337; XXX XAX int here?  sigset_t here?  siginfo_t
338177	STD		{ int linux_sys_rt_queueinfo(int pid, int signum, \
339			    void *uinfo); }
340178	STD		{ int linux_sys_rt_sigsuspend(linux_sigset_t *unewset, \
341			    size_t sigsetsize); }
342179	STD		{ int linux_sys_pread(int fd, char *buf, \
343			    size_t nbyte, linux_off_t offset); }
344180	STD		{ int linux_sys_pwrite(int fd, char *buf, \
345			    size_t nbyte, linux_off_t offset); }
346181	STD		{ int linux_sys_chown(const char *path, \
347			    int uid, int gid); }
348182	NOARGS		{ int sys___getcwd(char *bufp, size_t length); }
349183	UNIMPL		capget
350184	UNIMPL		capset
351185	STD		{ int linux_sys_sigaltstack( \
352			    const struct linux_sigaltstack *ss, \
353			    struct linux_sigaltstack *oss); }
354186	UNIMPL		sendfile
355187	UNIMPL		getpmsg
356188	UNIMPL		putpmsg
357189	NOARGS		{ int sys___vfork14(void); }
358190	STD		{ int linux_sys_ugetrlimit(int which, \
359			    struct rlimit *rlp); }
360191	UNIMPL		/* unused */
361192	NOARGS		{ linux_off_t linux_sys_mmap2(unsigned long addr, \
362			    size_t len, int prot, int flags, int fd, \
363			    linux_off_t offset); }
364193	STD		{ int linux_sys_truncate64(const char *path, \
365			    off_t length); }
366194	STD		{ int linux_sys_ftruncate64(unsigned int fd, \
367			    off_t length); }
368195	STD		{ int linux_sys_stat64(const char *path, \
369			    struct linux_stat64 *sp); }
370196	STD		{ int linux_sys_lstat64(const char *path, \
371			    struct linux_stat64 *sp); }
372197	STD		{ int linux_sys_fstat64(int fd, \
373			    struct linux_stat64 *sp); }
374198	UNIMPL		sys_pciconfig_read
375199	UNIMPL		sys_pciconfig_write
376200	UNIMPL		sys_pciconfig_iobase
377201	UNIMPL		/* Unused (MacOnLinux project) */
378202	STD		{ int linux_sys_getdents64(int fd, \
379			    struct linux_dirent64 *dent, unsigned int count); }
380203	UNIMPL		pivot_root
381204	STD		{ int linux_sys_fcntl64(int fd, int cmd, void *arg); }
382205	NOARGS		{ int sys_mincore(void *addr, size_t len, char *vec); }
383206	NOARGS		{ int sys_madvise(void *addr, size_t len, int behav); }
384207	UNIMPL		gettid
385208	UNIMPL		tkill
386209	STD		{ int linux_sys_setxattr(char *path, char *name, \
387			    void *value, size_t size, int flags); }
388210	STD		{ int linux_sys_lsetxattr(char *path, char *name, \
389			    void *value, size_t size, int flags); }
390211	STD		{ int linux_sys_fsetxattr(int fd, char *name, \
391			    void *value, size_t size, int flags); }
392212	STD		{ ssize_t linux_sys_getxattr(char *path, char *name, \
393			    void *value, size_t size); }
394213	STD		{ ssize_t linux_sys_lgetxattr(char *path, char *name, \
395			    void *value, size_t size); }
396214	STD		{ ssize_t linux_sys_fgetxattr(int fd, char *name, \
397			    void *value, size_t size); }
398215	STD		{ ssize_t linux_sys_listxattr(char *path, char *list, \
399			    size_t size); }
400216	STD		{ ssize_t linux_sys_llistxattr(char *path, char *list, \
401			    size_t size); }
402217	STD		{ ssize_t linux_sys_flistxattr(int fd, char *list, \
403			    size_t size); }
404218	STD		{ int linux_sys_removexattr(char *path, char *name); }
405219	STD		{ int linux_sys_lremovexattr(char *path, char *name); }
406220	STD		{ int linux_sys_fremovexattr(int fd, char *name); }
407221	UNIMPL		futex
408222	UNIMPL		sched_setaffinity
409223	UNIMPL		sched_getaffinity
410224	UNIMPL		/* unused */
411225	UNIMPL		tuxcall
412226	UNIMPL		sendfile64
413227	UNIMPL		io_setup
414228	UNIMPL		io_destroy
415229	UNIMPL		io_getevents
416230	UNIMPL		io_submit
417231	UNIMPL		io_cancel
418232	UNIMPL		set_tid_address
419233	UNIMPL		fadvise64
420234	STD		{ int linux_sys_exit_group(int error_code); }
421235	UNIMPL		lookup_dcookie
422236	UNIMPL		epoll_create
423237	UNIMPL		epoll_ctl
424238	UNIMPL		epoll_wait
425239	UNIMPL		remap_file_pages
426240	UNIMPL		timer_create
427241	UNIMPL		timer_settime
428242	UNIMPL		timer_gettime
429243	UNIMPL		timer_getoverrun
430244	UNIMPL		timer_delete
431245	STD		{ int linux_sys_clock_settime(clockid_t which, \
432			    struct linux_timespec *tp); }
433246	STD		{ int linux_sys_clock_gettime(clockid_t which, \
434			    struct linux_timespec *tp); }
435247	STD		{ int linux_sys_clock_getres(clockid_t which, \
436			    struct linux_timespec *tp); }
437248	STD		{ int linux_sys_clock_nanosleep(clockid_t which, \
438			    int flags, struct linux_timespec *rqtp, \
439			    struct linux_timespec *rmtp); }
440249	UNIMPL		swapcontext
441250	UNIMPL		tgkill
442251	UNIMPL		utimes
443252	STD		{ int linux_sys_statfs64(const char *path, \
444			    size_t sz, struct linux_statfs64 *sp); }
445253	STD		{ int linux_sys_fstatfs64(int fd, \
446			    size_t sz, struct linux_statfs64 *sp); }
447254	UNIMPL		fadvise64_64
448255	UNIMPL		rtas
449256	UNIMPL		/* reserved for sys_debug_setcontext */
450257	UNIMPL		/* reserved for vserver */
451258	UNIMPL		/* reserved for new sys_remap_file_pages */
452259	UNIMPL		/* reserved for new sys_mbind */
453260	UNIMPL		/* reserved for new sys_get_mempolicy */
454261	UNIMPL		/* reserved for new sys_set_mempolicy */
455262	UNIMPL		mq_open
456263	UNIMPL		mq_unlink
457264	UNIMPL		mq_timedsend
458265	UNIMPL		mq_timedreceive
459266	UNIMPL		mq_notify
460267	UNIMPL		mq_getsetattr
461268	UNIMPL		kexec_load
462