Initial support for linux compat on the alpha. Not quite working.

This commit is contained in:
erh 1998-09-30 18:01:53 +00:00
parent f74feb4335
commit 847d4565e9
8 changed files with 1156 additions and 0 deletions

View File

@ -0,0 +1,12 @@
# $NetBSD: Makefile,v 1.1 1998/09/30 18:01:53 erh Exp $
KDIR= /sys/compat/linux/alpha
INCSDIR= /usr/include/compat/linux/alpha
INCS= linux_errno.h linux_exec.h linux_fcntl.h linux_machdep.h linux_mmap.h \
linux_siginfo.h linux_signal.h linux_socket.h linux_syscall.h \
linux_syscallargs.h linux_types.h
.include <../Makefile.sc>
.include <bsd.kinc.mk>

View File

@ -0,0 +1,11 @@
# $NetBSD: files.linux_alpha,v 1.1 1998/09/30 18:01:53 erh Exp $
#
# Config file description for alpha-dependent Linux compat code.
file compat/linux/alpha/linux_machdep.c compat_linux
file compat/linux/alpha/linux_syscalls.c compat_linux
file compat/linux/alpha/linux_sysent.c compat_linux
file compat/linux/alpha/linux_pipe.c compat_linux
file compat/linux/alpha/linux_sigarray.c compat_linux
# XXX olduname = osf_utsname on Linux. Possibly not used.
file compat/linux/multiarch/linux_olduname.c compat_linux

View File

@ -0,0 +1,12 @@
# $NetBSD: syscalls.conf,v 1.1 1998/09/30 18:01:53 erh Exp $
sysnames="linux_syscalls.c"
sysnumhdr="linux_syscall.h"
syssw="linux_sysent.c"
sysarghdr="linux_syscallargs.h"
compatopts=""
libcompatopts=""
switchname="linux_sysent"
namesname="linux_syscallnames"
constprefix="LINUX_SYS_"

View File

@ -0,0 +1,543 @@
$NetBSD: syscalls.master,v 1.1 1998/09/30 18:01:54 erh Exp $
; @(#)syscalls.master 8.1 (Berkeley) 7/19/93
; NetBSD alpha 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.
;
; (ERH: 5/26/98)
;
; XXX XAX todo:
; check arguments.
; kill not used functions. (ifdef the actual code)
;
; NOT USED = This syscall is not really used in Linux, except in its
; osf compat mode. Since Linux binaries shouldn't ever
; call it and osf binaries run under a different emulation,
; it shouldn't matter that the linux version of the
; function might not DTRT. Define it anyway so we
; don't have to split off or ifdef the associated function.
; A bit better might be to have makesyscalls identify this
; as "define but don't include in table" so it doesn't actually
; ever get called.
; UNIMPL <blank> = not implemented here nor in linux source
; UNIMPL osf_* = osf functions implemented in linux, not here.
;
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/signal.h>
#include <sys/mount.h>
#include <sys/syscallargs.h>
#include <compat/linux/linux_types.h>
#include <compat/linux/linux_signal.h>
#include <compat/linux/linux_siginfo.h>
#include <compat/linux/alpha/linux_syscallargs.h>
#include <compat/linux/linux_ipc.h>
#include <compat/linux/linux_msg.h>
#include <compat/linux/linux_sem.h>
#include <compat/linux/linux_shm.h>
;#include <compat/linux/linux_machdep.h>
0 NOARGS { int 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 UNIMPL
6 NOARGS { int sys_close(int fd); }
7 UNIMPL osf_wait4
;8 OBSOL osf_old_creat, NOT USED. XXX XAX
8 STD { int linux_sys_creat(char *path, int mode); }
9 NOARGS { int sys_link(char *path, char *link); }
10 STD { int linux_sys_unlink(char *path); }
11 UNIMPL
12 STD { int linux_sys_chdir(char *path); }
13 NOARGS { int sys_fchdir(int fd); }
14 STD { int linux_sys_mknod(char *path, int mode, int dev); }
15 STD { int linux_sys_chmod(char *path, int mode); }
16 STD { int linux_sys_chown(char *path, int uid, int gid); }
;17 ALIAS osf_brk
17 STD { int linux_sys_brk(char *nsize); }
18 UNIMPL
19 NOARGS { long compat_43_sys_lseek(int fd, long offset, \
int whence); }
20 NOARGS { pid_t sys_getpid(void); }
21 UNIMPL osf_mount
22 UNIMPL osf_umount
23 NOARGS { int sys_setuid(uid_t uid); }
24 NOARGS { uid_t sys_getuid(void); }
25 UNIMPL
26 UNIMPL ptrace
27 UNIMPL
28 UNIMPL
29 UNIMPL
30 UNIMPL
31 UNIMPL
32 UNIMPL
33 STD { int linux_sys_access(char *path, int flags); }
34 UNIMPL
35 UNIMPL
36 NOARGS { int sys_sync(void); }
37 STD { int linux_sys_kill(int pid, int signum); }
38 UNIMPL
39 NOARGS { int sys_setpgid(int pid, int pgid); }
40 UNIMPL
41 NOARGS { int sys_dup(u_int fd); }
42 NOARGS { int linux_sys_pipe(void); }
43 UNIMPL osf_set_program_attributes
44 UNIMPL
45 STD { int linux_sys_open(char *path, int flags, int mode); }
46 UNIMPL
47 NOARGS { gid_t sys_getgid(void); }
48 UNIMPL osf_sigprocmask
49 UNIMPL
50 UNIMPL
51 NOARGS { int sys_acct(char *path); }
52 STD { int linux_sys_sigpending(linux_old_sigset_t *set); }
53 UNIMPL
54 STD { int linux_sys_ioctl(int fd, u_long com, \
caddr_t data); }
55 UNIMPL
56 UNIMPL
57 STD { int linux_sys_symlink(char *path, char *to); }
58 STD { int linux_sys_readlink(char *name, char *buf, \
int count); }
59 STD { int linux_sys_execve(char *path, char **argp, \
char **envp); }
60 NOARGS { int sys_umask(int newmask); }
61 NOARGS { int sys_chroot(char *path); }
62 UNIMPL
63 NOARGS { int sys_getpgrp(void); }
64 NOARGS { int compat_43_sys_getpagesize(void); }
65 UNIMPL
66 UNIMPL osf_vfork
67 STD { int linux_sys_stat(char *path, \
struct linux_stat *sp); }
68 STD { int linux_sys_lstat(char *path, \
struct linux_stat *sp); }
69 UNIMPL
70 UNIMPL
71 STD { int linux_sys_mmap(unsigned long addr, size_t len, \
int prot, int flags, int fd, off_t offset); }
72 UNIMPL
73 NOARGS { int sys_munmap(caddr_t addr, int len); }
74 NOARGS { int sys_mprotect(caddr_t addr, int len, int prot); }
75 UNIMPL madvise
76 UNIMPL vhangup
77 UNIMPL
78 UNIMPL
79 NOARGS { int sys_getgroups(u_int gidsetsize, gid_t *gidset); }
80 NOARGS { int sys_setgroups(u_int gidsetsize, gid_t *gidset); }
81 UNIMPL
82 UNIMPL setpgrp
;83: Uses int for seconds, and time_t. so need different itimerval struct.
83 UNIMPL osf_setitimer
84 UNIMPL
85 UNIMPL
;86: Uses int for seconds, and time_t. so need different itimerval struct.
86 UNIMPL osf_getitimer
; XXX XAX here, check args match.
87 NOARGS { int compat_43_sys_gethostname(char *hostname, \
u_int len); }
88 NOARGS { int compat_43_sys_sethostname(char *hostname, \
u_int len); }
89 UNIMPL getdtablesize
90 NOARGS { int sys_dup2(u_int from, u_int to); }
91 STD { int linux_sys_fstat(int fd, struct linux_stat *sp); }
92 STD { int linux_sys_fcntl(int fd, int cmd, void *arg); }
93 UNIMPL osf_select
94 UNIMPL poll
95 NOARGS { int sys_fsync(int fd); }
96 NOARGS { int sys_setpriority(int which, int who, int prio); }
97 STD { int linux_sys_socket(int domain, int type, \
int protocol); }
98 NOARGS { int sys_connect(int s, const struct sockaddr *name, \
int namelen); }
99 NOARGS { int compat_43_sys_accept(int s, \
caddr_t name, int *anamelen); }
;100 ALIAS osf_getpriority
100 NOARGS { int sys_getpriority(int which, int who); }
101 NOARGS { int compat_43_sys_send(int s, caddr_t buf, int len, \
int flags); }
102 NOARGS { int compat_43_sys_recv(int s, caddr_t buf, int len, \
int flags); }
103 STD { int linux_sys_sigreturn(struct linux_sigframe *sfp); }
104 NOARGS { int sys_bind(int s, const struct sockaddr *name, \
int namelen); }
105 STD { int linux_sys_setsockopt(int s, int level, \
int optname, void *optval, int optlen); }
106 NOARGS { int sys_listen(int s, int backlog); }
107 UNIMPL
108 UNIMPL
109 UNIMPL
110 UNIMPL
111 STD { int linux_sys_sigsuspend(caddr_t restart, \
int oldmask, int mask); }
112 UNIMPL
113 NOARGS { int sys_recvmsg(int fd, struct msghdr *msg, \
u_int flags); }
114 NOARGS { int sys_sendmsg(int fd, struct msghdr *msg, \
u_int flags); }
115 UNIMPL
116 UNIMPL osf_gettimeofday
117 UNIMPL osf_getrusage
118 STD { int linux_sys_getsockopt(int s, int level, \
int optname, void *optval, int *optlen); }
119 UNIMPL
120 NOARGS { int sys_readv(int fd, struct iovec *iovp, \
u_int iovcnt); }
121 NOARGS { int sys_writev(int fd, struct iovec *iovp, \
u_int iovcnt); }
122 UNIMPL osf_settimeofday
123 STD { int linux_sys_fchown(int fd, int uid, int gid); }
124 NOARGS { int sys_fchmod(int fd, int mode); }
125 STD { int linux_sys_recvfrom(int s, void *buf, int len, \
int flags, struct sockaddr *from, \
int *fromlen); }
126 STD { int linux_sys_setreuid(int ruid, int euid); }
127 STD { int linux_sys_setregid(int rgid, int egid); }
128 STD { int linux_sys_rename(char *from, char *to); }
129 STD { int linux_sys_truncate(char *path, long length); }
130 NOARGS { int compat_43_sys_ftruncate(int fd, long length); }
131 NOARGS { int sys_flock(int fd, int how); }
132 NOARGS { int sys_setgid(gid_t gid); }
133 STD { int linux_sys_sendto(int s, void *msg, int len, \
int flags, struct sockaddr *to, int tolen); }
134 NOARGS { int sys_shutdown(int s, int how); }
135 STD { int linux_sys_socketpair(int domain, int type, \
int protocol, int *rsv); }
136 STD { int linux_sys_mkdir(char *path, int mode); }
137 STD { int linux_sys_rmdir(char *path); }
138 UNIMPL osf_utimes
139 UNIMPL
140 UNIMPL
141 NOARGS { int compat_43_sys_getpeername(int fdes, \
caddr_t asa, int *alen); }
142 UNIMPL
143 UNIMPL
144 NOARGS { int compat_43_sys_getrlimit(u_int which, \
struct orlimit *rlp); }
145 NOARGS { int compat_43_sys_setrlimit(u_int which, \
struct orlimit *rlp); }
146 UNIMPL
147 NOARGS { int sys_setsid(void); }
148 UNIMPL quotactl
149 UNIMPL
150 NOARGS { int compat_43_sys_getsockname(int fdec, \
caddr_t asa, int *alen); }
151 UNIMPL
152 UNIMPL
153 UNIMPL
154 UNIMPL
155 UNIMPL
;156 ALIAS osf_sigaction
156 STD { int linux_sys_sigaction(int signum, \
const struct linux_old_sigaction *nsa, \
struct linux_old_sigaction *osa); }
157 UNIMPL
158 UNIMPL
159 UNIMPL osf_getdirentries
160 UNIMPL osf_statfs
161 UNIMPL osf_fstatfs
162 UNIMPL
163 UNIMPL
164 UNIMPL
165 UNIMPL osf_getdomainname
;166 ALIAS osf_setdomainname
166 UNIMPL setdomainname
167 UNIMPL
168 UNIMPL
169 UNIMPL
170 UNIMPL
171 UNIMPL
172 UNIMPL
173 UNIMPL
174 UNIMPL
175 UNIMPL
176 UNIMPL
177 UNIMPL
178 UNIMPL
179 UNIMPL
180 UNIMPL
181 UNIMPL
182 UNIMPL
183 UNIMPL
184 UNIMPL
185 UNIMPL
186 UNIMPL
187 UNIMPL
188 UNIMPL
189 UNIMPL
190 UNIMPL
191 UNIMPL
192 UNIMPL
193 UNIMPL
194 UNIMPL
195 UNIMPL
196 UNIMPL
197 UNIMPL
198 UNIMPL
199 UNIMPL osf_swapon
#ifdef SYSVMSG
200 NOARGS { int linux_sys_msgctl(int msqid, int cmd, \
struct linux_msqid_ds *buf); }
201 NOARGS { int sys_msgget(key_t key, int msgflg); }
202 NOARGS { int sys_msgrcv(int msqid, void *msgp, size_t msgsz, \
int msgflg); }
203 NOARGS { int sys_msgsnd(int msqid, void *msgp, size_t msgsz, \
int msgflg); }
#else
200 UNIMPL msgctl
201 UNIMPL msgget
202 UNIMPL msgrcv
203 UNIMPL msgsnd
#endif
#ifdef SYSVSEM
204 NOARGS { int linux_sys_semctl(int semid, int semnum, \
int cmd, union linux_semun arg); }
205 NOARGS { int sys_semget(key_t key, int nsems, int semflg); }
206 NOARGS { int sys_semop(int semid, struct sembuf *sops, \
unsigned u_int nsops); }
#else
204 UNIMPL semctl
205 UNIMPL semget
206 UNIMPL semop
#endif
;207 OBSOL osf_utsname, NOT USED XXX XAX
207 STD { int linux_sys_olduname(struct linux_old_utsname *up); }
208 STD { int linux_sys_lchown(char *path, int uid, int gid); }
#ifdef SYSVSHM
209 NOARGS { int linux_sys_shmat(int shmid, void *shmaddr, \
int shmflg, u_long *raddr); }
210 NOARGS { int linux_sys_shmctl(int shmid, int cmd, \
struct linux_shmid_ds *buf); }
211 NOARGS { int sys_shmdt(void *shmaddr); }
212 NOARGS { int sys_shmget(key_t key, int size, int shmflg); }
#else
209 UNIMPL shmat
210 UNIMPL shmctl
211 UNIMPL shmdt
212 UNIMPL shmget
#endif
213 UNIMPL
214 UNIMPL
215 UNIMPL
216 UNIMPL
217 STD { int linux_sys_msync(caddr_t addr, int len, int fl); }
218 UNIMPL osf_signal
219 UNIMPL
220 UNIMPL
221 UNIMPL
222 UNIMPL
223 UNIMPL
224 UNIMPL
225 UNIMPL
226 UNIMPL
227 UNIMPL
228 UNIMPL
229 UNIMPL
230 UNIMPL
231 UNIMPL
232 UNIMPL
233 STD { int linux_sys_getpgid(int pid); }
234 NOARGS { pid_t sys_getsid(pid_t pid); }
235 UNIMPL
236 UNIMPL
237 UNIMPL
238 UNIMPL
239 UNIMPL
240 UNIMPL
241 UNIMPL osf_sysinfo
242 UNIMPL
243 UNIMPL
244 UNIMPL osf_proplist_syscall
245 UNIMPL
246 UNIMPL
247 UNIMPL
248 UNIMPL
249 UNIMPL
250 UNIMPL
251 UNIMPL osf_usleep_thread
252 UNIMPL
253 UNIMPL
254 UNIMPL sysfs
255 UNIMPL
256 UNIMPL osf_getsysinfo
257 UNIMPL osf_setsysinfo
258 UNIMPL
259 UNIMPL
260 UNIMPL
; ???: fdatasync isn't implemented in Linux.
261 STD { int linux_sys_fdatasync(int fd); }
262 UNIMPL
263 UNIMPL
264 UNIMPL
265 UNIMPL
266 UNIMPL
267 UNIMPL
268 UNIMPL
269 UNIMPL
270 UNIMPL
271 UNIMPL
272 UNIMPL
273 UNIMPL
274 UNIMPL
275 UNIMPL
276 UNIMPL
277 UNIMPL
278 UNIMPL
279 UNIMPL
280 UNIMPL
281 UNIMPL
282 UNIMPL
283 UNIMPL
284 UNIMPL
285 UNIMPL
286 UNIMPL
287 UNIMPL
288 UNIMPL
289 UNIMPL
290 UNIMPL
291 UNIMPL
292 UNIMPL
293 UNIMPL
294 UNIMPL
295 UNIMPL
296 UNIMPL
297 UNIMPL
298 UNIMPL
299 UNIMPL
300 UNIMPL bdflush
301 UNIMPL sethae
302 UNIMPL mount
303 UNIMPL old_adjtimex
304 UNIMPL swapoff
305 STD { int linux_sys_getdents(int fd, \
struct linux_dirent *dent, unsigned int count); }
306 UNIMPL create_module
307 UNIMPL init_module
308 UNIMPL delete_module
309 UNIMPL get_kernel_syms
310 UNIMPL syslog
311 NOARGS { int sys_reboot(int opt); }
312 UNIMPL clone
; XXX XAX does alpha linux really have a.out exec?
#ifdef EXEC_AOUT
313 STD { int linux_sys_uselib(char *path); }
#else
313 UNIMPL sys_uselib
#endif
314 NOARGS { int sys_mlock(const void *addr, size_t len); }
315 NOARGS { int sys_munlock(const void *addr, size_t len); }
316 UNIMPL mlockall
317 UNIMPL munlockall
318 UNIMPL sysinfo
319 STD { int linux_sys___sysctl(struct linux___sysctl *lsp); }
320 UNIMPL idle
321 UNIMPL umount
322 NOARGS { int compat_12_sys_swapon(char *name); }
323 STD { int linux_sys_times(struct times *tms); }
324 STD { int linux_sys_personality(int per); }
325 UNIMPL setfsuid
326 UNIMPL setfsgid
327 UNIMPL ustat
328 STD { int linux_sys_statfs(char *path, \
struct linux_statfs *sp); }
329 STD { int linux_sys_fstatfs(int fd, \
struct linux_statfs *sp); }
330 UNIMPL sched_setparam
331 UNIMPL sched_getparam
332 UNIMPL sched_setscheduler
333 UNIMPL sched_getscheduler
334 UNIMPL sched_yield
335 UNIMPL sched_get_priority_max
336 UNIMPL sched_get_priority_min
337 UNIMPL sched_rr_get_interval
338 UNIMPL afs_syscall
339 STD { int linux_sys_uname(struct linux_utsname *up); }
340 NOARGS { int sys_nanosleep(const struct timespec *rqtp, \
struct timespec *rmtp); }
341 STD { void *linux_sys_mremap(void *old_address, \
size_t old_size, size_t new_size, u_long flags); }
342 UNIMPL nfsservctl
343 UNIMPL setresgid
344 UNIMPL getresgid
345 UNIMPL pciconfig_read
346 UNIMPL pciconfig_write
347 UNIMPL query_module
348 UNIMPL prctl
349 UNIMPL pread
350 UNIMPL pwrite
351 STD { int linux_sys_rt_sigreturn( \
struct linux_rt_sigframe *sfp); }
352 STD { int linux_sys_rt_sigaction(int signum, \
const struct linux_sigaction *nsa, \
struct linux_sigaction *osa, \
size_t sigsetsize); }
353 STD { int linux_sys_rt_sigprocmask(int how, \
const linux_sigset_t *set, \
linux_sigset_t *oset, \
size_t sigsetsize); }
354 STD { int linux_sys_rt_sigpending( \
linux_sigset_t *set, \
size_t sigsetsize); }
355 UNIMPL rt_sigtimedwait
; XXX XAX int here? sigset_t here?
356 STD { int linux_sys_rt_queueinfo(int pid, int signum, \
siginfo_t *uinfo); }
357 STD { int linux_sys_rt_sigsuspend(linux_sigset_t *unewset, \
size_t sigsetsize); }
358 STD { int linux_sys_select(int nfds, fd_set *readfds, \
fd_set *writefds, fd_set *exceptfds, \
struct timeval *timeout); }
359 NOARGS { int sys_gettimeofday(struct timeval *tp, \
struct timezone *tzp); }
360 NOARGS { int sys_settimeofday(struct timeval *tp, \
struct timezone *tzp); }
361 NOARGS { int sys_getitimer(u_int which, \
struct itimerval *itv); }
362 NOARGS { int sys_setitimer(u_int which, \
struct itimerval *itv, struct itimerval *oitv); }
; XXX XAX Is this correct? no. utime is a lib call. utimes is the syscall
; do we need translation here? I don't think so.
; what?
363 NOARGS { int sys_utimes(char *path, \
struct timecal *times); }
364 NOARGS { int sys_getrusage(int who, struct rusage *rusage); }
365 STD { int linux_sys_wait4(int pid, int *status, \
int options, struct rusage *rusage); }
366 UNIMPL adjtimex
;367-369 UNIMPL(sys_ni_syscall)

View File

@ -0,0 +1,12 @@
# $NetBSD: Makefile,v 1.1 1998/09/30 18:01:53 erh Exp $
KDIR= /sys/compat/linux/alpha
INCSDIR= /usr/include/compat/linux/alpha
INCS= linux_errno.h linux_exec.h linux_fcntl.h linux_machdep.h linux_mmap.h \
linux_siginfo.h linux_signal.h linux_socket.h linux_syscall.h \
linux_syscallargs.h linux_types.h
.include <../Makefile.sc>
.include <bsd.kinc.mk>

View File

@ -0,0 +1,11 @@
# $NetBSD: files.linux_alpha,v 1.1 1998/09/30 18:01:53 erh Exp $
#
# Config file description for alpha-dependent Linux compat code.
file compat/linux/alpha/linux_machdep.c compat_linux
file compat/linux/alpha/linux_syscalls.c compat_linux
file compat/linux/alpha/linux_sysent.c compat_linux
file compat/linux/alpha/linux_pipe.c compat_linux
file compat/linux/alpha/linux_sigarray.c compat_linux
# XXX olduname = osf_utsname on Linux. Possibly not used.
file compat/linux/multiarch/linux_olduname.c compat_linux

View File

@ -0,0 +1,12 @@
# $NetBSD: syscalls.conf,v 1.1 1998/09/30 18:01:53 erh Exp $
sysnames="linux_syscalls.c"
sysnumhdr="linux_syscall.h"
syssw="linux_sysent.c"
sysarghdr="linux_syscallargs.h"
compatopts=""
libcompatopts=""
switchname="linux_sysent"
namesname="linux_syscallnames"
constprefix="LINUX_SYS_"

View File

@ -0,0 +1,543 @@
$NetBSD: syscalls.master,v 1.1 1998/09/30 18:01:54 erh Exp $
; @(#)syscalls.master 8.1 (Berkeley) 7/19/93
; NetBSD alpha 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.
;
; (ERH: 5/26/98)
;
; XXX XAX todo:
; check arguments.
; kill not used functions. (ifdef the actual code)
;
; NOT USED = This syscall is not really used in Linux, except in its
; osf compat mode. Since Linux binaries shouldn't ever
; call it and osf binaries run under a different emulation,
; it shouldn't matter that the linux version of the
; function might not DTRT. Define it anyway so we
; don't have to split off or ifdef the associated function.
; A bit better might be to have makesyscalls identify this
; as "define but don't include in table" so it doesn't actually
; ever get called.
; UNIMPL <blank> = not implemented here nor in linux source
; UNIMPL osf_* = osf functions implemented in linux, not here.
;
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/signal.h>
#include <sys/mount.h>
#include <sys/syscallargs.h>
#include <compat/linux/linux_types.h>
#include <compat/linux/linux_signal.h>
#include <compat/linux/linux_siginfo.h>
#include <compat/linux/alpha/linux_syscallargs.h>
#include <compat/linux/linux_ipc.h>
#include <compat/linux/linux_msg.h>
#include <compat/linux/linux_sem.h>
#include <compat/linux/linux_shm.h>
;#include <compat/linux/linux_machdep.h>
0 NOARGS { int 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 UNIMPL
6 NOARGS { int sys_close(int fd); }
7 UNIMPL osf_wait4
;8 OBSOL osf_old_creat, NOT USED. XXX XAX
8 STD { int linux_sys_creat(char *path, int mode); }
9 NOARGS { int sys_link(char *path, char *link); }
10 STD { int linux_sys_unlink(char *path); }
11 UNIMPL
12 STD { int linux_sys_chdir(char *path); }
13 NOARGS { int sys_fchdir(int fd); }
14 STD { int linux_sys_mknod(char *path, int mode, int dev); }
15 STD { int linux_sys_chmod(char *path, int mode); }
16 STD { int linux_sys_chown(char *path, int uid, int gid); }
;17 ALIAS osf_brk
17 STD { int linux_sys_brk(char *nsize); }
18 UNIMPL
19 NOARGS { long compat_43_sys_lseek(int fd, long offset, \
int whence); }
20 NOARGS { pid_t sys_getpid(void); }
21 UNIMPL osf_mount
22 UNIMPL osf_umount
23 NOARGS { int sys_setuid(uid_t uid); }
24 NOARGS { uid_t sys_getuid(void); }
25 UNIMPL
26 UNIMPL ptrace
27 UNIMPL
28 UNIMPL
29 UNIMPL
30 UNIMPL
31 UNIMPL
32 UNIMPL
33 STD { int linux_sys_access(char *path, int flags); }
34 UNIMPL
35 UNIMPL
36 NOARGS { int sys_sync(void); }
37 STD { int linux_sys_kill(int pid, int signum); }
38 UNIMPL
39 NOARGS { int sys_setpgid(int pid, int pgid); }
40 UNIMPL
41 NOARGS { int sys_dup(u_int fd); }
42 NOARGS { int linux_sys_pipe(void); }
43 UNIMPL osf_set_program_attributes
44 UNIMPL
45 STD { int linux_sys_open(char *path, int flags, int mode); }
46 UNIMPL
47 NOARGS { gid_t sys_getgid(void); }
48 UNIMPL osf_sigprocmask
49 UNIMPL
50 UNIMPL
51 NOARGS { int sys_acct(char *path); }
52 STD { int linux_sys_sigpending(linux_old_sigset_t *set); }
53 UNIMPL
54 STD { int linux_sys_ioctl(int fd, u_long com, \
caddr_t data); }
55 UNIMPL
56 UNIMPL
57 STD { int linux_sys_symlink(char *path, char *to); }
58 STD { int linux_sys_readlink(char *name, char *buf, \
int count); }
59 STD { int linux_sys_execve(char *path, char **argp, \
char **envp); }
60 NOARGS { int sys_umask(int newmask); }
61 NOARGS { int sys_chroot(char *path); }
62 UNIMPL
63 NOARGS { int sys_getpgrp(void); }
64 NOARGS { int compat_43_sys_getpagesize(void); }
65 UNIMPL
66 UNIMPL osf_vfork
67 STD { int linux_sys_stat(char *path, \
struct linux_stat *sp); }
68 STD { int linux_sys_lstat(char *path, \
struct linux_stat *sp); }
69 UNIMPL
70 UNIMPL
71 STD { int linux_sys_mmap(unsigned long addr, size_t len, \
int prot, int flags, int fd, off_t offset); }
72 UNIMPL
73 NOARGS { int sys_munmap(caddr_t addr, int len); }
74 NOARGS { int sys_mprotect(caddr_t addr, int len, int prot); }
75 UNIMPL madvise
76 UNIMPL vhangup
77 UNIMPL
78 UNIMPL
79 NOARGS { int sys_getgroups(u_int gidsetsize, gid_t *gidset); }
80 NOARGS { int sys_setgroups(u_int gidsetsize, gid_t *gidset); }
81 UNIMPL
82 UNIMPL setpgrp
;83: Uses int for seconds, and time_t. so need different itimerval struct.
83 UNIMPL osf_setitimer
84 UNIMPL
85 UNIMPL
;86: Uses int for seconds, and time_t. so need different itimerval struct.
86 UNIMPL osf_getitimer
; XXX XAX here, check args match.
87 NOARGS { int compat_43_sys_gethostname(char *hostname, \
u_int len); }
88 NOARGS { int compat_43_sys_sethostname(char *hostname, \
u_int len); }
89 UNIMPL getdtablesize
90 NOARGS { int sys_dup2(u_int from, u_int to); }
91 STD { int linux_sys_fstat(int fd, struct linux_stat *sp); }
92 STD { int linux_sys_fcntl(int fd, int cmd, void *arg); }
93 UNIMPL osf_select
94 UNIMPL poll
95 NOARGS { int sys_fsync(int fd); }
96 NOARGS { int sys_setpriority(int which, int who, int prio); }
97 STD { int linux_sys_socket(int domain, int type, \
int protocol); }
98 NOARGS { int sys_connect(int s, const struct sockaddr *name, \
int namelen); }
99 NOARGS { int compat_43_sys_accept(int s, \
caddr_t name, int *anamelen); }
;100 ALIAS osf_getpriority
100 NOARGS { int sys_getpriority(int which, int who); }
101 NOARGS { int compat_43_sys_send(int s, caddr_t buf, int len, \
int flags); }
102 NOARGS { int compat_43_sys_recv(int s, caddr_t buf, int len, \
int flags); }
103 STD { int linux_sys_sigreturn(struct linux_sigframe *sfp); }
104 NOARGS { int sys_bind(int s, const struct sockaddr *name, \
int namelen); }
105 STD { int linux_sys_setsockopt(int s, int level, \
int optname, void *optval, int optlen); }
106 NOARGS { int sys_listen(int s, int backlog); }
107 UNIMPL
108 UNIMPL
109 UNIMPL
110 UNIMPL
111 STD { int linux_sys_sigsuspend(caddr_t restart, \
int oldmask, int mask); }
112 UNIMPL
113 NOARGS { int sys_recvmsg(int fd, struct msghdr *msg, \
u_int flags); }
114 NOARGS { int sys_sendmsg(int fd, struct msghdr *msg, \
u_int flags); }
115 UNIMPL
116 UNIMPL osf_gettimeofday
117 UNIMPL osf_getrusage
118 STD { int linux_sys_getsockopt(int s, int level, \
int optname, void *optval, int *optlen); }
119 UNIMPL
120 NOARGS { int sys_readv(int fd, struct iovec *iovp, \
u_int iovcnt); }
121 NOARGS { int sys_writev(int fd, struct iovec *iovp, \
u_int iovcnt); }
122 UNIMPL osf_settimeofday
123 STD { int linux_sys_fchown(int fd, int uid, int gid); }
124 NOARGS { int sys_fchmod(int fd, int mode); }
125 STD { int linux_sys_recvfrom(int s, void *buf, int len, \
int flags, struct sockaddr *from, \
int *fromlen); }
126 STD { int linux_sys_setreuid(int ruid, int euid); }
127 STD { int linux_sys_setregid(int rgid, int egid); }
128 STD { int linux_sys_rename(char *from, char *to); }
129 STD { int linux_sys_truncate(char *path, long length); }
130 NOARGS { int compat_43_sys_ftruncate(int fd, long length); }
131 NOARGS { int sys_flock(int fd, int how); }
132 NOARGS { int sys_setgid(gid_t gid); }
133 STD { int linux_sys_sendto(int s, void *msg, int len, \
int flags, struct sockaddr *to, int tolen); }
134 NOARGS { int sys_shutdown(int s, int how); }
135 STD { int linux_sys_socketpair(int domain, int type, \
int protocol, int *rsv); }
136 STD { int linux_sys_mkdir(char *path, int mode); }
137 STD { int linux_sys_rmdir(char *path); }
138 UNIMPL osf_utimes
139 UNIMPL
140 UNIMPL
141 NOARGS { int compat_43_sys_getpeername(int fdes, \
caddr_t asa, int *alen); }
142 UNIMPL
143 UNIMPL
144 NOARGS { int compat_43_sys_getrlimit(u_int which, \
struct orlimit *rlp); }
145 NOARGS { int compat_43_sys_setrlimit(u_int which, \
struct orlimit *rlp); }
146 UNIMPL
147 NOARGS { int sys_setsid(void); }
148 UNIMPL quotactl
149 UNIMPL
150 NOARGS { int compat_43_sys_getsockname(int fdec, \
caddr_t asa, int *alen); }
151 UNIMPL
152 UNIMPL
153 UNIMPL
154 UNIMPL
155 UNIMPL
;156 ALIAS osf_sigaction
156 STD { int linux_sys_sigaction(int signum, \
const struct linux_old_sigaction *nsa, \
struct linux_old_sigaction *osa); }
157 UNIMPL
158 UNIMPL
159 UNIMPL osf_getdirentries
160 UNIMPL osf_statfs
161 UNIMPL osf_fstatfs
162 UNIMPL
163 UNIMPL
164 UNIMPL
165 UNIMPL osf_getdomainname
;166 ALIAS osf_setdomainname
166 UNIMPL setdomainname
167 UNIMPL
168 UNIMPL
169 UNIMPL
170 UNIMPL
171 UNIMPL
172 UNIMPL
173 UNIMPL
174 UNIMPL
175 UNIMPL
176 UNIMPL
177 UNIMPL
178 UNIMPL
179 UNIMPL
180 UNIMPL
181 UNIMPL
182 UNIMPL
183 UNIMPL
184 UNIMPL
185 UNIMPL
186 UNIMPL
187 UNIMPL
188 UNIMPL
189 UNIMPL
190 UNIMPL
191 UNIMPL
192 UNIMPL
193 UNIMPL
194 UNIMPL
195 UNIMPL
196 UNIMPL
197 UNIMPL
198 UNIMPL
199 UNIMPL osf_swapon
#ifdef SYSVMSG
200 NOARGS { int linux_sys_msgctl(int msqid, int cmd, \
struct linux_msqid_ds *buf); }
201 NOARGS { int sys_msgget(key_t key, int msgflg); }
202 NOARGS { int sys_msgrcv(int msqid, void *msgp, size_t msgsz, \
int msgflg); }
203 NOARGS { int sys_msgsnd(int msqid, void *msgp, size_t msgsz, \
int msgflg); }
#else
200 UNIMPL msgctl
201 UNIMPL msgget
202 UNIMPL msgrcv
203 UNIMPL msgsnd
#endif
#ifdef SYSVSEM
204 NOARGS { int linux_sys_semctl(int semid, int semnum, \
int cmd, union linux_semun arg); }
205 NOARGS { int sys_semget(key_t key, int nsems, int semflg); }
206 NOARGS { int sys_semop(int semid, struct sembuf *sops, \
unsigned u_int nsops); }
#else
204 UNIMPL semctl
205 UNIMPL semget
206 UNIMPL semop
#endif
;207 OBSOL osf_utsname, NOT USED XXX XAX
207 STD { int linux_sys_olduname(struct linux_old_utsname *up); }
208 STD { int linux_sys_lchown(char *path, int uid, int gid); }
#ifdef SYSVSHM
209 NOARGS { int linux_sys_shmat(int shmid, void *shmaddr, \
int shmflg, u_long *raddr); }
210 NOARGS { int linux_sys_shmctl(int shmid, int cmd, \
struct linux_shmid_ds *buf); }
211 NOARGS { int sys_shmdt(void *shmaddr); }
212 NOARGS { int sys_shmget(key_t key, int size, int shmflg); }
#else
209 UNIMPL shmat
210 UNIMPL shmctl
211 UNIMPL shmdt
212 UNIMPL shmget
#endif
213 UNIMPL
214 UNIMPL
215 UNIMPL
216 UNIMPL
217 STD { int linux_sys_msync(caddr_t addr, int len, int fl); }
218 UNIMPL osf_signal
219 UNIMPL
220 UNIMPL
221 UNIMPL
222 UNIMPL
223 UNIMPL
224 UNIMPL
225 UNIMPL
226 UNIMPL
227 UNIMPL
228 UNIMPL
229 UNIMPL
230 UNIMPL
231 UNIMPL
232 UNIMPL
233 STD { int linux_sys_getpgid(int pid); }
234 NOARGS { pid_t sys_getsid(pid_t pid); }
235 UNIMPL
236 UNIMPL
237 UNIMPL
238 UNIMPL
239 UNIMPL
240 UNIMPL
241 UNIMPL osf_sysinfo
242 UNIMPL
243 UNIMPL
244 UNIMPL osf_proplist_syscall
245 UNIMPL
246 UNIMPL
247 UNIMPL
248 UNIMPL
249 UNIMPL
250 UNIMPL
251 UNIMPL osf_usleep_thread
252 UNIMPL
253 UNIMPL
254 UNIMPL sysfs
255 UNIMPL
256 UNIMPL osf_getsysinfo
257 UNIMPL osf_setsysinfo
258 UNIMPL
259 UNIMPL
260 UNIMPL
; ???: fdatasync isn't implemented in Linux.
261 STD { int linux_sys_fdatasync(int fd); }
262 UNIMPL
263 UNIMPL
264 UNIMPL
265 UNIMPL
266 UNIMPL
267 UNIMPL
268 UNIMPL
269 UNIMPL
270 UNIMPL
271 UNIMPL
272 UNIMPL
273 UNIMPL
274 UNIMPL
275 UNIMPL
276 UNIMPL
277 UNIMPL
278 UNIMPL
279 UNIMPL
280 UNIMPL
281 UNIMPL
282 UNIMPL
283 UNIMPL
284 UNIMPL
285 UNIMPL
286 UNIMPL
287 UNIMPL
288 UNIMPL
289 UNIMPL
290 UNIMPL
291 UNIMPL
292 UNIMPL
293 UNIMPL
294 UNIMPL
295 UNIMPL
296 UNIMPL
297 UNIMPL
298 UNIMPL
299 UNIMPL
300 UNIMPL bdflush
301 UNIMPL sethae
302 UNIMPL mount
303 UNIMPL old_adjtimex
304 UNIMPL swapoff
305 STD { int linux_sys_getdents(int fd, \
struct linux_dirent *dent, unsigned int count); }
306 UNIMPL create_module
307 UNIMPL init_module
308 UNIMPL delete_module
309 UNIMPL get_kernel_syms
310 UNIMPL syslog
311 NOARGS { int sys_reboot(int opt); }
312 UNIMPL clone
; XXX XAX does alpha linux really have a.out exec?
#ifdef EXEC_AOUT
313 STD { int linux_sys_uselib(char *path); }
#else
313 UNIMPL sys_uselib
#endif
314 NOARGS { int sys_mlock(const void *addr, size_t len); }
315 NOARGS { int sys_munlock(const void *addr, size_t len); }
316 UNIMPL mlockall
317 UNIMPL munlockall
318 UNIMPL sysinfo
319 STD { int linux_sys___sysctl(struct linux___sysctl *lsp); }
320 UNIMPL idle
321 UNIMPL umount
322 NOARGS { int compat_12_sys_swapon(char *name); }
323 STD { int linux_sys_times(struct times *tms); }
324 STD { int linux_sys_personality(int per); }
325 UNIMPL setfsuid
326 UNIMPL setfsgid
327 UNIMPL ustat
328 STD { int linux_sys_statfs(char *path, \
struct linux_statfs *sp); }
329 STD { int linux_sys_fstatfs(int fd, \
struct linux_statfs *sp); }
330 UNIMPL sched_setparam
331 UNIMPL sched_getparam
332 UNIMPL sched_setscheduler
333 UNIMPL sched_getscheduler
334 UNIMPL sched_yield
335 UNIMPL sched_get_priority_max
336 UNIMPL sched_get_priority_min
337 UNIMPL sched_rr_get_interval
338 UNIMPL afs_syscall
339 STD { int linux_sys_uname(struct linux_utsname *up); }
340 NOARGS { int sys_nanosleep(const struct timespec *rqtp, \
struct timespec *rmtp); }
341 STD { void *linux_sys_mremap(void *old_address, \
size_t old_size, size_t new_size, u_long flags); }
342 UNIMPL nfsservctl
343 UNIMPL setresgid
344 UNIMPL getresgid
345 UNIMPL pciconfig_read
346 UNIMPL pciconfig_write
347 UNIMPL query_module
348 UNIMPL prctl
349 UNIMPL pread
350 UNIMPL pwrite
351 STD { int linux_sys_rt_sigreturn( \
struct linux_rt_sigframe *sfp); }
352 STD { int linux_sys_rt_sigaction(int signum, \
const struct linux_sigaction *nsa, \
struct linux_sigaction *osa, \
size_t sigsetsize); }
353 STD { int linux_sys_rt_sigprocmask(int how, \
const linux_sigset_t *set, \
linux_sigset_t *oset, \
size_t sigsetsize); }
354 STD { int linux_sys_rt_sigpending( \
linux_sigset_t *set, \
size_t sigsetsize); }
355 UNIMPL rt_sigtimedwait
; XXX XAX int here? sigset_t here?
356 STD { int linux_sys_rt_queueinfo(int pid, int signum, \
siginfo_t *uinfo); }
357 STD { int linux_sys_rt_sigsuspend(linux_sigset_t *unewset, \
size_t sigsetsize); }
358 STD { int linux_sys_select(int nfds, fd_set *readfds, \
fd_set *writefds, fd_set *exceptfds, \
struct timeval *timeout); }
359 NOARGS { int sys_gettimeofday(struct timeval *tp, \
struct timezone *tzp); }
360 NOARGS { int sys_settimeofday(struct timeval *tp, \
struct timezone *tzp); }
361 NOARGS { int sys_getitimer(u_int which, \
struct itimerval *itv); }
362 NOARGS { int sys_setitimer(u_int which, \
struct itimerval *itv, struct itimerval *oitv); }
; XXX XAX Is this correct? no. utime is a lib call. utimes is the syscall
; do we need translation here? I don't think so.
; what?
363 NOARGS { int sys_utimes(char *path, \
struct timecal *times); }
364 NOARGS { int sys_getrusage(int who, struct rusage *rusage); }
365 STD { int linux_sys_wait4(int pid, int *status, \
int options, struct rusage *rusage); }
366 UNIMPL adjtimex
;367-369 UNIMPL(sys_ni_syscall)