xref: /netbsd-src/sys/compat/linux/arch/powerpc/syscalls.master (revision 27527e67bbdf8d9ec84fd58803048ed6d181ece2)
1	$NetBSD: syscalls.master,v 1.26 2005/12/11 12:20:16 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/sa.h>
76#include <sys/syscallargs.h>
77
78#include <compat/linux/common/linux_types.h>
79#include <compat/linux/common/linux_signal.h>
80#include <compat/linux/common/linux_siginfo.h>
81#include <compat/linux/common/linux_machdep.h>
82#include <compat/linux/common/linux_mmap.h>
83
84#include <compat/linux/linux_syscallargs.h>
85
86%%
87
880	NOARGS		{ int linux_sys_nosys(void); } syscall
891	NOARGS		{ int sys_exit(int rval); }
902	NOARGS		{ int sys_fork(void); }
913	NOARGS		{ int sys_read(int fd, char *buf, u_int nbyte); }
924	NOARGS		{ int sys_write(int fd, char *buf, u_int nbyte); }
935	STD		{ int linux_sys_open(const char *path, int flags, \
94			    int mode); }
956	NOARGS		{ int sys_close(int fd); }
967	STD		{ int linux_sys_waitpid(int pid, int *status, \
97			    int options);}
988	STD		{ int linux_sys_creat(const char *path, int mode); }
999	STD		{ int linux_sys_link(const char *path, const \
100			    char *link); }
10110	STD		{ int linux_sys_unlink(const char *path); }
10211	STD		{ int linux_sys_execve(const char *path, char **argp, \
103			    char **envp); }
10412	STD		{ int linux_sys_chdir(const char *path); }
10513	STD		{ int linux_sys_time(linux_time_t *t); }
10614	STD		{ int linux_sys_mknod(const char *path, int mode, \
107			    int dev); }
10815	STD		{ int linux_sys_chmod(const char *path, int mode); }
10916	STD		{ int linux_sys_lchown(const char *path, int uid, \
110			    int gid); }
11117	OBSOL		break
11218	OBSOL		ostat
11319	NOARGS		{ long compat_43_sys_lseek(int fd, long offset, \
114			    int whence); }
11520	NOARGS MPSAFE	{ pid_t sys_getpid(void); }
11621	UNIMPL		mount
11722	OBSOL		umount
11823	NOARGS		{ int sys_setuid(uid_t uid); }
11924	NOARGS		{ uid_t sys_getuid(void); }
12025	STD		{ int linux_sys_stime(linux_time_t *t); }
12126	STD		{ int linux_sys_ptrace(int request, int pid, \
122			    int addr, int data); }
12327	STD		{ int linux_sys_alarm(unsigned int secs); }
12428	OBSOL		ofstat
12529	STD		{ int linux_sys_pause(void); }
12630	STD		{ int linux_sys_utime(const char *path, \
127			    struct linux_utimbuf *times); }
12831	OBSOL		stty
12932	OBSOL		gtty
13033	STD		{ int linux_sys_access(const char *path, int flags); }
13134	STD		{ int linux_sys_nice(int incr); }
13235	OBSOL		ftime
13336	NOARGS		{ int sys_sync(void); }
13437	STD		{ int linux_sys_kill(int pid, int signum); }
13538	STD		{ int linux_sys_rename(const char *from, \
136			    const char *to); }
13739	STD		{ int linux_sys_mkdir(const char *path, int mode); }
13840	STD		{ int linux_sys_rmdir(const char *path); }
13941	NOARGS		{ int sys_dup(u_int fd); }
14042	STD		{ int linux_sys_pipe(int *pfds); }
14143	STD		{ int linux_sys_times(struct times *tms); }
14244	OBSOL		prof
14345	STD		{ int linux_sys_brk(char *nsize); }
14446	NOARGS		{ int sys_setgid(gid_t gid); }
14547	NOARGS		{ gid_t sys_getgid(void); }
14648	STD		{ int linux_sys_signal(int signum, \
147			    linux_handler_t handler); }
14849	NOARGS		{ uid_t sys_geteuid(void); }
14950	NOARGS		{ gid_t sys_getegid(void); }
15051	NOARGS		{ int sys_acct(char *path); }
15152	UNIMPL		umount
15253	OBSOL		lock
15354	STD		{ int linux_sys_ioctl(int fd, u_long com, \
154			    caddr_t data); }
15555	STD		{ int linux_sys_fcntl(int fd, int cmd, void *arg); }
15656	OBSOL		mpx
15757	NOARGS		{ int sys_setpgid(int pid, int pgid); }
15858	OBSOL		ulimit
15959 	STD		{ int linux_sys_olduname(struct linux_old_utsname \
160			   *up); }
16160	NOARGS		{ int sys_umask(int newmask); }
16261	NOARGS		{ int sys_chroot(char *path); }
16362	UNIMPL		ustat
16463	NOARGS		{ int sys_dup2(u_int from, u_int to); }
16564	NOARGS		{ pid_t sys_getppid(void); }
16665	NOARGS		{ int sys_getpgrp(void); }
16766	NOARGS		{ int sys_setsid(void); }
16867	STD		{ int linux_sys_sigaction(int signum, \
169			    const struct linux_old_sigaction *nsa, \
170			    struct linux_old_sigaction *osa); }
17168	STD		{ int linux_sys_siggetmask(void); }
17269	STD		{ int linux_sys_sigsetmask(linux_old_sigset_t mask); }
17370	NOARGS		{ int sys_setreuid(uid_t ruid, uid_t euid); }
17471	NOARGS		{ int sys_setregid(gid_t rgid, gid_t egid); }
17572	STD		{ int linux_sys_sigsuspend(caddr_t restart, \
176			    int oldmask, int mask); }
17773	STD		{ int linux_sys_sigpending(linux_old_sigset_t *set); }
17874	NOARGS		{ int compat_43_sys_sethostname(char *hostname, \
179			    u_int len);}
18075	STD		{ int linux_sys_setrlimit(u_int which, \
181			    struct orlimit *rlp); }
18276	STD		{ int linux_sys_getrlimit(u_int which, \
183			    struct orlimit *rlp); }
18477	NOARGS		{ int sys_getrusage(int who, struct rusage *rusage); }
18578	STD		{ int linux_sys_gettimeofday(struct timeval *tp, \
186			    struct timezone *tzp); }
18779	STD		{ int linux_sys_settimeofday(struct timeval *tp, \
188			    struct timezone *tzp); }
18980	NOARGS		{ int sys_getgroups(u_int gidsetsize, gid_t *gidset); }
19081	NOARGS		{ int sys_setgroups(u_int gidsetsize, gid_t *gidset); }
19182	STD		{ int linux_sys_select(int nfds, fd_set* readfds, \
192					fd_set* writefds, fd_set* exceptfds, \
193					struct timeval *timeout); }
19483	STD		{ int linux_sys_symlink(const char *path, \
195			    const char *to); }
19684	NOARGS		{ int compat_43_sys_lstat(const char *path, \
197			    struct stat43 *up); } oolstat
19885	STD		{ int linux_sys_readlink(const char *name, char *buf, \
199			    int count); }
200#ifdef EXEC_AOUT
20186	STD		{ int linux_sys_uselib(const char *path); }
202#else
20386	UNIMPL		sys_uselib
204#endif
20587	STD		{ int linux_sys_swapon(char *name); }
20688	STD		{ int linux_sys_reboot(int magic1, int magic2, \
207			    int cmd, void *arg); }
20889	STD		{ int linux_sys_readdir(int fd, caddr_t dent, \
209			    unsigned int count); }
21090	NOARGS		{ int linux_sys_mmap(unsigned long addr, size_t len, \
211			    int prot, int flags, int fd, linux_off_t offset); }
21291	NOARGS		{ int sys_munmap(caddr_t addr, int len); }
21392	STD		{ int linux_sys_truncate(const char *path, \
214			    long length); }
21593	NOARGS		{ int compat_43_sys_ftruncate(int fd, long length); }
21694	NOARGS		{ int sys_fchmod(int fd, int mode); }
21795	NOARGS		{ int sys___posix_fchown(int fd, int uid, int gid); }
21896	NOARGS		{ int sys_getpriority(int which, int who); }
21997	NOARGS		{ int sys_setpriority(int which, int who, int prio); }
22098	NOARGS		{ int sys_profil(caddr_t samples, u_int size, \
221			    u_int offset, u_int scale); }
22299	STD		{ int linux_sys_statfs(const char *path, \
223			    struct linux_statfs *sp); }
224100	STD		{ int linux_sys_fstatfs(int fd, \
225			    struct linux_statfs *sp); }
226101	STD		{ int linux_sys_ioperm(unsigned int lo, \
227			    unsigned int hi, int val); }
228102	STD		{ int linux_sys_socketcall(int what, void *args); }
229103	UNIMPL		syslog
230104	NOARGS		{ int sys_setitimer(u_int which, \
231			    struct itimerval *itv, struct itimerval *oitv); }
232105	NOARGS		{ int sys_getitimer(u_int which, \
233			    struct itimerval *itv); }
234106	STD		{ int linux_sys_stat(const char *path, \
235			    struct linux_stat *sp); }
236107	STD		{ int linux_sys_lstat(const char *path, \
237			    struct linux_stat *sp); }
238108	STD		{ int linux_sys_fstat(int fd, struct linux_stat *sp); }
239109	STD		{ int linux_sys_uname(struct linux_utsname *up); }
240110	UNIMPL		iopl
241111	UNIMPL		vhangup
242112	UNIMPL		idle
243113	UNIMPL		vm86old
244114	STD		{ int linux_sys_wait4(int pid, int *status, \
245			    int options, struct rusage *rusage); }
246115	STD		{ int linux_sys_swapoff(const char *path); }
247116	STD		{ int linux_sys_sysinfo(struct linux_sysinfo *arg); }
248117	STD		{ int linux_sys_ipc(int what, int a1, int a2, int a3, \
249			    caddr_t ptr); }
250118	NOARGS		{ int sys_fsync(int fd); }
251119	STD		{ int linux_sys_sigreturn(struct linux_sigcontext *scp); }
252120	STD		{ int linux_sys_clone(int flags, void *stack); }
253121	STD		{ int linux_sys_setdomainname(char *domainname, \
254			    int len); }
255122	STD		{ int linux_sys_new_uname(struct linux_utsname *up); }
256123	UNIMPL		modify_ldt
257124	UNIMPL		adjtimex
258125	STD		{ int linux_sys_mprotect(const void *start, \
259			    unsigned long len, int prot); }
260126	STD		{ int linux_sys_sigprocmask(int how, \
261			    const linux_old_sigset_t *set, \
262			    linux_old_sigset_t *oset); }
263127	UNIMPL		create_module
264128	UNIMPL		init_module
265129	UNIMPL		delete_module
266130	UNIMPL		get_kernel_syms
267131	UNIMPL		quotactl
268132	STD		{ int linux_sys_getpgid(int pid); }
269133	NOARGS		{ int sys_fchdir(int fd); }
270134	UNIMPL		bdflush
271135	UNIMPL		sysfs
272136	STD		{ int linux_sys_personality(int per); }
273137	UNIMPL		afs_syscall
274138	STD		{ int linux_sys_setfsuid(uid_t uid); }
275139	NOARGS		{ int linux_sys_getfsuid(void); }
276140	STD		{ int linux_sys_llseek(int fd, u_int32_t ohigh, \
277			    u_int32_t olow, caddr_t res, int whence); }
278141	STD		{ int linux_sys_getdents(int fd, \
279			    struct linux_dirent *dent, unsigned int count); }
280142	STD		{ int linux_sys_new_select(int nfds, fd_set *readfds, \
281			    fd_set *writefds, fd_set *exceptfds, \
282			    struct timeval *timeout); }
283143	NOARGS		{ int sys_flock(int fd, int how); }
284144	STD		{ int linux_sys_msync(caddr_t addr, int len, int fl); }
285145	NOARGS		{ int sys_readv(int fd, struct iovec *iovp, \
286				u_int iovcnt); }
287146	NOARGS		{ int sys_writev(int fd, struct iovec *iovp, \
288				u_int iovcnt); }
289147	NOARGS		{ pid_t sys_getsid(pid_t pid); }
290148	STD		{ int linux_sys_fdatasync(int fd); }
291149	STD		{ int linux_sys___sysctl(struct linux___sysctl *lsp); }
292150	NOARGS		{ int sys_mlock(caddr_t addr, size_t len); }
293151	NOARGS		{ int sys_munlock(caddr_t addr, size_t len); }
294152	NOARGS		{ int sys_mlockall(int flags); }
295153	NOARGS		{ int sys_munlockall(void); }
296154	STD		{ int linux_sys_sched_setparam(pid_t pid, \
297			    const struct linux_sched_param *sp); }
298155	STD		{ int linux_sys_sched_getparam(pid_t pid, \
299			    struct linux_sched_param *sp); }
300156	STD		{ int linux_sys_sched_setscheduler(pid_t pid, \
301			    int policy, const struct linux_sched_param *sp); }
302157	STD		{ int linux_sys_sched_getscheduler(pid_t pid); }
303158	STD		{ int linux_sys_sched_yield(void); }
304159	STD		{ int linux_sys_sched_get_priority_max(int policy); }
305160	STD		{ int linux_sys_sched_get_priority_min(int policy); }
306161	UNIMPL		sched_rr_get_interval
307162	NOARGS		{ int sys_nanosleep(const struct timespec *rqtp, \
308				struct timespec *rmtp); }
309163	STD		{ void *linux_sys_mremap(void *old_address, \
310			    size_t old_size, size_t new_size, u_long flags); }
311164	STD		{ int linux_sys_setresuid(uid_t ruid, uid_t euid, \
312			    uid_t suid); }
313165	STD		{ int linux_sys_getresuid(uid_t *ruid, uid_t *euid, \
314			    uid_t *suid); }
315166	UNIMPL		query_module
316167	NOARGS		{ int sys_poll(struct pollfd *fds, u_int nfds, \
317			    int timeout); }
318168	UNIMPL		nfsservctl
319169	STD		{ int linux_sys_setresgid(gid_t rgid, gid_t egid, \
320			    gid_t sgid); }
321170	STD		{ int linux_sys_getresgid(gid_t *rgid, gid_t *egid, \
322			    gid_t *sgid); }
323171	UNIMPL		prctl
324172	STD		{ int linux_sys_rt_sigreturn( \
325			    struct linux_rt_sigframe *sfp); }
326173	STD		{ int linux_sys_rt_sigaction(int signum, \
327			    const struct linux_sigaction *nsa, \
328			    struct linux_sigaction *osa, \
329			    size_t sigsetsize); }
330174	STD		{ int linux_sys_rt_sigprocmask(int how, \
331			    const linux_sigset_t *set, \
332			    linux_sigset_t *oset, \
333			    size_t sigsetsize); }
334175	STD		{ int linux_sys_rt_sigpending( \
335			    linux_sigset_t *set, \
336			    size_t sigsetsize); }
337176	UNIMPL		rt_sigtimedwait
338; XXX XAX int here?  sigset_t here?  siginfo_t
339177	STD		{ int linux_sys_rt_queueinfo(int pid, int signum, \
340			    void *uinfo); }
341178	STD		{ int linux_sys_rt_sigsuspend(linux_sigset_t *unewset, \
342			    size_t sigsetsize); }
343179	STD		{ int linux_sys_pread(int fd, char *buf, \
344			    size_t nbyte, linux_off_t offset); }
345180	STD		{ int linux_sys_pwrite(int fd, char *buf, \
346			    size_t nbyte, linux_off_t offset); }
347181	STD		{ int linux_sys_chown(const char *path, \
348			    int uid, int gid); }
349182	NOARGS		{ int sys___getcwd(char *bufp, size_t length); }
350183	UNIMPL		capget
351184	UNIMPL		capset
352185	STD		{ int linux_sys_sigaltstack( \
353			    const struct linux_sigaltstack *ss, \
354			    struct linux_sigaltstack *oss); }
355186	UNIMPL		sendfile
356187	UNIMPL		getpmsg
357188	UNIMPL		putpmsg
358189	NOARGS		{ int sys___vfork14(void); }
359190	STD		{ int linux_sys_ugetrlimit(int which, \
360			    struct rlimit *rlp); }
361191	UNIMPL		/* unused */
362192	NOARGS		{ linux_off_t linux_sys_mmap2(unsigned long addr, \
363			    size_t len, int prot, int flags, int fd, \
364			    linux_off_t offset); }
365193	STD		{ int linux_sys_truncate64(const char *path, \
366			    off_t length); }
367194	STD		{ int linux_sys_ftruncate64(unsigned int fd, \
368			    off_t length); }
369195	STD		{ int linux_sys_stat64(const char *path, \
370			    struct linux_stat64 *sp); }
371196	STD		{ int linux_sys_lstat64(const char *path, \
372			    struct linux_stat64 *sp); }
373197	STD		{ int linux_sys_fstat64(int fd, \
374			    struct linux_stat64 *sp); }
375198	UNIMPL		sys_pciconfig_read
376199	UNIMPL		sys_pciconfig_write
377200	UNIMPL		sys_pciconfig_iobase
378201	UNIMPL		/* Unused (MacOnLinux project) */
379202	STD		{ int linux_sys_getdents64(int fd, \
380			    struct linux_dirent64 *dent, unsigned int count); }
381203	UNIMPL		pivot_root
382204	STD		{ int linux_sys_fcntl64(int fd, int cmd, void *arg); }
383205	NOARGS		{ int sys_mincore(void *addr, size_t len, char *vec); }
384206	NOARGS		{ int sys_madvise(void *addr, size_t len, int behav); }
385207	UNIMPL		gettid
386208	UNIMPL		tkill
387209	STD		{ int linux_sys_setxattr(char *path, char *name, \
388			    void *value, size_t size, int flags); }
389210	STD		{ int linux_sys_lsetxattr(char *path, char *name, \
390			    void *value, size_t size, int flags); }
391211	STD		{ int linux_sys_fsetxattr(int fd, char *name, \
392			    void *value, size_t size, int flags); }
393212	STD		{ ssize_t linux_sys_getxattr(char *path, char *name, \
394			    void *value, size_t size); }
395213	STD		{ ssize_t linux_sys_lgetxattr(char *path, char *name, \
396			    void *value, size_t size); }
397214	STD		{ ssize_t linux_sys_fgetxattr(int fd, char *name, \
398			    void *value, size_t size); }
399215	STD		{ ssize_t linux_sys_listxattr(char *path, char *list, \
400			    size_t size); }
401216	STD		{ ssize_t linux_sys_llistxattr(char *path, char *list, \
402			    size_t size); }
403217	STD		{ ssize_t linux_sys_flistxattr(int fd, char *list, \
404			    size_t size); }
405218	STD		{ int linux_sys_removexattr(char *path, char *name); }
406219	STD		{ int linux_sys_lremovexattr(char *path, char *name); }
407220	STD		{ int linux_sys_fremovexattr(int fd, char *name); }
408221	UNIMPL		futex
409222	UNIMPL		sched_setaffinity
410223	UNIMPL		sched_getaffinity
411224	UNIMPL		/* unused */
412225	UNIMPL		tuxcall
413226	UNIMPL		sendfile64
414227	UNIMPL		io_setup
415228	UNIMPL		io_destroy
416229	UNIMPL		io_getevents
417230	UNIMPL		io_submit
418231	UNIMPL		io_cancel
419232	UNIMPL		set_tid_address
420233	UNIMPL		fadvise64
421234	STD		{ int linux_sys_exit_group(int error_code); }
422235	UNIMPL		lookup_dcookie
423236	UNIMPL		epoll_create
424237	UNIMPL		epoll_ctl
425238	UNIMPL		epoll_wait
426239	UNIMPL		remap_file_pages
427240	UNIMPL		timer_create
428241	UNIMPL		timer_settime
429242	UNIMPL		timer_gettime
430243	UNIMPL		timer_getoverrun
431244	UNIMPL		timer_delete
432245	STD		{ int linux_sys_clock_settime(clockid_t which, \
433			    struct linux_timespec *tp); }
434246	STD		{ int linux_sys_clock_gettime(clockid_t which, \
435			    struct linux_timespec *tp); }
436247	STD		{ int linux_sys_clock_getres(clockid_t which, \
437			    struct linux_timespec *tp); }
438248	STD		{ int linux_sys_clock_nanosleep(clockid_t which, \
439			    int flags, struct linux_timespec *rqtp, \
440			    struct linux_timespec *rmtp); }
441249	UNIMPL		swapcontext
442250	UNIMPL		tgkill
443251	UNIMPL		utimes
444252	STD		{ int linux_sys_statfs64(const char *path, \
445			    size_t sz, struct linux_statfs64 *sp); }
446253	STD		{ int linux_sys_fstatfs64(int fd, \
447			    size_t sz, struct linux_statfs64 *sp); }
448254	UNIMPL		fadvise64_64
449255	UNIMPL		rtas
450256	UNIMPL		/* reserved for sys_debug_setcontext */
451257	UNIMPL		/* reserved for vserver */
452258	UNIMPL		/* reserved for new sys_remap_file_pages */
453259	UNIMPL		/* reserved for new sys_mbind */
454260	UNIMPL		/* reserved for new sys_get_mempolicy */
455261	UNIMPL		/* reserved for new sys_set_mempolicy */
456262	UNIMPL		mq_open
457263	UNIMPL		mq_unlink
458264	UNIMPL		mq_timedsend
459265	UNIMPL		mq_timedreceive
460266	UNIMPL		mq_notify
461267	UNIMPL		mq_getsetattr
462268	UNIMPL		kexec_load
463