NetBSD-5.0.2/sys/compat/linux/arch/powerpc/syscalls.master

	$NetBSD: syscalls.master,v 1.37.12.1 2008/11/20 03:03:05 snj Exp $  

;	@(#)syscalls.master	8.1 (Berkeley) 7/19/93

; Derived from NetBSD's sys/compat/linux/arch/i386/syscalls.master
; sys/compat/linux/arch/m68k/syscalls.master
; and from Linux's arch/ppc/kernel/misc.S
;
; We have problems for a few syscalls, specially:
; 142 ppc_select -> sys_new_select -> sys_select (Conflicts with 82 ???).
;
; Expect problems with the following, which have an architecture dependent
; implementation in Linux/powerpc:
; 29  pause
; 42  pipe      tested. no problem.
; 59  olduname
; 101 ioperm
; 109 uname
; 117 ipc
;
; Most of syscalls after 182 that were introduced in Linux-2.4 are UNIMPL.
;
; The following are UNIMPL here. The Linux kernel implements them but just logs
; a kernel error and returns -ENOSYS.
; 110 iopl
; 113 vm86
; 123 modify_ldt
; 198 sys_pciconfig_read
; 199 sys_pciconfig_write
; 200 sys_pciconfig_iobase
;
; Emmanuel Dreyfus <p99dreyf@criens.u-psud.fr>

; NetBSD powerpc COMPAT_LINUX system call name/number "master" file.
; (See syscalls.conf to see what it is processed into.)
;
; Fields: number type [type-dependent ...]
;	number	system call number, must be in order
;	type	one of STD, OBSOL, UNIMPL, NODEF, NOARGS, or one of
;		the compatibility options defined in syscalls.conf.
;
; types:
;	STD	always included
;	OBSOL	obsolete, not included in system
;	UNIMPL	unimplemented, not included in system
;	NODEF	included, but don't define the syscall number
;	NOARGS	included, but don't define the syscall args structure
;	INDIR	included, but don't define the syscall args structure
;		and allow it to be "really" varargs.
;
; The compat options are defined in the syscalls.conf file, and the
; compat option name is prefixed to the syscall name.  Other than
; that, they're like NODEF (for 'compat' options), or STD (for
; 'libcompat' options).
;
; The type-dependent arguments are as follows:
; For STD, NODEF, NOARGS, and compat syscalls:
;	{ pseudo-proto } [alias]
; For other syscalls:
;	[comment]
;
; #ifdef's, etc. may be included, and are copied to the output files.
; #include's are copied to the syscall names and switch definition files only.

#if defined(_KERNEL_OPT)
#include "opt_compat_netbsd.h"
#include "opt_compat_43.h"
#endif

#include <sys/param.h>
#include <sys/poll.h>
#include <sys/systm.h>
#include <sys/signal.h>
#include <sys/mount.h>
#include <sys/syscallargs.h>

#include <compat/linux/common/linux_types.h>
#include <compat/linux/common/linux_signal.h>
#include <compat/linux/common/linux_siginfo.h>
#include <compat/linux/common/linux_machdep.h>
#include <compat/linux/common/linux_mmap.h>

#include <compat/linux/linux_syscallargs.h>

%%

0	NOARGS		{ int linux_sys_nosys(void); } syscall
1	NOARGS		{ int sys_exit(int rval); }
2	NOARGS		{ int sys_fork(void); }
3	NOARGS		{ int sys_read(int fd, char *buf, u_int nbyte); }
4	NOARGS		{ int sys_write(int fd, char *buf, u_int nbyte); }
5	STD		{ int linux_sys_open(const char *path, int flags, \
			    int mode); }
6	NOARGS		{ int sys_close(int fd); }
7	STD		{ int linux_sys_waitpid(int pid, int *status, \
			    int options);}
8	STD		{ int linux_sys_creat(const char *path, int mode); }
9	NOARGS		{ int sys_link(const char *path, const char *link); }
10	STD		{ int linux_sys_unlink(const char *path); }
11	NOARGS		{ int sys_execve(const char *path, char **argp, \
			    char **envp); }
12	NOARGS		{ int sys_chdir(const char *path); }
13	STD		{ int linux_sys_time(linux_time_t *t); }
14	STD		{ int linux_sys_mknod(const char *path, int mode, \
			    int dev); }
15	NOARGS		{ int sys_chmod(const char *path, int mode); }
16	NOARGS		{ int sys___posix_lchown(const char *path, int uid, \
			    int gid); }
17	OBSOL		break
18	OBSOL		ostat
19	NOARGS		{ long compat_43_sys_lseek(int fd, long offset, \
			    int whence); }
20	NOARGS 		{ pid_t sys_getpid(void); }
21	UNIMPL		mount
22	OBSOL		umount
23	NOARGS		{ int sys_setuid(uid_t uid); }
24	NOARGS		{ uid_t sys_getuid(void); }
25	STD		{ int linux_sys_stime(linux_time_t *t); }
26	STD		{ int linux_sys_ptrace(int request, int pid, \
			    int addr, int data); }
27	STD		{ int linux_sys_alarm(unsigned int secs); }
28	OBSOL		ofstat
29	STD		{ int linux_sys_pause(void); }
30	STD		{ int linux_sys_utime(const char *path, \
			    struct linux_utimbuf *times); }
31	OBSOL		stty
32	OBSOL		gtty
33	NOARGS		{ int sys_access(const char *path, int flags); }
34	STD		{ int linux_sys_nice(int incr); }
35	OBSOL		ftime
36	NOARGS		{ int sys_sync(void); }
37	STD		{ int linux_sys_kill(int pid, int signum); }
38	NOARGS		{ int sys___posix_rename(const char *from, \
			    const char *to); }
39	NOARGS		{ int sys_mkdir(const char *path, int mode); }
40	NOARGS		{ int sys_rmdir(const char *path); }
41	NOARGS		{ int sys_dup(u_int fd); }
42	STD		{ int linux_sys_pipe(int *pfds); }
43	STD		{ int linux_sys_times(struct times *tms); }
44	OBSOL		prof
45	STD		{ int linux_sys_brk(char *nsize); }
46	NOARGS		{ int sys_setgid(gid_t gid); }
47	NOARGS		{ gid_t sys_getgid(void); }
48	STD		{ int linux_sys_signal(int signum, \
			    linux_handler_t handler); }
49	NOARGS		{ uid_t sys_geteuid(void); }
50	NOARGS		{ gid_t sys_getegid(void); }
51	NOARGS		{ int sys_acct(char *path); }
52	UNIMPL		umount
53	OBSOL		lock
54	STD		{ int linux_sys_ioctl(int fd, u_long com, \
			    void *data); }
55	STD		{ int linux_sys_fcntl(int fd, int cmd, void *arg); }
56	OBSOL		mpx
57	NOARGS		{ int sys_setpgid(int pid, int pgid); }
58	OBSOL		ulimit
59 	STD		{ int linux_sys_olduname(struct linux_old_utsname \
			   *up); }
60	NOARGS		{ int sys_umask(int newmask); }
61	NOARGS		{ int sys_chroot(char *path); }
62	UNIMPL		ustat
63	NOARGS		{ int sys_dup2(u_int from, u_int to); }
64	NOARGS		{ pid_t sys_getppid(void); }
65	NOARGS		{ int sys_getpgrp(void); }
66	NOARGS		{ int sys_setsid(void); }
67	STD		{ int linux_sys_sigaction(int signum, \
			    const struct linux_old_sigaction *nsa, \
			    struct linux_old_sigaction *osa); }
68	STD		{ int linux_sys_siggetmask(void); }
69	STD		{ int linux_sys_sigsetmask(linux_old_sigset_t mask); }
70	NOARGS		{ int sys_setreuid(uid_t ruid, uid_t euid); }
71	NOARGS		{ int sys_setregid(gid_t rgid, gid_t egid); }
72	STD		{ int linux_sys_sigsuspend(void *restart, \
			    int oldmask, int mask); }
73	STD		{ int linux_sys_sigpending(linux_old_sigset_t *set); }
74	NOARGS		{ int compat_43_sys_sethostname(char *hostname, \
			    u_int len);}
75	STD		{ int linux_sys_setrlimit(u_int which, \
			    struct orlimit *rlp); }
76	STD		{ int linux_sys_getrlimit(u_int which, \
			    struct orlimit *rlp); }
77	NOARGS		{ int sys_getrusage(int who, struct rusage *rusage); }
78	STD		{ int linux_sys_gettimeofday(struct timeval *tp, \
			    struct timezone *tzp); }
79	STD		{ int linux_sys_settimeofday(struct timeval *tp, \
			    struct timezone *tzp); }
80	NOARGS		{ int sys_getgroups(u_int gidsetsize, gid_t *gidset); }
81	NOARGS		{ int sys_setgroups(u_int gidsetsize, gid_t *gidset); }
82	STD		{ int linux_sys_select(int nfds, fd_set* readfds, \
					fd_set* writefds, fd_set* exceptfds, \
					struct timeval *timeout); }
83	NOARGS		{ int sys_symlink(const char *path, const char *to); }
84	NOARGS		{ int compat_43_sys_lstat(const char *path, \
			    struct stat43 *up); } oolstat
85	NOARGS		{ int sys_readlink(const char *name, char *buf, \
			    int count); }
#ifdef EXEC_AOUT
86	STD		{ int linux_sys_uselib(const char *path); }
#else
86	UNIMPL		sys_uselib
#endif
87	STD		{ int linux_sys_swapon(char *name); }
88	STD		{ int linux_sys_reboot(int magic1, int magic2, \
			    int cmd, void *arg); }
89	STD		{ int linux_sys_readdir(int fd, void *dent, \
			    unsigned int count); }
90	NOARGS		{ int linux_sys_mmap(unsigned long addr, size_t len, \
			    int prot, int flags, int fd, linux_off_t offset); }
91	NOARGS		{ int sys_munmap(void *addr, int len); }
92	NOARGS		{ int compat_43_sys_truncate(const char *path, \
			    long length); }
93	NOARGS		{ int compat_43_sys_ftruncate(int fd, long length); }
94	NOARGS		{ int sys_fchmod(int fd, int mode); }
95	NOARGS		{ int sys___posix_fchown(int fd, int uid, int gid); }
96	STD		{ int linux_sys_getpriority(int which, int who); }
97	NOARGS		{ int sys_setpriority(int which, int who, int prio); }
98	NOARGS		{ int sys_profil(void *samples, u_int size, \
			    u_int offset, u_int scale); }
99	STD		{ int linux_sys_statfs(const char *path, \
			    struct linux_statfs *sp); }
100	STD		{ int linux_sys_fstatfs(int fd, \
			    struct linux_statfs *sp); }
101	STD		{ int linux_sys_ioperm(unsigned int lo, \
			    unsigned int hi, int val); }
102	STD		{ int linux_sys_socketcall(int what, void *args); }
103	UNIMPL		syslog
104	NOARGS		{ int sys_setitimer(u_int which, \
			    struct itimerval *itv, struct itimerval *oitv); }
105	NOARGS		{ int sys_getitimer(u_int which, \
			    struct itimerval *itv); }
106	STD		{ int linux_sys_stat(const char *path, \
			    struct linux_stat *sp); }
107	STD		{ int linux_sys_lstat(const char *path, \
			    struct linux_stat *sp); }
108	STD		{ int linux_sys_fstat(int fd, struct linux_stat *sp); }
109	STD		{ int linux_sys_uname(struct linux_utsname *up); }
110	UNIMPL		iopl
111	UNIMPL		vhangup
112	UNIMPL		idle
113	UNIMPL		vm86old
114	STD		{ int linux_sys_wait4(int pid, int *status, \
			    int options, struct rusage *rusage); }
115	STD		{ int linux_sys_swapoff(const char *path); }
116	STD		{ int linux_sys_sysinfo(struct linux_sysinfo *arg); }
117	STD		{ int linux_sys_ipc(int what, int a1, int a2, int a3, \
			    void *ptr); }
118	NOARGS		{ int sys_fsync(int fd); }
119	STD		{ int linux_sys_sigreturn(struct linux_sigcontext *scp); }
120	STD		{ int linux_sys_clone(int flags, void *stack); }
121	STD		{ int linux_sys_setdomainname(char *domainname, \
			    int len); }
122	STD		{ int linux_sys_new_uname(struct linux_utsname *up); }
123	UNIMPL		modify_ldt
124	UNIMPL		adjtimex
125	STD		{ int linux_sys_mprotect(const void *start, \
			    unsigned long len, int prot); }
126	STD		{ int linux_sys_sigprocmask(int how, \
			    const linux_old_sigset_t *set, \
			    linux_old_sigset_t *oset); }
127	UNIMPL		create_module
128	UNIMPL		init_module
129	UNIMPL		delete_module
130	UNIMPL		get_kernel_syms
131	UNIMPL		quotactl
132	NOARGS		{ pid_t sys_getpgid(pid_t pid); }
133	NOARGS		{ int sys_fchdir(int fd); }
134	UNIMPL		bdflush
135	UNIMPL		sysfs
136	STD		{ int linux_sys_personality(int per); }
137	UNIMPL		afs_syscall
138	STD		{ int linux_sys_setfsuid(uid_t uid); }
139	STD		{ int linux_sys_setfsgid(gid_t gid); }
140	STD		{ int linux_sys_llseek(int fd, u_int32_t ohigh, \
			    u_int32_t olow, void *res, int whence); }
141	STD		{ int linux_sys_getdents(int fd, \
			    struct linux_dirent *dent, unsigned int count); }
142	STD		{ int linux_sys_new_select(int nfds, fd_set *readfds, \
			    fd_set *writefds, fd_set *exceptfds, \
			    struct timeval *timeout); }
143	NOARGS		{ int sys_flock(int fd, int how); }
144	NOARGS		{ int sys___msync13(void *addr, size_t len, int flags); }
145	NOARGS		{ int sys_readv(int fd, struct iovec *iovp, \
				u_int iovcnt); }
146	NOARGS		{ int sys_writev(int fd, struct iovec *iovp, \
				u_int iovcnt); }
147	NOARGS		{ pid_t sys_getsid(pid_t pid); }
148	STD		{ int linux_sys_fdatasync(int fd); }
149	STD		{ int linux_sys___sysctl(struct linux___sysctl *lsp); }
150	NOARGS		{ int sys_mlock(void *addr, size_t len); }
151	NOARGS		{ int sys_munlock(void *addr, size_t len); }
152	NOARGS		{ int sys_mlockall(int flags); }
153	NOARGS		{ int sys_munlockall(void); }
154	STD		{ int linux_sys_sched_setparam(pid_t pid, \
			    const struct linux_sched_param *sp); }
155	STD		{ int linux_sys_sched_getparam(pid_t pid, \
			    struct linux_sched_param *sp); }
156	STD		{ int linux_sys_sched_setscheduler(pid_t pid, \
			    int policy, const struct linux_sched_param *sp); }
157	STD		{ int linux_sys_sched_getscheduler(pid_t pid); }
158	STD		{ int linux_sys_sched_yield(void); }
159	STD		{ int linux_sys_sched_get_priority_max(int policy); }
160	STD		{ int linux_sys_sched_get_priority_min(int policy); }
161	UNIMPL		sched_rr_get_interval
162	STD		{ int linux_sys_nanosleep( \
			    const struct linux_timespec *rqtp, \
			    struct linux_timespec *rmtp); }
163	STD		{ void *linux_sys_mremap(void *old_address, \
			    size_t old_size, size_t new_size, u_long flags); }
164	STD		{ int linux_sys_setresuid(uid_t ruid, uid_t euid, \
			    uid_t suid); }
165	STD		{ int linux_sys_getresuid(uid_t *ruid, uid_t *euid, \
			    uid_t *suid); }
166	UNIMPL		query_module
167	NOARGS		{ int sys_poll(struct pollfd *fds, u_int nfds, \
			    int timeout); }
168	UNIMPL		nfsservctl
169	STD		{ int linux_sys_setresgid(gid_t rgid, gid_t egid, \
			    gid_t sgid); }
170	STD		{ int linux_sys_getresgid(gid_t *rgid, gid_t *egid, \
			    gid_t *sgid); }
171	UNIMPL		prctl
172	STD		{ int linux_sys_rt_sigreturn( \
			    struct linux_rt_sigframe *sfp); }
173	STD		{ int linux_sys_rt_sigaction(int signum, \
			    const struct linux_sigaction *nsa, \
			    struct linux_sigaction *osa, \
			    size_t sigsetsize); }
174	STD		{ int linux_sys_rt_sigprocmask(int how, \
			    const linux_sigset_t *set, \
			    linux_sigset_t *oset, \
			    size_t sigsetsize); }
175	STD		{ int linux_sys_rt_sigpending( \
			    linux_sigset_t *set, \
			    size_t sigsetsize); }
176	UNIMPL		rt_sigtimedwait
; XXX XAX int here?  sigset_t here?  siginfo_t
177	STD		{ int linux_sys_rt_queueinfo(int pid, int signum, \
			    void *uinfo); }
178	STD		{ int linux_sys_rt_sigsuspend(linux_sigset_t *unewset, \
			    size_t sigsetsize); }
179	STD		{ int linux_sys_pread(int fd, char *buf, \
			    size_t nbyte, linux_off_t offset); }
180	STD		{ int linux_sys_pwrite(int fd, char *buf, \
			    size_t nbyte, linux_off_t offset); }
181	NOARGS		{ int sys___posix_chown(const char *path, \
			    int uid, int gid); }
182	NOARGS		{ int sys___getcwd(char *bufp, size_t length); }
183	UNIMPL		capget
184	UNIMPL		capset
185	STD		{ int linux_sys_sigaltstack( \
			    const struct linux_sigaltstack *ss, \
			    struct linux_sigaltstack *oss); }
186	UNIMPL		sendfile
187	UNIMPL		getpmsg
188	UNIMPL		putpmsg
189	NOARGS		{ int sys___vfork14(void); }
190	STD		{ int linux_sys_ugetrlimit(int which, \
			    struct rlimit *rlp); }
191	UNIMPL		/* unused */
#define linux_sys_mmap2_args linux_sys_mmap_args
192	NOARGS		{ linux_off_t linux_sys_mmap2(unsigned long addr, \
			    size_t len, int prot, int flags, int fd, \
			    linux_off_t offset); }
193	STD		{ int linux_sys_truncate64(const char *path, \
			    off_t length); }
194	STD		{ int linux_sys_ftruncate64(unsigned int fd, \
			    off_t length); }
195	STD		{ int linux_sys_stat64(const char *path, \
			    struct linux_stat64 *sp); }
196	STD		{ int linux_sys_lstat64(const char *path, \
			    struct linux_stat64 *sp); }
197	STD		{ int linux_sys_fstat64(int fd, \
			    struct linux_stat64 *sp); }
198	UNIMPL		sys_pciconfig_read
199	UNIMPL		sys_pciconfig_write
200	UNIMPL		sys_pciconfig_iobase
201	UNIMPL		/* Unused (MacOnLinux project) */
202	STD		{ int linux_sys_getdents64(int fd, \
			    struct linux_dirent64 *dent, unsigned int count); }
203	UNIMPL		pivot_root
204	STD		{ int linux_sys_fcntl64(int fd, int cmd, void *arg); }
205	NOARGS		{ int sys_mincore(void *addr, size_t len, char *vec); }
206	NOARGS		{ int sys_madvise(void *addr, size_t len, int behav); }
207	UNIMPL		gettid
208	UNIMPL		tkill
209	STD		{ int linux_sys_setxattr(char *path, char *name, \
			    void *value, size_t size, int flags); }
210	STD		{ int linux_sys_lsetxattr(char *path, char *name, \
			    void *value, size_t size, int flags); }
211	STD		{ int linux_sys_fsetxattr(int fd, char *name, \
			    void *value, size_t size, int flags); }
212	STD		{ ssize_t linux_sys_getxattr(char *path, char *name, \
			    void *value, size_t size); }
213	STD		{ ssize_t linux_sys_lgetxattr(char *path, char *name, \
			    void *value, size_t size); }
214	STD		{ ssize_t linux_sys_fgetxattr(int fd, char *name, \
			    void *value, size_t size); }
215	STD		{ ssize_t linux_sys_listxattr(char *path, char *list, \
			    size_t size); }
216	STD		{ ssize_t linux_sys_llistxattr(char *path, char *list, \
			    size_t size); }
217	STD		{ ssize_t linux_sys_flistxattr(int fd, char *list, \
			    size_t size); }
218	STD		{ int linux_sys_removexattr(char *path, char *name); }
219	STD		{ int linux_sys_lremovexattr(char *path, char *name); }
220	STD		{ int linux_sys_fremovexattr(int fd, char *name); }
221	UNIMPL		futex
222	UNIMPL		sched_setaffinity
223	UNIMPL		sched_getaffinity
224	UNIMPL		/* unused */
225	UNIMPL		tuxcall
226	UNIMPL		sendfile64
227	UNIMPL		io_setup
228	UNIMPL		io_destroy
229	UNIMPL		io_getevents
230	UNIMPL		io_submit
231	UNIMPL		io_cancel
232	UNIMPL		set_tid_address
233	UNIMPL		fadvise64
234	STD		{ int linux_sys_exit_group(int error_code); }
235	UNIMPL		lookup_dcookie
236	UNIMPL		epoll_create
237	UNIMPL		epoll_ctl
238	UNIMPL		epoll_wait
239	UNIMPL		remap_file_pages
240	UNIMPL		timer_create
241	UNIMPL		timer_settime
242	UNIMPL		timer_gettime
243	UNIMPL		timer_getoverrun
244	UNIMPL		timer_delete
245	STD		{ int linux_sys_clock_settime(clockid_t which, \
			    struct linux_timespec *tp); }
246	STD		{ int linux_sys_clock_gettime(clockid_t which, \
			    struct linux_timespec *tp); }
247	STD		{ int linux_sys_clock_getres(clockid_t which, \
			    struct linux_timespec *tp); }
248	STD		{ int linux_sys_clock_nanosleep(clockid_t which, \
			    int flags, struct linux_timespec *rqtp, \
			    struct linux_timespec *rmtp); }
249	UNIMPL		swapcontext
250	UNIMPL		tgkill
251	UNIMPL		utimes
252	STD		{ int linux_sys_statfs64(const char *path, \
			    size_t sz, struct linux_statfs64 *sp); }
253	STD		{ int linux_sys_fstatfs64(int fd, \
			    size_t sz, struct linux_statfs64 *sp); }
254	UNIMPL		fadvise64_64
255	UNIMPL		rtas
256	UNIMPL		/* reserved for sys_debug_setcontext */
257	UNIMPL		/* reserved for vserver */
258	UNIMPL		/* reserved for new sys_remap_file_pages */
259	UNIMPL		/* reserved for new sys_mbind */
260	UNIMPL		/* reserved for new sys_get_mempolicy */
261	UNIMPL		/* reserved for new sys_set_mempolicy */
262	UNIMPL		mq_open
263	UNIMPL		mq_unlink
264	UNIMPL		mq_timedsend
265	UNIMPL		mq_timedreceive
266	UNIMPL		mq_notify
267	UNIMPL		mq_getsetattr
268	UNIMPL		kexec_load