summaryrefslogtreecommitdiff
path: root/sys/compat
diff options
context:
space:
mode:
authorad <ad@NetBSD.org>2008-11-12 12:35:50 +0000
committerad <ad@NetBSD.org>2008-11-12 12:35:50 +0000
commit0efea177e37295fed654875d875160c47500d6bd (patch)
tree9d0589344a5d07b9a511a2e81ebbd701744d03b5 /sys/compat
parent0f81d3e0a26c2833cd085c472a4a77c325486b75 (diff)
Remove LKMs and switch to the module framework, pass 1.
Proposed on tech-kern@.
Diffstat (limited to 'sys/compat')
-rw-r--r--sys/compat/aoutm68k/aoutm68k_syscall.h15
-rw-r--r--sys/compat/aoutm68k/aoutm68k_syscallargs.h10
-rw-r--r--sys/compat/aoutm68k/aoutm68k_syscalls.c37
-rw-r--r--sys/compat/aoutm68k/aoutm68k_sysent.c47
-rw-r--r--sys/compat/aoutm68k/syscalls.master38
-rw-r--r--sys/compat/darwin/darwin_ptrace.c144
-rw-r--r--sys/compat/freebsd/freebsd_ptrace.c29
-rw-r--r--sys/compat/linux/arch/i386/linux_machdep.h4
-rw-r--r--sys/compat/linux/arch/mips/linux_machdep.h4
-rw-r--r--sys/compat/linux/arch/mips/linux_ptrace.c5
-rw-r--r--sys/compat/linux/arch/powerpc/linux_machdep.h4
-rw-r--r--sys/compat/linux/arch/powerpc/linux_ptrace.c6
-rw-r--r--sys/compat/linux/common/linux_misc.c19
-rw-r--r--sys/compat/linux/common/linux_sysctl.c7
-rw-r--r--sys/compat/linux32/common/linux32_misc.c14
-rw-r--r--sys/compat/linux32/common/linux32_sysctl.c7
-rw-r--r--sys/compat/ndis/nbcompat.h3
-rw-r--r--sys/compat/netbsd32/netbsd32_conv.h4
-rw-r--r--sys/compat/netbsd32/netbsd32_netbsd.c16
-rw-r--r--sys/compat/netbsd32/netbsd32_syscall.h17
-rw-r--r--sys/compat/netbsd32/netbsd32_syscallargs.h12
-rw-r--r--sys/compat/netbsd32/netbsd32_syscalls.c39
-rw-r--r--sys/compat/netbsd32/netbsd32_sysent.c49
-rw-r--r--sys/compat/netbsd32/syscalls.master38
-rw-r--r--sys/compat/sunos/sunos_misc.c13
-rw-r--r--sys/compat/sunos32/sunos32_misc.c13
-rw-r--r--sys/compat/sys/socket.h4
27 files changed, 125 insertions, 473 deletions
diff --git a/sys/compat/aoutm68k/aoutm68k_syscall.h b/sys/compat/aoutm68k/aoutm68k_syscall.h
index 049ee89c910..845615cdd27 100644
--- a/sys/compat/aoutm68k/aoutm68k_syscall.h
+++ b/sys/compat/aoutm68k/aoutm68k_syscall.h
@@ -1,4 +1,4 @@
-/* $NetBSD: aoutm68k_syscall.h,v 1.33 2008/06/21 19:59:09 he Exp $ */
+/* $NetBSD: aoutm68k_syscall.h,v 1.34 2008/11/12 12:36:09 ad Exp $ */
/*
* System call numbers.
@@ -746,19 +746,6 @@
/* syscall: "poll" ret: "int" args: "struct pollfd *" "u_int" "int" */
#define AOUTM68K_SYS_poll 209
-#if defined(LKM) || !defined(_KERNEL)
-#else /* !LKM */
- /* 210 is excluded lkmnosys */
- /* 211 is excluded lkmnosys */
- /* 212 is excluded lkmnosys */
- /* 213 is excluded lkmnosys */
- /* 214 is excluded lkmnosys */
- /* 215 is excluded lkmnosys */
- /* 216 is excluded lkmnosys */
- /* 217 is excluded lkmnosys */
- /* 218 is excluded lkmnosys */
- /* 219 is excluded lkmnosys */
-#endif /* !LKM */
#if defined(SYSVSEM) || !defined(_KERNEL)
#if defined(COMPAT_14) || !defined(_KERNEL)
/* syscall: "__semctl" ret: "int" args: "int" "int" "int" "union __semun *" */
diff --git a/sys/compat/aoutm68k/aoutm68k_syscallargs.h b/sys/compat/aoutm68k/aoutm68k_syscallargs.h
index 06cd988c3fd..9af700fa936 100644
--- a/sys/compat/aoutm68k/aoutm68k_syscallargs.h
+++ b/sys/compat/aoutm68k/aoutm68k_syscallargs.h
@@ -1,4 +1,4 @@
-/* $NetBSD: aoutm68k_syscallargs.h,v 1.31 2008/06/21 19:59:09 he Exp $ */
+/* $NetBSD: aoutm68k_syscallargs.h,v 1.32 2008/11/12 12:36:09 ad Exp $ */
/*
* System call argument lists.
@@ -498,9 +498,6 @@ struct sys_getpgid_args;
struct sys_reboot_args;
struct sys_poll_args;
-#if defined(LKM) || !defined(_KERNEL)
-#else /* !LKM */
-#endif /* !LKM */
#if defined(SYSVSEM) || !defined(_KERNEL)
#if defined(COMPAT_14) || !defined(_KERNEL)
@@ -1150,11 +1147,6 @@ int sys_reboot(struct lwp *, const struct sys_reboot_args *, register_t *);
int sys_poll(struct lwp *, const struct sys_poll_args *, register_t *);
-#if defined(LKM) || !defined(_KERNEL)
-int sys_lkmnosys(struct lwp *, const void *, register_t *);
-
-#else /* !LKM */
-#endif /* !LKM */
#if defined(SYSVSEM) || !defined(_KERNEL)
#if defined(COMPAT_14) || !defined(_KERNEL)
int compat_14_sys___semctl(struct lwp *, const struct compat_14_sys___semctl_args *, register_t *);
diff --git a/sys/compat/aoutm68k/aoutm68k_syscalls.c b/sys/compat/aoutm68k/aoutm68k_syscalls.c
index 06b2851d249..fc97f4ab131 100644
--- a/sys/compat/aoutm68k/aoutm68k_syscalls.c
+++ b/sys/compat/aoutm68k/aoutm68k_syscalls.c
@@ -1,4 +1,4 @@
-/* $NetBSD: aoutm68k_syscalls.c,v 1.30 2008/06/21 19:59:09 he Exp $ */
+/* $NetBSD: aoutm68k_syscalls.c,v 1.31 2008/11/12 12:36:09 ad Exp $ */
/*
* System call names.
@@ -8,7 +8,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: aoutm68k_syscalls.c,v 1.30 2008/06/21 19:59:09 he Exp $");
+__KERNEL_RCSID(0, "$NetBSD: aoutm68k_syscalls.c,v 1.31 2008/11/12 12:36:09 ad Exp $");
#if defined(_KERNEL_OPT)
#if defined(_KERNEL_OPT)
@@ -417,29 +417,16 @@ const char *const aoutm68k_syscallnames[] = {
/* 207 */ "getpgid",
/* 208 */ "reboot",
/* 209 */ "poll",
-#if defined(LKM) || !defined(_KERNEL)
- /* 210 */ "lkmnosys",
- /* 211 */ "lkmnosys",
- /* 212 */ "lkmnosys",
- /* 213 */ "lkmnosys",
- /* 214 */ "lkmnosys",
- /* 215 */ "lkmnosys",
- /* 216 */ "lkmnosys",
- /* 217 */ "lkmnosys",
- /* 218 */ "lkmnosys",
- /* 219 */ "lkmnosys",
-#else /* !LKM */
- /* 210 */ "#210 (excluded lkmnosys)",
- /* 211 */ "#211 (excluded lkmnosys)",
- /* 212 */ "#212 (excluded lkmnosys)",
- /* 213 */ "#213 (excluded lkmnosys)",
- /* 214 */ "#214 (excluded lkmnosys)",
- /* 215 */ "#215 (excluded lkmnosys)",
- /* 216 */ "#216 (excluded lkmnosys)",
- /* 217 */ "#217 (excluded lkmnosys)",
- /* 218 */ "#218 (excluded lkmnosys)",
- /* 219 */ "#219 (excluded lkmnosys)",
-#endif /* !LKM */
+ /* 210 */ "#210 (unimplemented)",
+ /* 211 */ "#211 (unimplemented)",
+ /* 212 */ "#212 (unimplemented)",
+ /* 213 */ "#213 (unimplemented)",
+ /* 214 */ "#214 (unimplemented)",
+ /* 215 */ "#215 (unimplemented)",
+ /* 216 */ "#216 (unimplemented)",
+ /* 217 */ "#217 (unimplemented)",
+ /* 218 */ "#218 (unimplemented)",
+ /* 219 */ "#219 (unimplemented)",
#if defined(SYSVSEM) || !defined(_KERNEL)
#if defined(COMPAT_14) || !defined(_KERNEL)
/* 220 */ "__semctl",
diff --git a/sys/compat/aoutm68k/aoutm68k_sysent.c b/sys/compat/aoutm68k/aoutm68k_sysent.c
index 1f12fcdd747..79384b9d4b0 100644
--- a/sys/compat/aoutm68k/aoutm68k_sysent.c
+++ b/sys/compat/aoutm68k/aoutm68k_sysent.c
@@ -1,4 +1,4 @@
-/* $NetBSD: aoutm68k_sysent.c,v 1.35 2008/06/21 19:59:09 he Exp $ */
+/* $NetBSD: aoutm68k_sysent.c,v 1.36 2008/11/12 12:36:09 ad Exp $ */
/*
* System call switch table.
@@ -8,7 +8,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: aoutm68k_sysent.c,v 1.35 2008/06/21 19:59:09 he Exp $");
+__KERNEL_RCSID(0, "$NetBSD: aoutm68k_sysent.c,v 1.36 2008/11/12 12:36:09 ad Exp $");
#if defined(_KERNEL_OPT)
#include "opt_ktrace.h"
@@ -691,49 +691,26 @@ struct sysent aoutm68k_sysent[] = {
(sy_call_t *)sys_reboot }, /* 208 = reboot */
{ ns(struct sys_poll_args), 0,
(sy_call_t *)sys_poll }, /* 209 = poll */
-#if defined(LKM) || !defined(_KERNEL)
{ 0, 0, 0,
- (sy_call_t *)sys_lkmnosys }, /* 210 = lkmnosys */
+ sys_nosys }, /* 210 = unimplemented */
{ 0, 0, 0,
- (sy_call_t *)sys_lkmnosys }, /* 211 = lkmnosys */
+ sys_nosys }, /* 211 = unimplemented */
{ 0, 0, 0,
- (sy_call_t *)sys_lkmnosys }, /* 212 = lkmnosys */
+ sys_nosys }, /* 212 = unimplemented */
{ 0, 0, 0,
- (sy_call_t *)sys_lkmnosys }, /* 213 = lkmnosys */
+ sys_nosys }, /* 213 = unimplemented */
{ 0, 0, 0,
- (sy_call_t *)sys_lkmnosys }, /* 214 = lkmnosys */
+ sys_nosys }, /* 214 = unimplemented */
{ 0, 0, 0,
- (sy_call_t *)sys_lkmnosys }, /* 215 = lkmnosys */
+ sys_nosys }, /* 215 = unimplemented */
{ 0, 0, 0,
- (sy_call_t *)sys_lkmnosys }, /* 216 = lkmnosys */
+ sys_nosys }, /* 216 = unimplemented */
{ 0, 0, 0,
- (sy_call_t *)sys_lkmnosys }, /* 217 = lkmnosys */
+ sys_nosys }, /* 217 = unimplemented */
{ 0, 0, 0,
- (sy_call_t *)sys_lkmnosys }, /* 218 = lkmnosys */
+ sys_nosys }, /* 218 = unimplemented */
{ 0, 0, 0,
- (sy_call_t *)sys_lkmnosys }, /* 219 = lkmnosys */
-#else /* !LKM */
- { 0, 0, 0,
- sys_nosys }, /* 210 = excluded lkmnosys */
- { 0, 0, 0,
- sys_nosys }, /* 211 = excluded lkmnosys */
- { 0, 0, 0,
- sys_nosys }, /* 212 = excluded lkmnosys */
- { 0, 0, 0,
- sys_nosys }, /* 213 = excluded lkmnosys */
- { 0, 0, 0,
- sys_nosys }, /* 214 = excluded lkmnosys */
- { 0, 0, 0,
- sys_nosys }, /* 215 = excluded lkmnosys */
- { 0, 0, 0,
- sys_nosys }, /* 216 = excluded lkmnosys */
- { 0, 0, 0,
- sys_nosys }, /* 217 = excluded lkmnosys */
- { 0, 0, 0,
- sys_nosys }, /* 218 = excluded lkmnosys */
- { 0, 0, 0,
- sys_nosys }, /* 219 = excluded lkmnosys */
-#endif /* !LKM */
+ sys_nosys }, /* 219 = unimplemented */
#if defined(SYSVSEM) || !defined(_KERNEL)
#if defined(COMPAT_14) || !defined(_KERNEL)
{ ns(struct compat_14_sys___semctl_args), 0,
diff --git a/sys/compat/aoutm68k/syscalls.master b/sys/compat/aoutm68k/syscalls.master
index 6b45c6127a6..a166c20e79e 100644
--- a/sys/compat/aoutm68k/syscalls.master
+++ b/sys/compat/aoutm68k/syscalls.master
@@ -1,4 +1,4 @@
- $NetBSD: syscalls.master,v 1.28 2008/06/21 19:58:27 he Exp $
+ $NetBSD: syscalls.master,v 1.29 2008/11/12 12:36:09 ad Exp $
; @(#)syscalls.master 8.2 (Berkeley) 1/13/94
@@ -565,32 +565,16 @@
208 NOARGS { int sys_reboot(int opt, char *bootstr); }
209 NOARGS { int sys_poll(struct pollfd *fds, u_int nfds, \
int timeout); }
-;
-; Syscalls 210-219 are reserved for dynamically loaded syscalls
-;
-#if defined(LKM) || !defined(_KERNEL)
-210 NODEF { int sys_lkmnosys(void); }
-211 NODEF { int sys_lkmnosys(void); }
-212 NODEF { int sys_lkmnosys(void); }
-213 NODEF { int sys_lkmnosys(void); }
-214 NODEF { int sys_lkmnosys(void); }
-215 NODEF { int sys_lkmnosys(void); }
-216 NODEF { int sys_lkmnosys(void); }
-217 NODEF { int sys_lkmnosys(void); }
-218 NODEF { int sys_lkmnosys(void); }
-219 NODEF { int sys_lkmnosys(void); }
-#else /* !LKM */
-210 EXCL lkmnosys
-211 EXCL lkmnosys
-212 EXCL lkmnosys
-213 EXCL lkmnosys
-214 EXCL lkmnosys
-215 EXCL lkmnosys
-216 EXCL lkmnosys
-217 EXCL lkmnosys
-218 EXCL lkmnosys
-219 EXCL lkmnosys
-#endif /* !LKM */
+210 UNIMPL
+211 UNIMPL
+212 UNIMPL
+213 UNIMPL
+214 UNIMPL
+215 UNIMPL
+216 UNIMPL
+217 UNIMPL
+218 UNIMPL
+219 UNIMPL
; System calls 220-300 are reserved for use by NetBSD
#if defined(SYSVSEM) || !defined(_KERNEL)
#if defined(COMPAT_14) || !defined(_KERNEL)
diff --git a/sys/compat/darwin/darwin_ptrace.c b/sys/compat/darwin/darwin_ptrace.c
index a631574b877..f2572dcbdd2 100644
--- a/sys/compat/darwin/darwin_ptrace.c
+++ b/sys/compat/darwin/darwin_ptrace.c
@@ -1,4 +1,4 @@
-/* $NetBSD: darwin_ptrace.c,v 1.17 2008/04/28 20:23:41 martin Exp $ */
+/* $NetBSD: darwin_ptrace.c,v 1.18 2008/11/12 12:36:09 ad Exp $ */
/*-
* Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -30,9 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: darwin_ptrace.c,v 1.17 2008/04/28 20:23:41 martin Exp $");
-
-#include "opt_ptrace.h"
+__KERNEL_RCSID(0, "$NetBSD: darwin_ptrace.c,v 1.18 2008/11/12 12:36:09 ad Exp $");
#include <sys/types.h>
#include <sys/param.h>
@@ -59,150 +57,14 @@ __KERNEL_RCSID(0, "$NetBSD: darwin_ptrace.c,v 1.17 2008/04/28 20:23:41 martin Ex
int
darwin_sys_ptrace(struct lwp *l, const struct darwin_sys_ptrace_args *uap, register_t *retval)
{
-#if defined(PTRACE) || defined(_LKM)
/* {
syscallarg(int) req;
syscallarg(pid_t) pid;
syscallarg(void *) addr;
syscallarg(int) data;
} */
- int req = SCARG(uap, req);
- struct proc *p = l->l_proc;
- struct darwin_emuldata *ded = NULL;
- struct proc *t; /* target process */
- struct sys_ptrace_args bsd_ua;
- int error;
-
-#ifdef _LKM
-#define sys_ptrace (*sysent[SYS_ptrace].sy_call)
- if (sys_ptrace == sys_nosys)
- return ENOSYS;
-#endif
-
- /* XXXAD locking */
- SCARG(&bsd_ua, req) = SCARG(uap, req);
- SCARG(&bsd_ua, pid) = SCARG(uap, pid);
- SCARG(&bsd_ua, addr) = SCARG(uap, addr);
- SCARG(&bsd_ua, data) = SCARG(uap, data);
-
-
- ded = (struct darwin_emuldata *)p->p_emuldata;
-
- switch (req) {
- case DARWIN_PT_ATTACHEXC:
- if ((t = pfind(SCARG(uap, pid))) == NULL)
- return ESRCH;
-
- if (t->p_emul != &emul_darwin)
- return ESRCH;
- ded = t->p_emuldata;
-
- if (ded->ded_flags & DARWIN_DED_SIGEXC)
- return EBUSY;
-
- ded->ded_flags |= DARWIN_DED_SIGEXC;
-
- SCARG(&bsd_ua, req) = PT_ATTACH;
- if ((error = sys_ptrace(l, &bsd_ua, retval)) != 0)
- ded->ded_flags &= ~DARWIN_DED_SIGEXC;
-
- return error;
- break;
-
- case DARWIN_PT_SIGEXC:
- if ((p->p_slflag & PSL_TRACED) == 0)
- return EBUSY;
-
- ded->ded_flags |= DARWIN_DED_SIGEXC;
- break;
-
- case DARWIN_PT_DETACH: {
- int had_sigexc = 0;
-
- if ((t = pfind(SCARG(uap, pid))) == NULL)
- return (ESRCH);
- if ((t->p_emul == &emul_darwin) &&
- (t->p_slflag & PSL_TRACED) &&
- (t->p_pptr == p)) {
- ded = t->p_emuldata;
- if (ded->ded_flags & DARWIN_DED_SIGEXC) {
- had_sigexc = 1;
- ded->ded_flags &= ~DARWIN_DED_SIGEXC;
- }
- }
-
- /*
- * If the process is not marked as stopped,
- * sys_ptrace sanity checks will return EBUSY.
- */
- mutex_enter(proc_lock);
- mutex_enter(t->p_lock);
- proc_stop(t, 0, SIGSTOP);
- mutex_exit(t->p_lock);
- mutex_exit(proc_lock);
-
- if ((error = sys_ptrace(l, &bsd_ua, retval)) != 0) {
- mutex_enter(proc_lock);
- mutex_enter(t->p_lock);
- proc_unstop(t);
- mutex_exit(t->p_lock);
- mutex_exit(proc_lock);
- if (had_sigexc)
- ded->ded_flags |= DARWIN_DED_SIGEXC;
- }
-
- break;
- }
-
- case DARWIN_PT_THUPDATE: {
- int signo = SCARG(uap, data);
-
- if ((t = pfind(SCARG(uap, pid))) == NULL)
- return ESRCH;
-
- /* Checks from native ptrace */
- if (!ISSET(t->p_slflag, PSL_TRACED))
- return EPERM;
-
- if (ISSET(t->p_slflag, PSL_FSTRACE))
- return EBUSY;
-
- if (t->p_pptr != p)
- return EBUSY;
-
-#if 0
- if (t->p_stat != SSTOP || !ISSET(t->p_sflag, PS_WAITED))
- return EBUSY;
-#endif
- if ((signo < 0) || (signo > NSIG))
- return EINVAL;
-
- t->p_xstat = signo;
- if (signo != 0)
- sigaddset(&p->p_sigpend.sp_set, signo);
-
- break;
- }
-
- case DARWIN_PT_READ_U:
- case DARWIN_PT_WRITE_U:
- case DARWIN_PT_STEP:
- case DARWIN_PT_FORCEQUOTA:
- case DARWIN_PT_DENY_ATTACH:
- printf("darwin_sys_ptrace: unimplemented command %d\n", req);
- break;
-
- /* The other ptrace commands are the same on NetBSD */
- default:
- return sys_ptrace(l, &bsd_ua, retval);
- break;
- }
-
- return 0;
-#else
- return ENOSYS;
-#endif /* PTRACE || _LKM */
+ return ENOSYS; /* code was badly broken */
}
int
diff --git a/sys/compat/freebsd/freebsd_ptrace.c b/sys/compat/freebsd/freebsd_ptrace.c
index b70579be2e7..33427123bcf 100644
--- a/sys/compat/freebsd/freebsd_ptrace.c
+++ b/sys/compat/freebsd/freebsd_ptrace.c
@@ -1,4 +1,4 @@
-/* $NetBSD: freebsd_ptrace.c,v 1.17 2007/12/20 23:02:47 dsl Exp $ */
+/* $NetBSD: freebsd_ptrace.c,v 1.18 2008/11/12 12:36:10 ad Exp $ */
/*-
* Copyright (c) 1982, 1986, 1989, 1993
@@ -71,11 +71,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: freebsd_ptrace.c,v 1.17 2007/12/20 23:02:47 dsl Exp $");
-
-#if defined(_KERNEL_OPT)
-#include "opt_ptrace.h"
-#endif
+__KERNEL_RCSID(0, "$NetBSD: freebsd_ptrace.c,v 1.18 2008/11/12 12:36:10 ad Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -85,6 +81,7 @@ __KERNEL_RCSID(0, "$NetBSD: freebsd_ptrace.c,v 1.17 2007/12/20 23:02:47 dsl Exp
#include <sys/uio.h>
#include <sys/user.h>
#include <sys/mount.h>
+#include <sys/syscall.h>
#include <sys/syscallargs.h>
#include <compat/sys/signal.h>
@@ -103,7 +100,6 @@ __KERNEL_RCSID(0, "$NetBSD: freebsd_ptrace.c,v 1.17 2007/12/20 23:02:47 dsl Exp
int
freebsd_sys_ptrace(struct lwp *l, const struct freebsd_sys_ptrace_args *uap, register_t *retval)
{
-#if defined(PTRACE) || defined(_LKM)
/* {
syscallarg(int) req;
syscallarg(pid_t) pid;
@@ -111,9 +107,7 @@ freebsd_sys_ptrace(struct lwp *l, const struct freebsd_sys_ptrace_args *uap, reg
syscallarg(int) data;
} */
struct sys_ptrace_args npa;
-#ifdef _LKM
- sy_call_t sys_ptrace = sysent[SYS_ptrace].sy_call;
-#endif
+ sy_call_t *fn = sysent[SYS_ptrace].sy_call;
switch (SCARG(uap, req)) {
#ifdef PT_STEP
@@ -122,7 +116,7 @@ freebsd_sys_ptrace(struct lwp *l, const struct freebsd_sys_ptrace_args *uap, reg
SCARG(&npa, pid) = SCARG(uap, pid);
SCARG(&npa, addr) = SCARG(uap, addr);
SCARG(&npa, data) = SCARG(uap, data);
- return sys_ptrace(l, &npa, retval);
+ return (*fn)(l, &npa, retval);
#endif
case FREEBSD_PT_TRACE_ME:
case FREEBSD_PT_READ_I:
@@ -132,7 +126,7 @@ freebsd_sys_ptrace(struct lwp *l, const struct freebsd_sys_ptrace_args *uap, reg
case FREEBSD_PT_CONTINUE:
case FREEBSD_PT_KILL:
/* These requests are compatible with NetBSD */
- return sys_ptrace(l, (const void *)uap, retval);
+ return (*fn)(l, (const void *)uap, retval);
#if 0
/*
@@ -161,14 +155,14 @@ freebsd_sys_ptrace(struct lwp *l, const struct freebsd_sys_ptrace_args *uap, reg
SCARG(&npa, req) = PT_GETREGS;
SCARG(&npa, pid) = SCARG(uap, pid);
SCARG(&npa, addr) = (void *)&nrp->regs;
- if ((error = sys_ptrace(l, &npa, retval)) != 0)
+ if ((error = (*fn)(l, &npa, retval)) != 0)
return error;
#endif
#ifdef PT_GETFPREGS
SCARG(&npa, req) = PT_GETFPREGS;
SCARG(&npa, pid) = SCARG(uap, pid);
SCARG(&npa, addr) = (void *)&nrp->fpregs;
- if ((error = sys_ptrace(l, &npa, retval)) != 0)
+ if ((error = (*fn)(l, &npa, retval)) != 0)
return error;
#endif
netbsd_to_freebsd_ptrace_regs(&nrp->regs, &nrp->fpregs, &fr);
@@ -188,14 +182,14 @@ freebsd_sys_ptrace(struct lwp *l, const struct freebsd_sys_ptrace_args *uap, reg
SCARG(&npa, req) = PT_SETREGS;
SCARG(&npa, pid) = SCARG(uap, pid);
SCARG(&npa, addr) = (void *)&nrp->regs;
- if ((error = sys_ptrace(l, &npa, retval)) != 0)
+ if ((error = (*fn)(l, &npa, retval)) != 0)
return error;
#endif
#ifdef PT_SETFPREGS
SCARG(&npa, req) = PT_SETFPREGS;
SCARG(&npa, pid) = SCARG(uap, pid);
SCARG(&npa, addr) = (void *)&nrp->fpregs;
- if ((error = sys_ptrace(l, &npa, retval)) != 0)
+ if ((error = (*fn)(l, &npa, retval)) != 0)
return error;
#endif
return 0;
@@ -210,7 +204,4 @@ freebsd_sys_ptrace(struct lwp *l, const struct freebsd_sys_ptrace_args *uap, reg
#ifdef DIAGNOSTIC
panic("freebsd_ptrace: impossible");
#endif
-#else
- return (ENOSYS);
-#endif /* PTRACE || _LKM */
}
diff --git a/sys/compat/linux/arch/i386/linux_machdep.h b/sys/compat/linux/arch/i386/linux_machdep.h
index 68c8a32a4f6..de0c2e98f9b 100644
--- a/sys/compat/linux/arch/i386/linux_machdep.h
+++ b/sys/compat/linux/arch/i386/linux_machdep.h
@@ -1,4 +1,4 @@
-/* $NetBSD: linux_machdep.h,v 1.35 2008/10/26 17:57:49 christos Exp $ */
+/* $NetBSD: linux_machdep.h,v 1.36 2008/11/12 12:36:10 ad Exp $ */
/*-
* Copyright (c) 1995, 2000 The NetBSD Foundation, Inc.
@@ -280,7 +280,7 @@ struct linux_desc_struct {
#define LINUX_VMWARE_LAST 237
/*
- * Range of ioctls to just pass on, so that LKMs (like VMWare) can
+ * Range of ioctls to just pass on, so that modules (like VMWare) can
* handle them.
*/
#define LINUX_IOCTL_MIN_PASS LINUX_VMWARE_NONE
diff --git a/sys/compat/linux/arch/mips/linux_machdep.h b/sys/compat/linux/arch/mips/linux_machdep.h
index 092903b22e2..3b526b3397b 100644
--- a/sys/compat/linux/arch/mips/linux_machdep.h
+++ b/sys/compat/linux/arch/mips/linux_machdep.h
@@ -1,4 +1,4 @@
-/* $NetBSD: linux_machdep.h,v 1.9 2008/04/28 20:23:43 martin Exp $ */
+/* $NetBSD: linux_machdep.h,v 1.10 2008/11/12 12:36:10 ad Exp $ */
/*-
* Copyright (c) 1995, 2000, 2001 The NetBSD Foundation, Inc.
@@ -186,7 +186,7 @@ struct linux_rt_sigframe
#define LINUX_VMWARE_LAST 237
/*
- * Range of ioctls to just pass on, so that LKMs (like VMWare) can
+ * Range of ioctls to just pass on, so that modules (like VMWare) can
* handle them.
*
* From Linux's include/linux/vt.h
diff --git a/sys/compat/linux/arch/mips/linux_ptrace.c b/sys/compat/linux/arch/mips/linux_ptrace.c
index 9f3a3a7dccf..239126f1fe1 100644
--- a/sys/compat/linux/arch/mips/linux_ptrace.c
+++ b/sys/compat/linux/arch/mips/linux_ptrace.c
@@ -1,4 +1,4 @@
-/* $NetBSD: linux_ptrace.c,v 1.8 2008/04/28 20:23:43 martin Exp $ */
+/* $NetBSD: linux_ptrace.c,v 1.9 2008/11/12 12:36:10 ad Exp $ */
/*-
* Copyright (c) 1999, 2001 The NetBSD Foundation, Inc.
@@ -30,8 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: linux_ptrace.c,v 1.8 2008/04/28 20:23:43 martin Exp $");
-#include "opt_ptrace.h"
+__KERNEL_RCSID(0, "$NetBSD: linux_ptrace.c,v 1.9 2008/11/12 12:36:10 ad Exp $");
#include <sys/param.h>
#include <sys/malloc.h>
diff --git a/sys/compat/linux/arch/powerpc/linux_machdep.h b/sys/compat/linux/arch/powerpc/linux_machdep.h
index ec3a6d32fe4..a11f93f3baf 100644
--- a/sys/compat/linux/arch/powerpc/linux_machdep.h
+++ b/sys/compat/linux/arch/powerpc/linux_machdep.h
@@ -1,4 +1,4 @@
-/* $NetBSD: linux_machdep.h,v 1.9 2008/04/28 20:23:43 martin Exp $ */
+/* $NetBSD: linux_machdep.h,v 1.10 2008/11/12 12:36:10 ad Exp $ */
/*-
* Copyright (c) 1995, 2000, 2001 The NetBSD Foundation, Inc.
@@ -214,7 +214,7 @@ struct linux_rt_sigframe
#define LINUX_VMWARE_LAST 237
/*
- * Range of ioctls to just pass on, so that LKMs (like VMWare) can
+ * Range of ioctls to just pass on, so that modules (like VMWare) can
* handle them.
*
* From Linux's include/linux/vt.h
diff --git a/sys/compat/linux/arch/powerpc/linux_ptrace.c b/sys/compat/linux/arch/powerpc/linux_ptrace.c
index 2ec4a79bf55..b007fe6b0d5 100644
--- a/sys/compat/linux/arch/powerpc/linux_ptrace.c
+++ b/sys/compat/linux/arch/powerpc/linux_ptrace.c
@@ -1,4 +1,4 @@
-/* $NetBSD: linux_ptrace.c,v 1.19 2008/04/28 20:23:43 martin Exp $ */
+/* $NetBSD: linux_ptrace.c,v 1.20 2008/11/12 12:36:10 ad Exp $ */
/*-
* Copyright (c) 1999, 2001 The NetBSD Foundation, Inc.
@@ -30,9 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: linux_ptrace.c,v 1.19 2008/04/28 20:23:43 martin Exp $");
-
-#include "opt_ptrace.h"
+__KERNEL_RCSID(0, "$NetBSD: linux_ptrace.c,v 1.20 2008/11/12 12:36:10 ad Exp $");
#include <sys/param.h>
#include <sys/malloc.h>
diff --git a/sys/compat/linux/common/linux_misc.c b/sys/compat/linux/common/linux_misc.c
index 7712e6697fa..3c2b96b0341 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.201 2008/06/24 11:18:15 ad Exp $ */
+/* $NetBSD: linux_misc.c,v 1.202 2008/11/12 12:36:10 ad Exp $ */
/*-
* Copyright (c) 1995, 1998, 1999, 2008 The NetBSD Foundation, Inc.
@@ -57,11 +57,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: linux_misc.c,v 1.201 2008/06/24 11:18:15 ad Exp $");
-
-#if defined(_KERNEL_OPT)
-#include "opt_ptrace.h"
-#endif
+__KERNEL_RCSID(0, "$NetBSD: linux_misc.c,v 1.202 2008/11/12 12:36:10 ad Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -1040,13 +1036,9 @@ linux_sys_ptrace(struct lwp *l, const struct linux_sys_ptrace_args *uap, registe
syscallarg(T) addr;
syscallarg(T) data;
} */
-#if defined(PTRACE) || defined(_LKM)
const int *ptr;
int request;
int error;
-#ifdef _LKM
-#define sys_ptrace (*sysent[SYS_ptrace].sy_call)
-#endif
ptr = linux_ptrace_request_map;
request = SCARG(uap, request);
@@ -1062,13 +1054,13 @@ linux_sys_ptrace(struct lwp *l, const struct linux_sys_ptrace_args *uap, registe
/*
* Linux ptrace(PTRACE_CONT, pid, 0, 0) means actually
* to continue where the process left off previously.
- * The same thing is achieved by addr == (void *) 1
+ * The same thing is achieved by addr == (void *) 1
* on NetBSD, so rewrite 'addr' appropriately.
*/
if (request == LINUX_PTRACE_CONT && SCARG(uap, addr)==0)
SCARG(&pta, addr) = (void *) 1;
- error = sys_ptrace(l, &pta, retval);
+ error = sysent[SYS_ptrace].sy_call(l, &pta, retval);
if (error)
return error;
switch (request) {
@@ -1088,9 +1080,6 @@ linux_sys_ptrace(struct lwp *l, const struct linux_sys_ptrace_args *uap, registe
ptr++;
return LINUX_SYS_PTRACE_ARCH(l, uap, retval);
-#else
- return ENOSYS;
-#endif /* PTRACE || _LKM */
}
int
diff --git a/sys/compat/linux/common/linux_sysctl.c b/sys/compat/linux/common/linux_sysctl.c
index 4c990917642..23839c1775d 100644
--- a/sys/compat/linux/common/linux_sysctl.c
+++ b/sys/compat/linux/common/linux_sysctl.c
@@ -1,4 +1,4 @@
-/* $NetBSD: linux_sysctl.c,v 1.36 2008/06/18 12:24:18 tsutsui Exp $ */
+/* $NetBSD: linux_sysctl.c,v 1.37 2008/11/12 12:36:10 ad Exp $ */
/*-
* Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: linux_sysctl.c,v 1.36 2008/06/18 12:24:18 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_sysctl.c,v 1.37 2008/11/12 12:36:10 ad Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -65,9 +65,6 @@ char linux_release[128] = "2.0.38";
char linux_version[128] = "#0 Sun Nov 11 11:11:11 MET 2000";
#endif
-#ifndef _LKM
-static
-#endif
struct sysctlnode linux_sysctl_root = {
.sysctl_flags = SYSCTL_VERSION|
CTLFLAG_ROOT|CTLTYPE_NODE|CTLFLAG_READWRITE,
diff --git a/sys/compat/linux32/common/linux32_misc.c b/sys/compat/linux32/common/linux32_misc.c
index e1b2a654b46..0fb49b0d216 100644
--- a/sys/compat/linux32/common/linux32_misc.c
+++ b/sys/compat/linux32/common/linux32_misc.c
@@ -1,4 +1,4 @@
-/* $NetBSD: linux32_misc.c,v 1.12 2008/06/18 22:58:21 njoly Exp $ */
+/* $NetBSD: linux32_misc.c,v 1.13 2008/11/12 12:36:10 ad Exp $ */
/*-
* Copyright (c) 1995, 1998, 1999 The NetBSD Foundation, Inc.
@@ -32,11 +32,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: linux32_misc.c,v 1.12 2008/06/18 22:58:21 njoly Exp $");
-
-#if defined(_KERNEL_OPT)
-#include "opt_ptrace.h"
-#endif
+__KERNEL_RCSID(0, "$NetBSD: linux32_misc.c,v 1.13 2008/11/12 12:36:10 ad Exp $");
#include <sys/param.h>
#include <sys/proc.h>
@@ -103,7 +99,6 @@ linux32_sys_ptrace(struct lwp *l, const struct linux32_sys_ptrace_args *uap, reg
syscallarg(T) addr;
syscallarg(T) data;
} */
-#if defined(PTRACE) || defined(_LKM)
const int *ptr;
int request;
int error;
@@ -128,7 +123,7 @@ linux32_sys_ptrace(struct lwp *l, const struct linux32_sys_ptrace_args *uap, reg
if (request == LINUX_PTRACE_CONT && SCARG(uap, addr)==0)
SCARG(&pta, addr) = (void *) 1;
- error = sys_ptrace(l, &pta, retval);
+ error = sysent[SYS_ptrace].sy_call(l, &pta, retval);
if (error)
return error;
switch (request) {
@@ -148,7 +143,4 @@ linux32_sys_ptrace(struct lwp *l, const struct linux32_sys_ptrace_args *uap, reg
ptr++;
return EIO;
-#else
- return ENOSYS;
-#endif /* PTRACE || _LKM */
}
diff --git a/sys/compat/linux32/common/linux32_sysctl.c b/sys/compat/linux32/common/linux32_sysctl.c
index acdb3cd6005..fd0fad70f5d 100644
--- a/sys/compat/linux32/common/linux32_sysctl.c
+++ b/sys/compat/linux32/common/linux32_sysctl.c
@@ -1,4 +1,4 @@
-/* $NetBSD: linux32_sysctl.c,v 1.9 2008/01/07 16:12:53 ad Exp $ */
+/* $NetBSD: linux32_sysctl.c,v 1.10 2008/11/12 12:36:10 ad Exp $ */
/*-
* Copyright (c) 2006 Emmanuel Dreyfus, all rights reserved.
@@ -31,7 +31,7 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: linux32_sysctl.c,v 1.9 2008/01/07 16:12:53 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux32_sysctl.c,v 1.10 2008/11/12 12:36:10 ad Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -105,9 +105,6 @@ SYSCTL_SETUP(sysctl_emul_linux32_setup, "sysctl emul.linux32 subtree setup")
EMUL_LINUX32_KERN_VERSION, CTL_EOL);
}
-#ifndef _LKM
-static
-#endif
struct sysctlnode linux32_sysctl_root = {
.sysctl_flags = SYSCTL_VERSION|
CTLFLAG_ROOT|CTLTYPE_NODE|CTLFLAG_READWRITE,
diff --git a/sys/compat/ndis/nbcompat.h b/sys/compat/ndis/nbcompat.h
index 94bb50c7d7b..4981b263a82 100644
--- a/sys/compat/ndis/nbcompat.h
+++ b/sys/compat/ndis/nbcompat.h
@@ -2,7 +2,7 @@
#define _NBCOMPAT_H_
#include <sys/systm.h>
-#include <sys/lkm.h>
+#include <sys/module.h>
#include <sys/cdefs.h>
#include <sys/queue.h>
#include <sys/mutex.h>
@@ -83,7 +83,6 @@ TAILQ_HEAD(sysctl_ctx_list, sysctl_ctx_entry);
typedef vaddr_t vm_offset_t;
typedef vsize_t vm_size_t;
typedef uint16_t linker_file_t;
-typedef struct lkm_table * module_t;
/* Write our own versions of some FreeBSD functions */
struct ndis_resource;
diff --git a/sys/compat/netbsd32/netbsd32_conv.h b/sys/compat/netbsd32/netbsd32_conv.h
index 075d98a6e04..422fe7b4f3d 100644
--- a/sys/compat/netbsd32/netbsd32_conv.h
+++ b/sys/compat/netbsd32/netbsd32_conv.h
@@ -1,4 +1,4 @@
-/* $NetBSD: netbsd32_conv.h,v 1.19 2008/06/02 14:12:08 njoly Exp $ */
+/* $NetBSD: netbsd32_conv.h,v 1.20 2008/11/12 12:36:10 ad Exp $ */
/*
* Copyright (c) 1998, 2001 Matthew R. Green
@@ -32,7 +32,7 @@
/*
* Though COMPAT_OLDSOCK is needed only for COMPAT_43, SunOS, Linux,
* HP-UX, FreeBSD, Ultrix, OSF1, we define it unconditionally so that
- * this would be LKM-safe.
+ * this would be module-safe.
*/
#define COMPAT_OLDSOCK /* used by <sys/socket.h> */
diff --git a/sys/compat/netbsd32/netbsd32_netbsd.c b/sys/compat/netbsd32/netbsd32_netbsd.c
index 53b223f2fe8..f674867642f 100644
--- a/sys/compat/netbsd32/netbsd32_netbsd.c
+++ b/sys/compat/netbsd32/netbsd32_netbsd.c
@@ -1,4 +1,4 @@
-/* $NetBSD: netbsd32_netbsd.c,v 1.145 2008/10/15 06:51:19 wrstuden Exp $ */
+/* $NetBSD: netbsd32_netbsd.c,v 1.146 2008/11/12 12:36:10 ad Exp $ */
/*
* Copyright (c) 1998, 2001 Matthew R. Green
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_netbsd.c,v 1.145 2008/10/15 06:51:19 wrstuden Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_netbsd.c,v 1.146 2008/11/12 12:36:10 ad Exp $");
#if defined(_KERNEL_OPT)
#include "opt_ddb.h"
@@ -37,7 +37,6 @@ __KERNEL_RCSID(0, "$NetBSD: netbsd32_netbsd.c,v 1.145 2008/10/15 06:51:19 wrstud
#include "opt_sysv.h"
#include "opt_nfsserver.h"
#include "opt_syscall_debug.h"
-#include "opt_ptrace.h"
#include "opt_sa.h"
#include "fs_lfs.h"
@@ -47,7 +46,7 @@ __KERNEL_RCSID(0, "$NetBSD: netbsd32_netbsd.c,v 1.145 2008/10/15 06:51:19 wrstud
/*
* Though COMPAT_OLDSOCK is needed only for COMPAT_43, SunOS, Linux,
* HP-UX, FreeBSD, Ultrix, OSF1, we define it unconditionally so that
- * this would be LKM-safe.
+ * this would be module-safe.
*/
#define COMPAT_OLDSOCK /* used by <sys/socket.h> */
@@ -424,7 +423,6 @@ netbsd32_setuid(struct lwp *l, const struct netbsd32_setuid_args *uap, register_
int
netbsd32_ptrace(struct lwp *l, const struct netbsd32_ptrace_args *uap, register_t *retval)
{
-#if defined(PTRACE) || defined(_LKM)
/* {
syscallarg(int) req;
syscallarg(pid_t) pid;
@@ -437,14 +435,8 @@ netbsd32_ptrace(struct lwp *l, const struct netbsd32_ptrace_args *uap, register_
NETBSD32TO64_UAP(pid);
NETBSD32TOP_UAP(addr, void *);
NETBSD32TO64_UAP(data);
-#ifdef _LKM
+
return (*sysent[SYS_ptrace].sy_call)(l, &ua, retval);
-#else
- return sys_ptrace(l, &ua, retval);
-#endif
-#else
- return (ENOSYS);
-#endif /* PTRACE || _LKM */
}
int
diff --git a/sys/compat/netbsd32/netbsd32_syscall.h b/sys/compat/netbsd32/netbsd32_syscall.h
index 438306d3741..7bdb59a044e 100644
--- a/sys/compat/netbsd32/netbsd32_syscall.h
+++ b/sys/compat/netbsd32/netbsd32_syscall.h
@@ -1,10 +1,10 @@
-/* $NetBSD: netbsd32_syscall.h,v 1.78 2008/10/15 06:51:19 wrstuden Exp $ */
+/* $NetBSD: netbsd32_syscall.h,v 1.79 2008/11/12 12:36:10 ad Exp $ */
/*
* System call numbers.
*
* DO NOT EDIT-- this file is automatically generated.
- * created from NetBSD: syscalls.master,v 1.69.4.3 2008/09/28 21:14:14 skrll Exp
+ * created from NetBSD: syscalls.master,v 1.70 2008/10/15 06:51:20 wrstuden Exp
*/
#ifndef _NETBSD32_SYS_SYSCALL_H_
@@ -596,19 +596,6 @@
/* syscall: "netbsd32_poll" ret: "int" args: "netbsd32_pollfdp_t" "u_int" "int" */
#define NETBSD32_SYS_netbsd32_poll 209
-#if defined(LKM) || !defined(_KERNEL)
-#else /* !LKM || !_KERNEL */
- /* 210 is excluded lkmnosys */
- /* 211 is excluded lkmnosys */
- /* 212 is excluded lkmnosys */
- /* 213 is excluded lkmnosys */
- /* 214 is excluded lkmnosys */
- /* 215 is excluded lkmnosys */
- /* 216 is excluded lkmnosys */
- /* 217 is excluded lkmnosys */
- /* 218 is excluded lkmnosys */
- /* 219 is excluded lkmnosys */
-#endif /* !LKM || !_KERNEL */
#if defined(SYSVSEM) || !defined(_KERNEL)
/* syscall: "compat_14_netbsd32___semctl" ret: "int" args: "int" "int" "int" "netbsd32_semunu_t" */
#define NETBSD32_SYS_compat_14_netbsd32___semctl 220
diff --git a/sys/compat/netbsd32/netbsd32_syscallargs.h b/sys/compat/netbsd32/netbsd32_syscallargs.h
index 3b720560269..7262100a93d 100644
--- a/sys/compat/netbsd32/netbsd32_syscallargs.h
+++ b/sys/compat/netbsd32/netbsd32_syscallargs.h
@@ -1,10 +1,10 @@
-/* $NetBSD: netbsd32_syscallargs.h,v 1.78 2008/10/15 06:51:20 wrstuden Exp $ */
+/* $NetBSD: netbsd32_syscallargs.h,v 1.79 2008/11/12 12:36:10 ad Exp $ */
/*
* System call argument lists.
*
* DO NOT EDIT-- this file is automatically generated.
- * created from NetBSD: syscalls.master,v 1.69.4.3 2008/09/28 21:14:14 skrll Exp
+ * created from NetBSD: syscalls.master,v 1.70 2008/10/15 06:51:20 wrstuden Exp
*/
#ifndef _NETBSD32_SYS_SYSCALLARGS_H_
@@ -1120,9 +1120,6 @@ struct netbsd32_poll_args {
syscallarg(int) timeout;
};
check_syscall_args(netbsd32_poll)
-#if defined(LKM) || !defined(_KERNEL)
-#else /* !LKM || !_KERNEL */
-#endif /* !LKM || !_KERNEL */
#if defined(SYSVSEM) || !defined(_KERNEL)
struct compat_14_netbsd32___semctl_args {
@@ -2460,11 +2457,6 @@ int netbsd32_reboot(struct lwp *, const struct netbsd32_reboot_args *, register_
int netbsd32_poll(struct lwp *, const struct netbsd32_poll_args *, register_t *);
-#if defined(LKM) || !defined(_KERNEL)
-int sys_lkmnosys(struct lwp *, const void *, register_t *);
-
-#else /* !LKM || !_KERNEL */
-#endif /* !LKM || !_KERNEL */
#if defined(SYSVSEM) || !defined(_KERNEL)
int compat_14_netbsd32___semctl(struct lwp *, const struct compat_14_netbsd32___semctl_args *, register_t *);
diff --git a/sys/compat/netbsd32/netbsd32_syscalls.c b/sys/compat/netbsd32/netbsd32_syscalls.c
index a4dbf3d510b..c9de6a68b48 100644
--- a/sys/compat/netbsd32/netbsd32_syscalls.c
+++ b/sys/compat/netbsd32/netbsd32_syscalls.c
@@ -1,14 +1,14 @@
-/* $NetBSD: netbsd32_syscalls.c,v 1.77 2008/10/15 06:51:20 wrstuden Exp $ */
+/* $NetBSD: netbsd32_syscalls.c,v 1.78 2008/11/12 12:36:10 ad Exp $ */
/*
* System call names.
*
* DO NOT EDIT-- this file is automatically generated.
- * created from NetBSD: syscalls.master,v 1.69.4.3 2008/09/28 21:14:14 skrll Exp
+ * created from NetBSD: syscalls.master,v 1.70 2008/10/15 06:51:20 wrstuden Exp
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_syscalls.c,v 1.77 2008/10/15 06:51:20 wrstuden Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_syscalls.c,v 1.78 2008/11/12 12:36:10 ad Exp $");
#if defined(_KERNEL_OPT)
#if defined(_KERNEL_OPT)
@@ -264,29 +264,16 @@ const char *const netbsd32_syscallnames[] = {
/* 207 */ "netbsd32_getpgid",
/* 208 */ "netbsd32_reboot",
/* 209 */ "netbsd32_poll",
-#if defined(LKM) || !defined(_KERNEL)
- /* 210 */ "lkmnosys",
- /* 211 */ "lkmnosys",
- /* 212 */ "lkmnosys",
- /* 213 */ "lkmnosys",
- /* 214 */ "lkmnosys",
- /* 215 */ "lkmnosys",
- /* 216 */ "lkmnosys",
- /* 217 */ "lkmnosys",
- /* 218 */ "lkmnosys",
- /* 219 */ "lkmnosys",
-#else /* !LKM || !_KERNEL */
- /* 210 */ "#210 (excluded lkmnosys)",
- /* 211 */ "#211 (excluded lkmnosys)",
- /* 212 */ "#212 (excluded lkmnosys)",
- /* 213 */ "#213 (excluded lkmnosys)",
- /* 214 */ "#214 (excluded lkmnosys)",
- /* 215 */ "#215 (excluded lkmnosys)",
- /* 216 */ "#216 (excluded lkmnosys)",
- /* 217 */ "#217 (excluded lkmnosys)",
- /* 218 */ "#218 (excluded lkmnosys)",
- /* 219 */ "#219 (excluded lkmnosys)",
-#endif /* !LKM || !_KERNEL */
+ /* 210 */ "#210 (unimplemented)",
+ /* 211 */ "#211 (unimplemented)",
+ /* 212 */ "#212 (unimplemented)",
+ /* 213 */ "#213 (unimplemented)",
+ /* 214 */ "#214 (unimplemented)",
+ /* 215 */ "#215 (unimplemented)",
+ /* 216 */ "#216 (unimplemented)",
+ /* 217 */ "#217 (unimplemented)",
+ /* 218 */ "#218 (unimplemented)",
+ /* 219 */ "#219 (unimplemented)",
#if defined(SYSVSEM) || !defined(_KERNEL)
/* 220 */ "compat_14_netbsd32___semctl",
/* 221 */ "netbsd32_semget",
diff --git a/sys/compat/netbsd32/netbsd32_sysent.c b/sys/compat/netbsd32/netbsd32_sysent.c
index ef06d544425..db05917685e 100644
--- a/sys/compat/netbsd32/netbsd32_sysent.c
+++ b/sys/compat/netbsd32/netbsd32_sysent.c
@@ -1,14 +1,14 @@
-/* $NetBSD: netbsd32_sysent.c,v 1.77 2008/10/15 06:51:20 wrstuden Exp $ */
+/* $NetBSD: netbsd32_sysent.c,v 1.78 2008/11/12 12:36:10 ad Exp $ */
/*
* System call switch table.
*
* DO NOT EDIT-- this file is automatically generated.
- * created from NetBSD: syscalls.master,v 1.69.4.3 2008/09/28 21:14:14 skrll Exp
+ * created from NetBSD: syscalls.master,v 1.70 2008/10/15 06:51:20 wrstuden Exp
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_sysent.c,v 1.77 2008/10/15 06:51:20 wrstuden Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_sysent.c,v 1.78 2008/11/12 12:36:10 ad Exp $");
#if defined(_KERNEL_OPT)
#include "opt_nfsserver.h"
@@ -550,49 +550,26 @@ struct sysent netbsd32_sysent[] = {
(sy_call_t *)netbsd32_reboot }, /* 208 = netbsd32_reboot */
{ ns(struct netbsd32_poll_args), 0,
(sy_call_t *)netbsd32_poll }, /* 209 = netbsd32_poll */
-#if defined(LKM) || !defined(_KERNEL)
{ 0, 0, 0,
- (sy_call_t *)sys_lkmnosys }, /* 210 = lkmnosys */
+ sys_nosys }, /* 210 = unimplemented */
{ 0, 0, 0,
- (sy_call_t *)sys_lkmnosys }, /* 211 = lkmnosys */
+ sys_nosys }, /* 211 = unimplemented */
{ 0, 0, 0,
- (sy_call_t *)sys_lkmnosys }, /* 212 = lkmnosys */
+ sys_nosys }, /* 212 = unimplemented */
{ 0, 0, 0,
- (sy_call_t *)sys_lkmnosys }, /* 213 = lkmnosys */
+ sys_nosys }, /* 213 = unimplemented */
{ 0, 0, 0,
- (sy_call_t *)sys_lkmnosys }, /* 214 = lkmnosys */
+ sys_nosys }, /* 214 = unimplemented */
{ 0, 0, 0,
- (sy_call_t *)sys_lkmnosys }, /* 215 = lkmnosys */
+ sys_nosys }, /* 215 = unimplemented */
{ 0, 0, 0,
- (sy_call_t *)sys_lkmnosys }, /* 216 = lkmnosys */
+ sys_nosys }, /* 216 = unimplemented */
{ 0, 0, 0,
- (sy_call_t *)sys_lkmnosys }, /* 217 = lkmnosys */
+ sys_nosys }, /* 217 = unimplemented */
{ 0, 0, 0,
- (sy_call_t *)sys_lkmnosys }, /* 218 = lkmnosys */
+ sys_nosys }, /* 218 = unimplemented */
{ 0, 0, 0,
- (sy_call_t *)sys_lkmnosys }, /* 219 = lkmnosys */
-#else /* !LKM || !_KERNEL */
- { 0, 0, 0,
- sys_nosys }, /* 210 = excluded lkmnosys */
- { 0, 0, 0,
- sys_nosys }, /* 211 = excluded lkmnosys */
- { 0, 0, 0,
- sys_nosys }, /* 212 = excluded lkmnosys */
- { 0, 0, 0,
- sys_nosys }, /* 213 = excluded lkmnosys */
- { 0, 0, 0,
- sys_nosys }, /* 214 = excluded lkmnosys */
- { 0, 0, 0,
- sys_nosys }, /* 215 = excluded lkmnosys */
- { 0, 0, 0,
- sys_nosys }, /* 216 = excluded lkmnosys */
- { 0, 0, 0,
- sys_nosys }, /* 217 = excluded lkmnosys */
- { 0, 0, 0,
- sys_nosys }, /* 218 = excluded lkmnosys */
- { 0, 0, 0,
- sys_nosys }, /* 219 = excluded lkmnosys */
-#endif /* !LKM || !_KERNEL */
+ sys_nosys }, /* 219 = unimplemented */
#if defined(SYSVSEM) || !defined(_KERNEL)
{ ns(struct compat_14_netbsd32___semctl_args), 0,
(sy_call_t *)compat_14(netbsd32___semctl) },/* 220 = compat_14_netbsd32___semctl */
diff --git a/sys/compat/netbsd32/syscalls.master b/sys/compat/netbsd32/syscalls.master
index 68504d2affa..d17baa3ab6f 100644
--- a/sys/compat/netbsd32/syscalls.master
+++ b/sys/compat/netbsd32/syscalls.master
@@ -1,4 +1,4 @@
- $NetBSD: syscalls.master,v 1.70 2008/10/15 06:51:20 wrstuden Exp $
+ $NetBSD: syscalls.master,v 1.71 2008/11/12 12:36:10 ad Exp $
; from: NetBSD: syscalls.master,v 1.81 1998/07/05 08:49:50 jonathan Exp
; @(#)syscalls.master 8.2 (Berkeley) 1/13/94
@@ -309,32 +309,16 @@
207 STD { int netbsd32_getpgid(pid_t pid); }
208 STD { int netbsd32_reboot(int opt, netbsd32_charp bootstr); }
209 STD { int netbsd32_poll(netbsd32_pollfdp_t fds, u_int nfds, int timeout); }
-;
-; Syscalls 210-219 are reserved for dynamically loaded syscalls
-;
-#if defined(LKM) || !defined(_KERNEL)
-210 NODEF { int sys_lkmnosys(void); }
-211 NODEF { int sys_lkmnosys(void); }
-212 NODEF { int sys_lkmnosys(void); }
-213 NODEF { int sys_lkmnosys(void); }
-214 NODEF { int sys_lkmnosys(void); }
-215 NODEF { int sys_lkmnosys(void); }
-216 NODEF { int sys_lkmnosys(void); }
-217 NODEF { int sys_lkmnosys(void); }
-218 NODEF { int sys_lkmnosys(void); }
-219 NODEF { int sys_lkmnosys(void); }
-#else /* !LKM || !_KERNEL */
-210 EXCL lkmnosys
-211 EXCL lkmnosys
-212 EXCL lkmnosys
-213 EXCL lkmnosys
-214 EXCL lkmnosys
-215 EXCL lkmnosys
-216 EXCL lkmnosys
-217 EXCL lkmnosys
-218 EXCL lkmnosys
-219 EXCL lkmnosys
-#endif /* !LKM || !_KERNEL */
+210 UNIMPL
+211 UNIMPL
+212 UNIMPL
+213 UNIMPL
+214 UNIMPL
+215 UNIMPL
+216 UNIMPL
+217 UNIMPL
+218 UNIMPL
+219 UNIMPL
; System calls 220-300 are reserved for use by NetBSD
#if defined(SYSVSEM) || !defined(_KERNEL)
220 COMPAT_14 { int netbsd32___semctl(int semid, int semnum, int cmd, netbsd32_semunu_t arg); }
diff --git a/sys/compat/sunos/sunos_misc.c b/sys/compat/sunos/sunos_misc.c
index dfae00fdb87..f52414b235f 100644
--- a/sys/compat/sunos/sunos_misc.c
+++ b/sys/compat/sunos/sunos_misc.c
@@ -1,4 +1,4 @@
-/* $NetBSD: sunos_misc.c,v 1.161 2008/08/07 20:15:32 plunky Exp $ */
+/* $NetBSD: sunos_misc.c,v 1.162 2008/11/12 12:36:10 ad Exp $ */
/*
* Copyright (c) 1992, 1993
@@ -50,11 +50,10 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sunos_misc.c,v 1.161 2008/08/07 20:15:32 plunky Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sunos_misc.c,v 1.162 2008/11/12 12:36:10 ad Exp $");
#if defined(_KERNEL_OPT)
#include "opt_nfsserver.h"
-#include "opt_ptrace.h"
#include "fs_nfs.h"
#endif
@@ -974,7 +973,6 @@ sunos_sys_setrlimit(struct lwp *l, const struct sunos_sys_setrlimit_args *uap, r
return compat_43_sys_setrlimit(l, &ua_43, retval);
}
-#if defined(PTRACE) || defined(_LKM)
/* for the m68k machines */
#ifndef PT_GETFPREGS
#define PT_GETFPREGS -1
@@ -990,20 +988,16 @@ static const int sreq2breq[] = {
PT_GETREGS, PT_SETREGS, PT_GETFPREGS, PT_SETFPREGS
};
static const int nreqs = sizeof(sreq2breq) / sizeof(sreq2breq[0]);
-#endif /* PTRACE || _LKM */
int
sunos_sys_ptrace(struct lwp *l, const struct sunos_sys_ptrace_args *uap, register_t *retval)
{
-#if defined(PTRACE) || defined(_LKM)
struct sys_ptrace_args pa;
int req;
-#ifdef _LKM
#define sys_ptrace sysent[SYS_ptrace].sy_call
if (sys_ptrace == sys_nosys)
return ENOSYS;
-#endif
req = SCARG(uap, req);
@@ -1020,9 +1014,6 @@ sunos_sys_ptrace(struct lwp *l, const struct sunos_sys_ptrace_args *uap, registe
SCARG(&pa, data) = SCARG(uap, data);
return sys_ptrace(l, &pa, retval);
-#else
- return ENOSYS;
-#endif /* PTRACE || _LKM */
}
/*
diff --git a/sys/compat/sunos32/sunos32_misc.c b/sys/compat/sunos32/sunos32_misc.c
index ea36fcc2714..d86b652367f 100644
--- a/sys/compat/sunos32/sunos32_misc.c
+++ b/sys/compat/sunos32/sunos32_misc.c
@@ -1,4 +1,4 @@
-/* $NetBSD: sunos32_misc.c,v 1.62 2008/08/07 20:15:32 plunky Exp $ */
+/* $NetBSD: sunos32_misc.c,v 1.63 2008/11/12 12:36:11 ad Exp $ */
/* from :NetBSD: sunos_misc.c,v 1.107 2000/12/01 19:25:10 jdolecek Exp */
/*
@@ -77,7 +77,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sunos32_misc.c,v 1.62 2008/08/07 20:15:32 plunky Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sunos32_misc.c,v 1.63 2008/11/12 12:36:11 ad Exp $");
#define COMPAT_SUNOS 1
@@ -85,7 +85,6 @@ __KERNEL_RCSID(0, "$NetBSD: sunos32_misc.c,v 1.62 2008/08/07 20:15:32 plunky Exp
#include "opt_nfsserver.h"
#include "opt_compat_43.h"
#include "opt_compat_netbsd.h"
-#include "opt_ptrace.h"
#include "fs_nfs.h"
#endif
@@ -1278,7 +1277,6 @@ sunos32_sys_setrlimit(struct lwp *l, const struct sunos32_sys_setrlimit_args *ua
return compat_43_netbsd32_osetrlimit(l, &ua_43, retval);
}
-#if defined(PTRACE) || defined(_LKM)
/* for the m68k machines */
#ifndef PT_GETFPREGS
#define PT_GETFPREGS -1
@@ -1294,12 +1292,10 @@ static const int sreq2breq[] = {
PT_GETREGS, PT_SETREGS, PT_GETFPREGS, PT_SETFPREGS
};
static const int nreqs = sizeof(sreq2breq) / sizeof(sreq2breq[0]);
-#endif
int
sunos32_sys_ptrace(struct lwp *l, const struct sunos32_sys_ptrace_args *uap, register_t *retval)
{
-#if defined(PTRACE) || defined(_LKM)
/* {
syscallarg(int) req;
syscallarg(pid_t) pid;
@@ -1310,11 +1306,9 @@ sunos32_sys_ptrace(struct lwp *l, const struct sunos32_sys_ptrace_args *uap, reg
struct netbsd32_ptrace_args pa;
int req;
-#ifdef _LKM
#define sys_ptrace sysent[SYS_ptrace].sy_call
if (sys_ptrace == sys_nosys)
return ENOSYS;
-#endif
req = SCARG(uap, req);
if ((unsigned int)req >= nreqs)
@@ -1330,9 +1324,6 @@ sunos32_sys_ptrace(struct lwp *l, const struct sunos32_sys_ptrace_args *uap, reg
SCARG(&pa, data) = SCARG(uap, data);
return netbsd32_ptrace(l, &pa, retval);
-#else
- return (ENOSYS);
-#endif /* PTRACE || _LKM */
}
/*
diff --git a/sys/compat/sys/socket.h b/sys/compat/sys/socket.h
index c698167caa6..32594aa7ca6 100644
--- a/sys/compat/sys/socket.h
+++ b/sys/compat/sys/socket.h
@@ -1,4 +1,4 @@
-/* $NetBSD: socket.h,v 1.9 2007/08/20 04:49:41 skd Exp $ */
+/* $NetBSD: socket.h,v 1.10 2008/11/12 12:36:11 ad Exp $ */
/*
* Copyright (c) 1982, 1985, 1986, 1988, 1993, 1994
@@ -42,7 +42,7 @@
#include "opt_compat_43.h"
#if defined(COMPAT_43) || defined(COMPAT_LINUX) || defined(COMPAT_SVR4) || \
- defined(COMPAT_ULTRIX) || defined(LKM)
+ defined(COMPAT_ULTRIX) || defined(MODULAR)
#define COMPAT_OSOCK
#endif