summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authornjoly <njoly@NetBSD.org>2007-11-07 00:24:29 +0000
committernjoly <njoly@NetBSD.org>2007-11-07 00:24:29 +0000
commitb32d95bfbf7aed71069ea7b5d733075cffc6f626 (patch)
treeb4faeecf22c938c1e097afcc3a8ef566d3863607 /sys
parent9b336836dfece87ee8bd7c7b99f79842ef6f6d70 (diff)
Remove remaining 64-bit compat linux syscalls linux_sys_xxx() (except
for ones without arguments), and replace them by their 32-bit equivalent linux32_sys_xxxx().
Diffstat (limited to 'sys')
-rw-r--r--sys/compat/linux/common/linux_misc.c6
-rw-r--r--sys/compat/linux/common/linux_misc_notalpha.c8
-rw-r--r--sys/compat/linux32/arch/amd64/syscalls.master24
-rw-r--r--sys/compat/linux32/common/linux32_sched.c35
-rw-r--r--sys/compat/linux32/common/linux32_unistd.c176
5 files changed, 227 insertions, 22 deletions
diff --git a/sys/compat/linux/common/linux_misc.c b/sys/compat/linux/common/linux_misc.c
index 94c927062cd..7095990e969 100644
--- a/sys/compat/linux/common/linux_misc.c
+++ b/sys/compat/linux/common/linux_misc.c
@@ -1,4 +1,4 @@
-/* $NetBSD: linux_misc.c,v 1.184 2007/10/19 18:52:11 njoly Exp $ */
+/* $NetBSD: linux_misc.c,v 1.185 2007/11/07 00:24:29 njoly Exp $ */
/*-
* Copyright (c) 1995, 1998, 1999 The NetBSD Foundation, Inc.
@@ -64,7 +64,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: linux_misc.c,v 1.184 2007/10/19 18:52:11 njoly Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_misc.c,v 1.185 2007/11/07 00:24:29 njoly Exp $");
#if defined(_KERNEL_OPT)
#include "opt_ptrace.h"
@@ -1032,6 +1032,7 @@ linux_sys_personality(struct lwp *l, void *v, register_t *retval)
/*
* The calls are here because of type conversions.
*/
+#ifndef COMPAT_LINUX32
int
linux_sys_setreuid16(l, v, retval)
struct lwp *l;
@@ -1117,6 +1118,7 @@ linux_sys_setresgid16(l, v, retval)
return linux_sys_setresgid(l, &lsa, retval);
}
+#endif /* COMPAT_LINUX32 */
int
linux_sys_getgroups16(l, v, retval)
diff --git a/sys/compat/linux/common/linux_misc_notalpha.c b/sys/compat/linux/common/linux_misc_notalpha.c
index 7df2899092f..a376bcee4ee 100644
--- a/sys/compat/linux/common/linux_misc_notalpha.c
+++ b/sys/compat/linux/common/linux_misc_notalpha.c
@@ -1,4 +1,4 @@
-/* $NetBSD: linux_misc_notalpha.c,v 1.95 2007/10/19 18:52:11 njoly Exp $ */
+/* $NetBSD: linux_misc_notalpha.c,v 1.96 2007/11/07 00:24:30 njoly Exp $ */
/*-
* Copyright (c) 1995, 1998 The NetBSD Foundation, Inc.
@@ -38,7 +38,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: linux_misc_notalpha.c,v 1.95 2007/10/19 18:52:11 njoly Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_misc_notalpha.c,v 1.96 2007/11/07 00:24:30 njoly Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -188,7 +188,7 @@ linux_sys_alarm(l, v, retval)
}
#endif /* !COMPAT_LINUX32 */
-#if !defined(__amd64__) || defined(COMPAT_LINUX32)
+#if !defined(__amd64__)
int
linux_sys_nice(l, v, retval)
struct lwp *l;
@@ -205,7 +205,7 @@ linux_sys_nice(l, v, retval)
SCARG(&bsa, prio) = SCARG(uap, incr);
return sys_setpriority(l, &bsa, retval);
}
-#endif /* !__amd64__ || COMPAT_LINUX32 */
+#endif /* !__amd64__ */
#ifndef COMPAT_LINUX32
#ifndef __amd64__
diff --git a/sys/compat/linux32/arch/amd64/syscalls.master b/sys/compat/linux32/arch/amd64/syscalls.master
index b3612430138..e262f75670d 100644
--- a/sys/compat/linux32/arch/amd64/syscalls.master
+++ b/sys/compat/linux32/arch/amd64/syscalls.master
@@ -1,4 +1,4 @@
- $NetBSD: syscalls.master,v 1.18 2007/10/31 22:35:34 dsl Exp $
+ $NetBSD: syscalls.master,v 1.19 2007/11/07 00:24:30 njoly Exp $
; NetBSD i386 COMPAT_LINUX32 system call name/number "master" file.
; (See syscalls.conf to see what it is processed into.)
@@ -98,7 +98,7 @@
24 NOARGS linux_getuid16 { uid_t sys_getuid(void); }
25 STD { int linux32_sys_stime(linux32_timep_t t); }
26 UNIMPL ptrace
-27 NOARGS { int linux_sys_alarm(unsigned int secs); }
+27 STD { int linux32_sys_alarm(unsigned int secs); }
28 OBSOL ofstat
29 NOARGS { int linux_sys_pause(void); }
30 STD { int linux32_sys_utime(const netbsd32_charp path, \
@@ -107,7 +107,7 @@
32 OBSOL gtty
33 NOARGS { int netbsd32_access(const netbsd32_charp path, \
int flags); }
-34 NOARGS { int linux_sys_nice(int incr); }
+34 STD { int linux32_sys_nice(int incr); }
35 OBSOL ftime
36 NOARGS { int sys_sync(void); }
37 STD { int linux32_sys_kill(int pid, int signum); }
@@ -148,8 +148,8 @@
67 UNIMPL sigaction
68 UNIMPL siggetmask
69 UNIMPL sigsetmask
-70 STD { int linux_sys_setreuid16(int ruid, int euid); }
-71 STD { int linux_sys_setregid16(int rgid, int egid); }
+70 STD { int linux32_sys_setreuid16(int ruid, int euid); }
+71 STD { int linux32_sys_setregid16(int rgid, int egid); }
72 UNIMPL sigsuspend
73 UNIMPL sigpending
74 NOARGS { int compat_43_netbsd32_osethostname(netbsd32_charp hostname, \
@@ -235,7 +235,7 @@
135 UNIMPL sysfs
136 UNIMPL personality
137 UNIMPL afs_syscall
-138 NOARGS setfsuid16 { int linux_sys_setfsuid(uid_t uid); }
+138 NOARGS setfsuid16 { int linux32_sys_setfsuid(uid_t uid); }
139 NOARGS getfsuid16 { int linux_sys_getfsuid(void); }
140 STD { int linux32_sys_llseek(int fd, u_int32_t ohigh, \
u_int32_t olow, netbsd32_caddr_t res, int whence); }
@@ -253,7 +253,7 @@
146 NOARGS { netbsd32_ssize_t netbsd32_writev(int fd, \
const netbsd32_iovecp_t iovp, int iovcnt); }
147 NOARGS { pid_t netbsd32_getsid(pid_t pid); }
-148 NOARGS { int linux_sys_fdatasync(int fd); }
+148 STD { int linux32_sys_fdatasync(int fd); }
149 STD { int linux32_sys___sysctl(linux32___sysctlp_t lsp); }
150 UNIMPL mlock
151 UNIMPL munlock
@@ -264,7 +264,7 @@
linux32_sched_paramp_t sp); }
156 STD { int linux32_sys_sched_setscheduler(pid_t pid, \
int policy, const linux32_sched_paramp_t sp); }
-157 NOARGS { int linux_sys_sched_getscheduler(pid_t pid); }
+157 STD { int linux32_sys_sched_getscheduler(pid_t pid); }
158 NOARGS { int linux_sys_sched_yield(void); }
159 UNIMPL sched_get_priority_max
160 UNIMPL sched_get_priority_min
@@ -275,7 +275,7 @@
163 STD { int linux32_sys_mremap(netbsd32_voidp old_address, \
netbsd32_size_t old_size , netbsd32_size_t new_size, \
netbsd32_u_long flags); }
-164 NOARGS { int linux_sys_setresuid16(uid_t ruid, uid_t euid, \
+164 STD { int linux32_sys_setresuid16(uid_t ruid, uid_t euid, \
uid_t suid); }
165 UNIMPL getresuid16
166 UNIMPL vm86
@@ -283,7 +283,7 @@
168 NOARGS { int netbsd32_poll(netbsd32_pollfdp_t fds, u_int nfds, \
int timeout); }
169 UNIMPL nfsservctl
-170 NOARGS { int linux_sys_setresgid16(gid_t rgid, gid_t egid, \
+170 STD { int linux32_sys_setresgid16(gid_t rgid, gid_t egid, \
gid_t sgid); }
171 UNIMPL int
172 UNIMPL prctl
@@ -350,7 +350,7 @@
int uid, int gid); }
213 NOARGS { int netbsd32_setuid(uid_t uid); }
214 NOARGS { int netbsd32_setgid(gid_t gid); }
-215 NOARGS { int linux_sys_setfsuid(uid_t uid); }
+215 STD { int linux32_sys_setfsuid(uid_t uid); }
216 NOARGS { int linux_sys_getfsuid(void); }
217 UNIMPL pivot_root
218 UNIMPL mincore
@@ -390,7 +390,7 @@
249 UNIMPL io_cancel
250 UNIMPL fadvise64
251 UNIMPL /* unused */
-252 NOARGS { int linux_sys_exit_group(int error_code); }
+252 STD { int linux32_sys_exit_group(int error_code); }
253 UNIMPL lookup_dcookie
254 UNIMPL epoll_create
255 UNIMPL epoll_ctl
diff --git a/sys/compat/linux32/common/linux32_sched.c b/sys/compat/linux32/common/linux32_sched.c
index ebab7f0c3f1..fd5f91b1717 100644
--- a/sys/compat/linux32/common/linux32_sched.c
+++ b/sys/compat/linux32/common/linux32_sched.c
@@ -1,4 +1,4 @@
-/* $NetBSD: linux32_sched.c,v 1.3 2007/02/09 21:55:21 ad Exp $ */
+/* $NetBSD: linux32_sched.c,v 1.4 2007/11/07 00:24:31 njoly Exp $ */
/*-
* Copyright (c) 2006 Emmanuel Dreyfus, all rights reserved.
@@ -33,7 +33,7 @@
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: linux32_sched.c,v 1.3 2007/02/09 21:55:21 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux32_sched.c,v 1.4 2007/11/07 00:24:31 njoly Exp $");
#include <sys/types.h>
#include <sys/param.h>
@@ -92,6 +92,22 @@ linux32_sys_clone(l, v, retval)
}
int
+linux32_sys_sched_getscheduler(l, v, retval)
+ struct lwp *l;
+ void *v;
+ register_t *retval;
+{
+ struct linux32_sys_sched_getscheduler_args /* {
+ syscallarg(pid_t) pid;
+ } */ *uap = v;
+ struct linux_sys_sched_getscheduler_args ua;
+
+ NETBSD32TO64_UAP(pid);
+
+ return linux_sys_sched_getscheduler(l, &ua, retval);
+}
+
+int
linux32_sys_sched_setscheduler(l, v, retval)
struct lwp *l;
void *v;
@@ -129,3 +145,18 @@ linux32_sys_sched_getparam(l, v, retval)
return linux_sys_sched_getparam(l, &ua, retval);
}
+int
+linux32_sys_exit_group(l, v, retval)
+ struct lwp *l;
+ void *v;
+ register_t *retval;
+{
+ struct linux32_sys_exit_group_args /* {
+ syscallarg(int) error_code;
+ } */ *uap = v;
+ struct linux_sys_exit_group_args ua;
+
+ NETBSD32TO64_UAP(error_code);
+
+ return linux_sys_exit_group(l, &ua, retval);
+}
diff --git a/sys/compat/linux32/common/linux32_unistd.c b/sys/compat/linux32/common/linux32_unistd.c
index 1620d4fc2f3..94e81922c8a 100644
--- a/sys/compat/linux32/common/linux32_unistd.c
+++ b/sys/compat/linux32/common/linux32_unistd.c
@@ -1,4 +1,4 @@
-/* $NetBSD: linux32_unistd.c,v 1.12 2007/10/31 21:04:02 njoly Exp $ */
+/* $NetBSD: linux32_unistd.c,v 1.13 2007/11/07 00:24:31 njoly Exp $ */
/*-
* Copyright (c) 2006 Emmanuel Dreyfus, all rights reserved.
@@ -33,7 +33,7 @@
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: linux32_unistd.c,v 1.12 2007/10/31 21:04:02 njoly Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux32_unistd.c,v 1.13 2007/11/07 00:24:31 njoly Exp $");
#include <sys/types.h>
#include <sys/param.h>
@@ -605,3 +605,175 @@ linux32_sys_setresgid(l, v, retval)
return linux_sys_setresgid(l, &ua, retval);
}
+
+int
+linux32_sys_nice(l, v, retval)
+ struct lwp *l;
+ void *v;
+ register_t *retval;
+{
+ struct linux32_sys_nice_args /* {
+ syscallarg(int) incr;
+ } */ *uap = v;
+ struct netbsd32_setpriority_args bsa;
+
+ SCARG(&bsa, which) = PRIO_PROCESS;
+ SCARG(&bsa, who) = 0;
+ SCARG(&bsa, prio) = SCARG(uap, incr);
+
+ return netbsd32_setpriority(l, &bsa, retval);
+}
+
+int
+linux32_sys_alarm(l, v, retval)
+ struct lwp *l;
+ void *v;
+ register_t *retval;
+{
+ struct linux32_sys_alarm_args /* {
+ syscallarg(unsigned int) secs;
+ } */ *uap = v;
+ struct linux_sys_alarm_args ua;
+
+ NETBSD32TO64_UAP(secs);
+
+ return linux_sys_alarm(l, &ua, retval);
+}
+
+int
+linux32_sys_fdatasync(l, v, retval)
+ struct lwp *l;
+ void *v;
+ register_t *retval;
+{
+ struct linux32_sys_fdatasync_args /* {
+ syscallarg(int) fd;
+ } */ *uap = v;
+ struct linux_sys_fdatasync_args ua;
+
+ NETBSD32TO64_UAP(fd);
+
+ return linux_sys_fdatasync(l, &ua, retval);
+}
+
+int
+linux32_sys_setfsuid(l, v, retval)
+ struct lwp *l;
+ void *v;
+ register_t *retval;
+{
+ struct linux32_sys_setfsuid_args /* {
+ syscallarg(uid_t) uid;
+ } */ *uap = v;
+ struct linux_sys_setfsuid_args ua;
+
+ NETBSD32TO64_UAP(uid);
+
+ return linux_sys_setfsuid(l, &ua, retval);
+}
+
+int
+linux32_sys_setreuid16(l, v, retval)
+ struct lwp *l;
+ void *v;
+ register_t *retval;
+{
+ struct linux32_sys_setreuid16_args /* {
+ syscallarg(int) ruid;
+ syscallarg(int) euid;
+ } */ *uap = v;
+ struct sys_setreuid_args bsa;
+
+ if ((linux32_uid_t)SCARG(uap, ruid) == (linux32_uid_t)-1)
+ SCARG(&bsa, ruid) = (uid_t)-1;
+ else
+ SCARG(&bsa, ruid) = SCARG(uap, ruid);
+ if ((linux32_uid_t)SCARG(uap, euid) == (linux32_uid_t)-1)
+ SCARG(&bsa, euid) = (uid_t)-1;
+ else
+ SCARG(&bsa, euid) = SCARG(uap, euid);
+
+ return sys_setreuid(l, &bsa, retval);
+}
+
+int
+linux32_sys_setregid16(l, v, retval)
+ struct lwp *l;
+ void *v;
+ register_t *retval;
+{
+ struct linux32_sys_setregid16_args /* {
+ syscallarg(int) rgid;
+ syscallarg(int) egid;
+ } */ *uap = v;
+ struct sys_setregid_args bsa;
+
+ if ((linux32_gid_t)SCARG(uap, rgid) == (linux32_gid_t)-1)
+ SCARG(&bsa, rgid) = (gid_t)-1;
+ else
+ SCARG(&bsa, rgid) = SCARG(uap, rgid);
+ if ((linux32_gid_t)SCARG(uap, egid) == (linux32_gid_t)-1)
+ SCARG(&bsa, egid) = (gid_t)-1;
+ else
+ SCARG(&bsa, egid) = SCARG(uap, egid);
+
+ return sys_setregid(l, &bsa, retval);
+}
+
+int
+linux32_sys_setresuid16(l, v, retval)
+ struct lwp *l;
+ void *v;
+ register_t *retval;
+{
+ struct linux32_sys_setresuid16_args /* {
+ syscallarg(uid_t) ruid;
+ syscallarg(uid_t) euid;
+ syscallarg(uid_t) suid;
+ } */ *uap = v;
+ struct linux32_sys_setresuid_args lsa;
+
+ if ((linux32_uid_t)SCARG(uap, ruid) == (linux32_uid_t)-1)
+ SCARG(&lsa, ruid) = (uid_t)-1;
+ else
+ SCARG(&lsa, ruid) = SCARG(uap, ruid);
+ if ((linux32_uid_t)SCARG(uap, euid) == (linux32_uid_t)-1)
+ SCARG(&lsa, euid) = (uid_t)-1;
+ else
+ SCARG(&lsa, euid) = SCARG(uap, euid);
+ if ((linux32_uid_t)SCARG(uap, suid) == (linux32_uid_t)-1)
+ SCARG(&lsa, suid) = (uid_t)-1;
+ else
+ SCARG(&lsa, suid) = SCARG(uap, euid);
+
+ return linux32_sys_setresuid(l, &lsa, retval);
+}
+
+int
+linux32_sys_setresgid16(l, v, retval)
+ struct lwp *l;
+ void *v;
+ register_t *retval;
+{
+ struct linux32_sys_setresgid16_args /* {
+ syscallarg(gid_t) rgid;
+ syscallarg(gid_t) egid;
+ syscallarg(gid_t) sgid;
+ } */ *uap = v;
+ struct linux32_sys_setresgid_args lsa;
+
+ if ((linux32_gid_t)SCARG(uap, rgid) == (linux32_gid_t)-1)
+ SCARG(&lsa, rgid) = (gid_t)-1;
+ else
+ SCARG(&lsa, rgid) = SCARG(uap, rgid);
+ if ((linux32_gid_t)SCARG(uap, egid) == (linux32_gid_t)-1)
+ SCARG(&lsa, egid) = (gid_t)-1;
+ else
+ SCARG(&lsa, egid) = SCARG(uap, egid);
+ if ((linux32_gid_t)SCARG(uap, sgid) == (linux32_gid_t)-1)
+ SCARG(&lsa, sgid) = (gid_t)-1;
+ else
+ SCARG(&lsa, sgid) = SCARG(uap, sgid);
+
+ return linux32_sys_setresgid(l, &lsa, retval);
+}