Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys compat code reorg.
details: https://anonhg.NetBSD.org/src/rev/5c57669f3781
branches: trunk
changeset: 584311:5c57669f3781
user: christos <christos%NetBSD.org@localhost>
date: Tue Sep 13 01:42:32 2005 +0000
description:
compat code reorg.
diffstat:
sys/compat/common/kern_sig_13.c | 6 +-
sys/compat/common/kern_sig_43.c | 6 +-
sys/compat/common/sysv_sem_14.c | 6 +-
sys/compat/common/vfs_syscalls_12.c | 6 +-
sys/compat/common/vfs_syscalls_20.c | 6 +-
sys/compat/common/vfs_syscalls_30.c | 6 +-
sys/compat/common/vfs_syscalls_43.c | 68 +++++++++++++-
sys/compat/darwin/darwin_attr.c | 7 +-
sys/compat/darwin/darwin_audit.c | 6 +-
sys/compat/darwin/darwin_exec.c | 6 +-
sys/compat/darwin/darwin_ioctl.c | 6 +-
sys/compat/darwin/darwin_ioframebuffer.c | 6 +-
sys/compat/darwin/darwin_ktrace.c | 6 +-
sys/compat/darwin/darwin_mman.c | 6 +-
sys/compat/darwin/darwin_mount.c | 6 +-
sys/compat/darwin/darwin_ptrace.c | 6 +-
sys/compat/darwin/darwin_signal.c | 7 +-
sys/compat/darwin/darwin_socket.c | 6 +-
sys/compat/darwin/darwin_stat.c | 7 +-
sys/compat/darwin/darwin_syscall.h | 2 +-
sys/compat/darwin/darwin_syscallargs.h | 2 +-
sys/compat/darwin/darwin_syscalls.c | 5 +-
sys/compat/darwin/darwin_sysctl.c | 7 +-
sys/compat/darwin/darwin_sysent.c | 5 +-
sys/compat/darwin/darwin_thread.c | 6 +-
sys/compat/darwin/darwin_unistd.c | 6 +-
sys/compat/darwin/syscalls.master | 3 +-
sys/compat/freebsd/freebsd_exec.c | 10 +-
sys/compat/freebsd/freebsd_exec_elf32.c | 10 +-
sys/compat/freebsd/freebsd_fork.c | 9 +-
sys/compat/freebsd/freebsd_ptrace.c | 9 +-
sys/compat/freebsd/freebsd_syscall.h | 4 +-
sys/compat/freebsd/freebsd_syscallargs.h | 4 +-
sys/compat/freebsd/freebsd_syscalls.c | 7 +-
sys/compat/freebsd/freebsd_sysent.c | 7 +-
sys/compat/freebsd/syscalls.master | 4 +-
sys/compat/ibcs2/ibcs2_ipc.c | 6 +-
sys/compat/sys/dirent.h | 45 +++++++++
sys/compat/sys/mman.h | 42 ++++++++
sys/compat/sys/mount.h | 96 +++++++++++++++++++
sys/compat/sys/sem.h | 77 +++++++++++++++
sys/compat/sys/signal.h | 88 +++++++++++++++++
sys/compat/sys/signalvar.h | 53 ++++++++++
sys/compat/sys/sigtypes.h | 83 ++++++++++++++++
sys/compat/sys/stat.h | 155 +++++++++++++++++++++++++++++++
sys/compat/sys/times.h | 48 +++++++++
sys/sys/dirent.h | 12 +--
sys/sys/mman.h | 7 +-
sys/sys/mount.h | 56 +-----------
sys/sys/sem.h | 25 +----
sys/sys/signal.h | 35 +------
sys/sys/signalvar.h | 15 +--
sys/sys/sigtypes.h | 41 +--------
sys/sys/stat.h | 102 +-------------------
sys/sys/statvfs.h | 5 +-
sys/sys/times.h | 6 +-
56 files changed, 913 insertions(+), 363 deletions(-)
diffs (truncated from 2291 to 300 lines):
diff -r f0c27699c582 -r 5c57669f3781 sys/compat/common/kern_sig_13.c
--- a/sys/compat/common/kern_sig_13.c Mon Sep 12 23:16:15 2005 +0000
+++ b/sys/compat/common/kern_sig_13.c Tue Sep 13 01:42:32 2005 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: kern_sig_13.c,v 1.9 2003/01/18 07:28:34 thorpej Exp $ */
+/* $NetBSD: kern_sig_13.c,v 1.10 2005/09/13 01:42:32 christos Exp $ */
/*-
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_sig_13.c,v 1.9 2003/01/18 07:28:34 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_sig_13.c,v 1.10 2005/09/13 01:42:32 christos Exp $");
#include <sys/param.h>
#include <sys/proc.h>
@@ -51,6 +51,8 @@
#include <machine/limits.h>
+#include <compat/sys/signal.h>
+#include <compat/sys/signalvar.h>
#include <compat/common/compat_util.h>
void
diff -r f0c27699c582 -r 5c57669f3781 sys/compat/common/kern_sig_43.c
--- a/sys/compat/common/kern_sig_43.c Mon Sep 12 23:16:15 2005 +0000
+++ b/sys/compat/common/kern_sig_43.c Tue Sep 13 01:42:32 2005 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: kern_sig_43.c,v 1.19 2003/09/06 22:09:20 christos Exp $ */
+/* $NetBSD: kern_sig_43.c,v 1.20 2005/09/13 01:42:32 christos Exp $ */
/*-
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_sig_43.c,v 1.19 2003/09/06 22:09:20 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_sig_43.c,v 1.20 2005/09/13 01:42:32 christos Exp $");
#if defined(_KERNEL_OPT)
#include "opt_compat_netbsd.h"
@@ -70,6 +70,8 @@
#include <sys/user.h> /* for coredump */
+#include <compat/sys/signal.h>
+
void compat_43_sigmask_to_sigset __P((const int *, sigset_t *));
void compat_43_sigset_to_sigmask __P((const sigset_t *, int *));
void compat_43_sigvec_to_sigaction __P((const struct sigvec *, struct sigaction *));
diff -r f0c27699c582 -r 5c57669f3781 sys/compat/common/sysv_sem_14.c
--- a/sys/compat/common/sysv_sem_14.c Mon Sep 12 23:16:15 2005 +0000
+++ b/sys/compat/common/sysv_sem_14.c Tue Sep 13 01:42:32 2005 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: sysv_sem_14.c,v 1.6 2005/02/26 23:10:18 perry Exp $ */
+/* $NetBSD: sysv_sem_14.c,v 1.7 2005/09/13 01:42:32 christos Exp $ */
/*-
* Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -38,7 +38,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sysv_sem_14.c,v 1.6 2005/02/26 23:10:18 perry Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sysv_sem_14.c,v 1.7 2005/09/13 01:42:32 christos Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -54,6 +54,8 @@
#include <sys/sa.h>
#include <sys/syscallargs.h>
+#include <compat/sys/sem.h>
+
static void semid_ds14_to_native __P((struct semid_ds14 *, struct semid_ds *));
static void native_to_semid_ds14 __P((struct semid_ds *, struct semid_ds14 *));
diff -r f0c27699c582 -r 5c57669f3781 sys/compat/common/vfs_syscalls_12.c
--- a/sys/compat/common/vfs_syscalls_12.c Mon Sep 12 23:16:15 2005 +0000
+++ b/sys/compat/common/vfs_syscalls_12.c Tue Sep 13 01:42:32 2005 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: vfs_syscalls_12.c,v 1.15 2003/11/19 15:48:21 christos Exp $ */
+/* $NetBSD: vfs_syscalls_12.c,v 1.16 2005/09/13 01:42:32 christos Exp $ */
/*
* Copyright (c) 1989, 1993
@@ -37,7 +37,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: vfs_syscalls_12.c,v 1.15 2003/11/19 15:48:21 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_syscalls_12.c,v 1.16 2005/09/13 01:42:32 christos Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -56,6 +56,8 @@
#include <sys/sa.h>
#include <sys/syscallargs.h>
+#include <compat/sys/stat.h>
+
static void cvtstat __P((struct stat *, struct stat12 *));
/*
diff -r f0c27699c582 -r 5c57669f3781 sys/compat/common/vfs_syscalls_20.c
--- a/sys/compat/common/vfs_syscalls_20.c Mon Sep 12 23:16:15 2005 +0000
+++ b/sys/compat/common/vfs_syscalls_20.c Tue Sep 13 01:42:32 2005 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: vfs_syscalls_20.c,v 1.4 2005/02/26 23:10:18 perry Exp $ */
+/* $NetBSD: vfs_syscalls_20.c,v 1.5 2005/09/13 01:42:32 christos Exp $ */
/*
* Copyright (c) 1989, 1993
@@ -37,7 +37,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: vfs_syscalls_20.c,v 1.4 2005/02/26 23:10:18 perry Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_syscalls_20.c,v 1.5 2005/09/13 01:42:32 christos Exp $");
#include "opt_compat_netbsd.h"
#include "opt_compat_43.h"
@@ -64,6 +64,8 @@
#include <sys/ktrace.h>
#endif
+#include <compat/sys/mount.h>
+
#ifdef COMPAT_09
#define MOUNTNO_NONE 0
#define MOUNTNO_UFS 1 /* UNIX "Fast" Filesystem */
diff -r f0c27699c582 -r 5c57669f3781 sys/compat/common/vfs_syscalls_30.c
--- a/sys/compat/common/vfs_syscalls_30.c Mon Sep 12 23:16:15 2005 +0000
+++ b/sys/compat/common/vfs_syscalls_30.c Tue Sep 13 01:42:32 2005 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: vfs_syscalls_30.c,v 1.4 2005/08/19 13:17:37 yamt Exp $ */
+/* $NetBSD: vfs_syscalls_30.c,v 1.5 2005/09/13 01:42:32 christos Exp $ */
/*-
* Copyright (c) 2005 The NetBSD Foundation, Inc.
@@ -36,7 +36,7 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: vfs_syscalls_30.c,v 1.4 2005/08/19 13:17:37 yamt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_syscalls_30.c,v 1.5 2005/09/13 01:42:32 christos Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -57,6 +57,8 @@
#include <sys/syscallargs.h>
#include <compat/common/compat_util.h>
+#include <compat/sys/stat.h>
+#include <compat/sys/dirent.h>
static void cvtstat(struct stat13 *, const struct stat *);
diff -r f0c27699c582 -r 5c57669f3781 sys/compat/common/vfs_syscalls_43.c
--- a/sys/compat/common/vfs_syscalls_43.c Mon Sep 12 23:16:15 2005 +0000
+++ b/sys/compat/common/vfs_syscalls_43.c Tue Sep 13 01:42:32 2005 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: vfs_syscalls_43.c,v 1.29 2005/02/26 23:10:18 perry Exp $ */
+/* $NetBSD: vfs_syscalls_43.c,v 1.30 2005/09/13 01:42:32 christos Exp $ */
/*
* Copyright (c) 1989, 1993
@@ -37,7 +37,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: vfs_syscalls_43.c,v 1.29 2005/02/26 23:10:18 perry Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_syscalls_43.c,v 1.30 2005/09/13 01:42:32 christos Exp $");
#if defined(_KERNEL_OPT)
#include "fs_union.h"
@@ -61,11 +61,15 @@
#include <sys/syslog.h>
#include <sys/unistd.h>
#include <sys/resourcevar.h>
+#include <sys/sysctl.h>
#include <sys/mount.h>
#include <sys/sa.h>
#include <sys/syscallargs.h>
+#include <compat/sys/stat.h>
+#include <compat/sys/mount.h>
+
static void cvtstat __P((struct stat *, struct stat43 *));
/*
@@ -505,3 +509,63 @@
FILE_UNUSE(fp, p);
return (error);
}
+
+/*
+ * sysctl helper routine for vfs.generic.conf lookups.
+ */
+#if defined(COMPAT_09) || defined(COMPAT_43) || defined(COMPAT_44)
+static int
+sysctl_vfs_generic_conf(SYSCTLFN_ARGS)
+{
+ struct vfsconf vfc;
+ extern const char * const mountcompatnames[];
+ extern int nmountcompatnames;
+ struct sysctlnode node;
+ struct vfsops *vfsp;
+ u_int vfsnum;
+
+ if (namelen != 1)
+ return (ENOTDIR);
+ vfsnum = name[0];
+ if (vfsnum >= nmountcompatnames ||
+ mountcompatnames[vfsnum] == NULL)
+ return (EOPNOTSUPP);
+ vfsp = vfs_getopsbyname(mountcompatnames[vfsnum]);
+ if (vfsp == NULL)
+ return (EOPNOTSUPP);
+
+ vfc.vfc_vfsops = vfsp;
+ strncpy(vfc.vfc_name, vfsp->vfs_name, MFSNAMELEN);
+ vfc.vfc_typenum = vfsnum;
+ vfc.vfc_refcount = vfsp->vfs_refcount;
+ vfc.vfc_flags = 0;
+ vfc.vfc_mountroot = vfsp->vfs_mountroot;
+ vfc.vfc_next = NULL;
+
+ node = *rnode;
+ node.sysctl_data = &vfc;
+ return (sysctl_lookup(SYSCTLFN_CALL(&node)));
+}
+
+/*
+ * Top level filesystem related information gathering.
+ */
+SYSCTL_SETUP(compat_sysctl_vfs_setup, "compat sysctl vfs subtree setup")
+{
+ extern int nmountcompatnames;
+
+ sysctl_createv(clog, 0, NULL, NULL,
+ CTLFLAG_PERMANENT|CTLFLAG_IMMEDIATE,
+ CTLTYPE_INT, "maxtypenum",
+ SYSCTL_DESCR("Highest valid filesystem type number"),
+ NULL, nmountcompatnames, NULL, 0,
+ CTL_VFS, VFS_GENERIC, VFS_MAXTYPENUM, CTL_EOL);
+ sysctl_createv(clog, 0, NULL, NULL,
+ CTLFLAG_PERMANENT,
+ CTLTYPE_STRUCT, "conf",
+ SYSCTL_DESCR("Filesystem configuration information"),
+ sysctl_vfs_generic_conf, 0, NULL,
+ sizeof(struct vfsconf),
+ CTL_VFS, VFS_GENERIC, VFS_CONF, CTL_EOL);
+}
+#endif
diff -r f0c27699c582 -r 5c57669f3781 sys/compat/darwin/darwin_attr.c
--- a/sys/compat/darwin/darwin_attr.c Mon Sep 12 23:16:15 2005 +0000
+++ b/sys/compat/darwin/darwin_attr.c Tue Sep 13 01:42:32 2005 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: darwin_attr.c,v 1.7 2005/08/19 02:03:57 christos Exp $ */
+/* $NetBSD: darwin_attr.c,v 1.8 2005/09/13 01:42:32 christos Exp $ */
/*-
* Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: darwin_attr.c,v 1.7 2005/08/19 02:03:57 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: darwin_attr.c,v 1.8 2005/09/13 01:42:32 christos Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -54,6 +54,9 @@
#include <sys/stat.h>
#include <sys/syscallargs.h>
+#include <compat/sys/signal.h>
+#include <compat/sys/mount.h>
+
#include <compat/common/compat_util.h>
#include <compat/mach/mach_types.h>
diff -r f0c27699c582 -r 5c57669f3781 sys/compat/darwin/darwin_audit.c
--- a/sys/compat/darwin/darwin_audit.c Mon Sep 12 23:16:15 2005 +0000
+++ b/sys/compat/darwin/darwin_audit.c Tue Sep 13 01:42:32 2005 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: darwin_audit.c,v 1.1 2004/07/28 22:24:06 manu Exp $ */
+/* $NetBSD: darwin_audit.c,v 1.2 2005/09/13 01:42:32 christos Exp $ */
/*-
* Copyright (c) 2004 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
*/
Home |
Main Index |
Thread Index |
Old Index