syscalls.master revision 1.4
1	$NetBSD: syscalls.master,v 1.4 2002/01/23 15:54:34 bjh21 Exp $
2
3; Derived from sys/compat/linux/arch/*/syscalls.master
4; and from Linux 2.4.12 arch/arm/kernel/calls.S
5
6; NetBSD/arm COMPAT_LINUX system call name/number "master" file.
7; (See syscalls.conf to see what it is processed into.)
8;
9; Fields: number type [type-dependent ...]
10;	number	system call number, must be in order
11;	type	one of STD, OBSOL, UNIMPL, NODEF, NOARGS, or one of
12;		the compatibility options defined in syscalls.conf.
13;
14; types:
15;	STD	always included
16;	OBSOL	obsolete, not included in system
17;	UNIMPL	unimplemented, not included in system
18;	NODEF	included, but don't define the syscall number
19;	NOARGS	included, but don't define the syscall args structure
20;	INDIR	included, but don't define the syscall args structure
21;		and allow it to be "really" varargs.
22;
23; The compat options are defined in the syscalls.conf file, and the
24; compat option name is prefixed to the syscall name.  Other than
25; that, they're like NODEF (for 'compat' options), or STD (for
26; 'libcompat' options).
27;
28; The type-dependent arguments are as follows:
29; For STD, NODEF, NOARGS, and compat syscalls:
30;	{ pseudo-proto } [alias]
31; For other syscalls:
32;	[comment]
33;
34; #ifdef's, etc. may be included, and are copied to the output files.
35; #include's are copied to the syscall names and switch definition files only.
36
37#if defined(_KERNEL_OPT)
38#include "opt_compat_43.h"
39#endif
40
41#include <sys/param.h>
42#include <sys/poll.h>
43#include <sys/systm.h>
44#include <sys/signal.h>
45#include <sys/mount.h>
46#include <sys/syscallargs.h>
47
48#include <compat/linux/common/linux_types.h>
49#include <compat/linux/common/linux_signal.h>
50#include <compat/linux/common/linux_siginfo.h>
51#include <compat/linux/common/linux_machdep.h>
52
53#include <compat/linux/linux_syscallargs.h>
54
55%%
560	UNIMPL
571	NOARGS		{ int sys_exit(int rval); }
582	NOARGS		{ int sys_fork(void); }
593	NOARGS		{ int sys_read(int fd, char *buf, u_int nbyte); }
604	NOARGS		{ int sys_write(int fd, char *buf, u_int nbyte); }
615	STD		{ int linux_sys_open(const char *path, int flags, \
62			    int mode); }
636	NOARGS		{ int sys_close(int fd); }
647	STD		{ int linux_sys_waitpid(int pid, int *status, \
65			    int options);}
668	STD		{ int linux_sys_creat(const char *path, int mode); }
679	STD		{ int linux_sys_link(const char *path, const \
68			    char *link); }
6910	STD		{ int linux_sys_unlink(const char *path); }
7011	STD		{ int linux_sys_execve(const char *path, char **argp, \
71			    char **envp); }
7212	STD		{ int linux_sys_chdir(const char *path); }
7313	STD		{ int linux_sys_time(linux_time_t *t); }
7414	STD		{ int linux_sys_mknod(const char *path, int mode, \
75			    int dev); }
7615	STD		{ int linux_sys_chmod(const char *path, int mode); }
7716	STD		{ int linux_sys_lchown16(const char *path, int uid, \
78			    int gid); }
7917	OBSOL		break
8018	OBSOL		ostat
8119	NOARGS		{ long compat_43_sys_lseek(int fd, long offset, \
82			    int whence); }
8320	NOARGS MPSAFE	{ pid_t sys_getpid(void); }
8421	UNIMPL		mount
8522	OBSOL		umount
8623	NOARGS		{ int sys_setuid(uid_t uid); }
8724	NOARGS		{ uid_t sys_getuid(void); }
8825	STD		{ int linux_sys_stime(linux_time_t *t); }
8926	STD		{ int linux_sys_ptrace(int request, int pid, \
90			    int addr, int data); }
9127	STD		{ int linux_sys_alarm(unsigned int secs); }
9228	OBSOL		ofstat
9329	STD		{ int linux_sys_pause(void); }
9430	STD		{ int linux_sys_utime(const char *path, \
95			    struct linux_utimbuf *times); }
9631	OBSOL		stty
9732	OBSOL		gtty
9833	STD		{ int linux_sys_access(const char *path, int flags); }
9934	STD		{ int linux_sys_nice(int incr); }
10035	OBSOL		ftime
10136	NOARGS		{ int sys_sync(void); }
10237	STD		{ int linux_sys_kill(int pid, int signum); }
10338	STD		{ int linux_sys_rename(const char *from, \
104			    const char *to); }
10539	STD		{ int linux_sys_mkdir(const char *path, int mode); }
10640	STD		{ int linux_sys_rmdir(const char *path); }
10741	NOARGS		{ int sys_dup(u_int fd); }
10842	STD		{ int linux_sys_pipe(int *pfds); }
10943	STD		{ int linux_sys_times(struct times *tms); }
11044	OBSOL		prof
11145	STD		{ int linux_sys_brk(char *nsize); }
11246	NOARGS		{ int sys_setgid(gid_t gid); }
11347	NOARGS		{ gid_t sys_getgid(void); }
11448	STD		{ int linux_sys_signal(int signum, \
115			    linux_handler_t handler); }
11649	NOARGS		{ uid_t sys_geteuid(void); }
11750	NOARGS		{ gid_t sys_getegid(void); }
11851	NOARGS		{ int sys_acct(char *path); }
11952	UNIMPL		umount
12053	OBSOL		lock
12154	STD		{ int linux_sys_ioctl(int fd, u_long com, \
122			    caddr_t data); }
12355	STD		{ int linux_sys_fcntl(int fd, int cmd, void *arg); }
12456	OBSOL		mpx
12557	NOARGS		{ int sys_setpgid(int pid, int pgid); }
12658	OBSOL		ulimit
12759 	STD		{ int linux_sys_oldolduname( \
128			   struct linux_oldold_utsname *up); }
12960	NOARGS		{ int sys_umask(int newmask); }
13061	NOARGS		{ int sys_chroot(char *path); }
13162	UNIMPL		ustat
13263	NOARGS		{ int sys_dup2(u_int from, u_int to); }
13364	NOARGS		{ pid_t sys_getppid(void); }
13465	NOARGS		{ int sys_getpgrp(void); }
13566	NOARGS		{ int sys_setsid(void); }
13667	STD		{ int linux_sys_sigaction(int signum, \
137			    const struct linux_old_sigaction *nsa, \
138			    struct linux_old_sigaction *osa); }
13968	STD		{ int linux_sys_siggetmask(void); }
14069	STD		{ int linux_sys_sigsetmask(linux_old_sigset_t mask); }
14170	NOARGS		{ int sys_setreuid(uid_t ruid, uid_t euid); } 
14271	NOARGS		{ int sys_setregid(gid_t rgid, gid_t egid); }
14372	STD		{ int linux_sys_sigsuspend(caddr_t restart, \
144			    int oldmask, int mask); }
14573	STD		{ int linux_sys_sigpending(linux_old_sigset_t *set); }
14674	NOARGS		{ int compat_43_sys_sethostname(char *hostname, \
147			    u_int len);}
14875	NOARGS		{ int compat_43_sys_setrlimit(u_int which, \
149			    struct orlimit *rlp); }
15076	NOARGS		{ int compat_43_sys_getrlimit(u_int which, \
151			    struct orlimit *rlp); }
15277	NOARGS		{ int sys_getrusage(int who, struct rusage *rusage); }
15378	STD		{ int linux_sys_gettimeofday(struct timeval *tp, \
154			    struct timezone *tzp); }
15579	STD		{ int linux_sys_settimeofday(struct timeval *tp, \
156			    struct timezone *tzp); }
15780	NOARGS		{ int sys_getgroups(u_int gidsetsize, gid_t *gidset); }
15881	NOARGS		{ int sys_setgroups(u_int gidsetsize, gid_t *gidset); }
15982	STD		{ int linux_sys_oldselect(struct linux_oldselect *lsp); }
16083	STD		{ int linux_sys_symlink(const char *path, \
161			    const char *to); }
16284	NOARGS		{ int compat_43_sys_lstat(const char *path, \
163			    struct stat43 *up); } oolstat
16485	STD		{ int linux_sys_readlink(const char *name, char *buf, \
165			    int count); }
166#ifdef EXEC_AOUT
16786	STD		{ int linux_sys_uselib(const char *path); }
168#else
16986	EXCL		uselib
170#endif
17187	STD		{ int linux_sys_swapon(char *name); }
17288	STD		{ int linux_sys_reboot(int magic1, int magic2, \
173			    int cmd, void *arg); }
17489	STD		{ int linux_sys_readdir(int fd, caddr_t dent, \
175			    unsigned int count); }
17690	STD		{ int linux_sys_old_mmap(struct linux_oldmmap *lmp); }
17791	NOARGS		{ int sys_munmap(caddr_t addr, int len); }
17892	STD		{ int linux_sys_truncate(const char *path, \
179			    long length); }
18093	NOARGS		{ int compat_43_sys_ftruncate(int fd, long length); }
18194	NOARGS		{ int sys_fchmod(int fd, int mode); }
18295	STD		{ int linux_sys_fchown16(int fd, int uid, int gid); }
18396	NOARGS		{ int sys_getpriority(int which, int who); }
18497	NOARGS		{ int sys_setpriority(int which, int who, int prio); }
18598	NOARGS		{ int sys_profil(caddr_t samples, u_int size, \
186			    u_int offset, u_int scale); }
18799	STD		{ int linux_sys_statfs(const char *path, \
188			    struct linux_statfs *sp); }
189100	STD		{ int linux_sys_fstatfs(int fd, \
190			    struct linux_statfs *sp); }
191101	UNIMPL
192102	STD		{ int linux_sys_socketcall(int what, void *args); }
193103	UNIMPL		syslog
194104	NOARGS		{ int sys_setitimer(u_int which, \
195			    struct itimerval *itv, struct itimerval *oitv); }
196105	NOARGS		{ int sys_getitimer(u_int which, \
197			    struct itimerval *itv); }
198106	STD		{ int linux_sys_stat(const char *path, \
199			    struct linux_stat *sp); }
200107	STD		{ int linux_sys_lstat(const char *path, \
201			    struct linux_stat *sp); }
202108	STD		{ int linux_sys_fstat(int fd, struct linux_stat *sp); }
203109	STD		{ int linux_sys_olduname(struct linux_oldutsname *up); }
204110	UNIMPL
205111	UNIMPL		vhangup
206112	UNIMPL		idle
207113	UNIMPL		syscall
208114	STD		{ int linux_sys_wait4(int pid, int *status, \
209			    int options, struct rusage *rusage); }
210115	STD		{ int linux_sys_swapoff(const char *path); }
211116	STD		{ int linux_sys_sysinfo(struct linux_sysinfo *arg); }
212117	STD		{ int linux_sys_ipc(int what, int a1, int a2, int a3, \
213			    caddr_t ptr); }
214118	NOARGS		{ int sys_fsync(int fd); }
215119	STD		{ int linux_sys_sigreturn(struct linux_sigcontext *scp); }
216120	STD		{ int linux_sys_clone(int flags, void *stack); }
217121	STD		{ int linux_sys_setdomainname(char *domainname, \
218			    int len); }
219122	STD		{ int linux_sys_uname(struct linux_utsname *up); }
220123	UNIMPL		modify_ldt	
221124	UNIMPL		adjtimex
222125	NOARGS		{ int sys_mprotect(caddr_t addr, int len, int prot); }
223126	STD		{ int linux_sys_sigprocmask(int how, \
224			    const linux_old_sigset_t *set, \
225			    linux_old_sigset_t *oset); }
226127	UNIMPL		create_module
227128	UNIMPL		init_module
228129	UNIMPL		delete_module
229130	UNIMPL		get_kernel_syms
230131	UNIMPL		quotactl
231132	STD		{ int linux_sys_getpgid(int pid); }
232133	NOARGS		{ int sys_fchdir(int fd); }
233134	UNIMPL		bdflush
234135	UNIMPL		sysfs
235136	STD		{ int linux_sys_personality(int per); }
236137	UNIMPL		afs_syscall
237138	STD		{ int linux_sys_setfsuid(uid_t uid); }
238139	NOARGS		{ int linux_sys_getfsuid(void); }
239140	STD		{ int linux_sys_llseek(int fd, u_int32_t ohigh, \
240			    u_int32_t olow, caddr_t res, int whence); }
241141	STD		{ int linux_sys_getdents(int fd, \
242			    struct linux_dirent *dent, unsigned int count); }
243142	STD		{ int linux_sys_select(int nfds, fd_set *readfds, \
244			    fd_set *writefds, fd_set *exceptfds, \
245			    struct timeval *timeout); }
246143	NOARGS		{ int sys_flock(int fd, int how); }
247144	STD		{ int linux_sys_msync(caddr_t addr, int len, int fl); }
248145	NOARGS		{ int sys_readv(int fd, struct iovec *iovp, \
249				u_int iovcnt); }
250146	NOARGS		{ int sys_writev(int fd, struct iovec *iovp, \
251				u_int iovcnt); }
252147	NOARGS		{ pid_t sys_getsid(pid_t pid); }
253148	STD		{ int linux_sys_fdatasync(int fd); }
254149	STD		{ int linux_sys___sysctl(struct linux___sysctl *lsp); }
255150	NOARGS		{ int sys_mlock(caddr_t addr, size_t len); }
256151	NOARGS		{ int sys_munlock(caddr_t addr, size_t len); }
257152	NOARGS		{ int sys_mlockall(int flags); }
258153	NOARGS		{ int sys_munlockall(void); }
259154	STD		{ int linux_sys_sched_setparam(pid_t pid, \
260			    const struct linux_sched_param *sp); }
261155	STD		{ int linux_sys_sched_getparam(pid_t pid, \
262			    struct linux_sched_param *sp); }
263156	STD		{ int linux_sys_sched_setscheduler(pid_t pid, \
264			    int policy, const struct linux_sched_param *sp); }
265157	STD		{ int linux_sys_sched_getscheduler(pid_t pid); }
266158	STD		{ int linux_sys_sched_yield(void); }
267159	STD		{ int linux_sys_sched_get_priority_max(int policy); }
268160	STD		{ int linux_sys_sched_get_priority_min(int policy); }
269161	UNIMPL		sched_rr_get_interval
270162	NOARGS		{ int sys_nanosleep(const struct timespec *rqtp, \
271				struct timespec *rmtp); }
272163	STD		{ void *linux_sys_mremap(void *old_address, \
273			    size_t old_size, size_t new_size, u_long flags); }
274164	STD		{ int linux_sys_setresuid(uid_t ruid, uid_t euid, \
275			    uid_t suid); }
276165	STD		{ int linux_sys_getresuid(uid_t *ruid, uid_t *euid, \
277			    uid_t *suid); }
278166	UNIMPL
279167	UNIMPL		query_module
280168	NOARGS		{ int sys_poll(struct pollfd *fds, u_int nfds, \
281			    int timeout); }
282169	UNIMPL		nfsservctl
283170	STD		{ int linux_sys_setresgid(gid_t rgid, gid_t egid, \
284			    gid_t sgid); }
285171	STD		{ int linux_sys_getresgid(gid_t *rgid, gid_t *egid, \
286			    gid_t *sgid); }
287172	UNIMPL		prctl
288173	UNIMPL		rt_sigreturn
289;173	STD		{ int linux_sys_rt_sigreturn( \
290;			    struct linux_rt_sigframe *sfp); }
291174	STD		{ int linux_sys_rt_sigaction(int signum, \
292			    const struct linux_sigaction *nsa, \
293			    struct linux_sigaction *osa, \
294			    size_t sigsetsize); }
295175	STD		{ int linux_sys_rt_sigprocmask(int how, \
296			    const linux_sigset_t *set, \
297			    linux_sigset_t *oset, \
298			    size_t sigsetsize); }
299176	STD		{ int linux_sys_rt_sigpending( \
300			    linux_sigset_t *set, \
301			    size_t sigsetsize); }
302177	UNIMPL		rt_sigtimedwait
303; XXX XAX int here?  sigset_t here?  siginfo_t
304178	STD		{ int linux_sys_rt_queueinfo(int pid, int signum, \
305			    void *uinfo); }
306179	STD		{ int linux_sys_rt_sigsuspend(linux_sigset_t *unewset, \
307			    size_t sigsetsize); }
308180	STD		{ int linux_sys_pread(int fd, char *buf, \
309			    size_t nbyte, linux_off_t offset); }
310181	STD		{ int linux_sys_pwrite(int fd, char *buf, \
311			    size_t nbyte, linux_off_t offset); }
312182	STD		{ int linux_sys_chown16(const char *path, int uid, \
313			    int gid); }
314183	NOARGS		{ int sys___getcwd(char *bufp, size_t length); }
315184	UNIMPL		capget
316185	UNIMPL		capset
317186	STD		{ int linux_sys_sigaltstack( \
318			    const struct linux_sigaltstack *ss, \
319			    struct linux_sigaltstack *oss); }
320187	UNIMPL		sendfile
321188	UNIMPL		getpmsg
322189	UNIMPL		putpmsg
323190	NOARGS		vfork { int sys___vfork14(void); }
324191	UNIMPL		getrlimit
325192	UNIMPL		mmap2
326193	STD		{ int linux_sys_truncate64(const char *path, \
327				off_t length); }
328194	NOARGS		ftruncate64 { int sys_ftruncate(int fd, \
329				off_t length); }
330195	STD		{ int linux_sys_stat64(const char *path, \
331				struct linux_stat64 *sp); }
332196	STD		{ int linux_sys_lstat64(const char *path, \
333				struct linux_stat64 *sp); }
334197	STD		{ int linux_sys_fstat64(int fd, \
335				struct linux_stat64 *sp); }
336198	STD		{ int linux_sys_lchown(const char *path, uid_t uid, \
337				gid_t gid); }
338199	NOARGS		getuid32 { uid_t sys_getuid(void); }
339200	NOARGS		getgid32 { gid_t sys_getgid(void); }
340201	NOARGS		geteuid32 { uid_t sys_geteuid(void); }
341202	NOARGS		getegid32 { gid_t sys_getegid(void); }
342203	NOARGS		setreuid32 { int sys_setreuid(uid_t ruid, \
343				uid_t euid); }
344204	NOARGS		setregid32 { int sys_setregid(gid_t rgid, \
345				gid_t egid); }
346205	NOARGS		getgroups32 { int sys_getgroups(u_int gidsetsize, \
347				gid_t *gidset); }
348206	NOARGS		setgroups32 { int sys_setgroups(u_int gidsetsize, \
349				gid_t *gidset); }
350207	NOARGS		fchown32 { int sys___posix_fchown(int fd, uid_t uid, \
351				gid_t gid); }
352208	NOARGS		setresuid32 { int linux_sys_setresuid(uid_t ruid, \
353				uid_t euid, uid_t suid); }
354209	NOARGS		getresuid32 { int linux_sys_getresuid(uid_t *ruid, \
355				uid_t *euid, uid_t *suid); }
356210	NOARGS		setresgid32 { int linux_sys_setresgid(gid_t rgid, \
357				gid_t egid, gid_t sgid); }
358211	NOARGS		getresgid32 { int linux_sys_getresgid(gid_t *rgid, \
359				gid_t *egid, gid_t *sgid); }
360212	STD		chown32 { int linux_sys_chown(const char *path, \
361				uid_t uid, gid_t gid); }
362213	NOARGS		setuid32 { int sys_setuid(uid_t uid); }
363214	NOARGS		setgid32 { int sys_setgid(gid_t gid); }
364215	NOARGS		setfsuid32 { int linux_sys_setfsuid(uid_t uid); }
365216	NOARGS		getfsuid32 { int linux_sys_getfsuid(void); }
366217	UNIMPL		getdents64
367218	UNIMPL		pivot_root
368219	UNIMPL		mincore
369220	UNIMPL		madvise
370221	UNIMPL		fcntl64
371; Fill until 256
372222	UNIMPL
373223	UNIMPL
374224	UNIMPL
375225	UNIMPL
376226	UNIMPL
377227	UNIMPL
378228	UNIMPL
379229	UNIMPL
380230	UNIMPL
381231	UNIMPL
382232	UNIMPL
383233	UNIMPL
384234	UNIMPL
385235	UNIMPL
386236	UNIMPL
387237	UNIMPL
388238	UNIMPL
389239	UNIMPL
390240	UNIMPL
391241	UNIMPL
392242	UNIMPL
393243	UNIMPL
394244	UNIMPL
395245	UNIMPL
396246	UNIMPL
397247	UNIMPL
398248	UNIMPL
399249	UNIMPL
400250	UNIMPL
401251	UNIMPL
402252	UNIMPL
403253	UNIMPL
404254	UNIMPL
405255	UNIMPL
406
407; ARMLinux actually has two ranges of syscalls.  Normal syscalls use
408; SWI numbers starting at 0x900000 (__NR_SYSCALL_BASE).  Special
409; ARM-specific syscalls use SWI numbers starting at 0x9f00000
410; (__ARM_NR_BASE).  linux_syscall() (in arch/arm/arm/linux_syscall.c)
411; remaps these down to 0x900100 so that we can use one linux_sysent
412; array for the whole lot.
413
414256	UNIMPL
415257	UNIMPL		breakpoint
416258	STD		{ int linux_sys_cacheflush(uintptr_t from, \
417				intptr_t to); }
418259	UNIMPL		usr26
419260	UNIMPL		usr32
420