Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-6]: src/sys Pull up following revision(s) (requested by pgoyette ...



details:   https://anonhg.NetBSD.org/src/rev/3ab99d37d74c
branches:  netbsd-6
changeset: 775722:3ab99d37d74c
user:      riz <riz%NetBSD.org@localhost>
date:      Thu Mar 14 16:33:09 2013 +0000

description:
Pull up following revision(s) (requested by pgoyette in ticket #837):
        sys/compat/common/kern_time_50.c: revision 1.25
        sys/kern/init_sysctl.c: revision 1.195
        sys/kern/init_main.c: revision 1.447
        sys/compat/common/compat_util.h: revision 1.23
        sys/compat/common/compat_mod.h: revision 1.1
        sys/compat/common/compat_mod.c: revision 1.16
        sys/compat/common/compat_mod.c: revision 1.17
        sys/compat/common/compat_mod.c: revision 1.18
        sys/compat/common/vfs_syscalls_43.c: revision 1.55
Move boottime50 and its associated sysctl into the compat module.  As
noted on tech-kern.  Should fix PR/47579.
OK christos@
Will request pull-up to 6.0 in a few days.
Wrap sysctl_teardown(&compat_clog) with the appropriate #if defined()s
remove empty #if

diffstat:

 sys/compat/common/compat_mod.c      |  35 ++++++++++++++++++++++++++-----
 sys/compat/common/compat_mod.h      |  41 +++++++++++++++++++++++++++++++++++++
 sys/compat/common/compat_util.h     |   5 +---
 sys/compat/common/kern_time_50.c    |  24 +++++++++++++++++++-
 sys/compat/common/vfs_syscalls_43.c |  20 ++++++-----------
 sys/kern/init_main.c                |  17 ++------------
 sys/kern/init_sysctl.c              |  19 +---------------
 7 files changed, 105 insertions(+), 56 deletions(-)

diffs (truncated from 367 to 300 lines):

diff -r ae5e4784f897 -r 3ab99d37d74c sys/compat/common/compat_mod.c
--- a/sys/compat/common/compat_mod.c    Thu Mar 14 15:54:58 2013 +0000
+++ b/sys/compat/common/compat_mod.c    Thu Mar 14 16:33:09 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: compat_mod.c,v 1.14 2011/08/08 23:44:06 jakllsch Exp $ */
+/*     $NetBSD: compat_mod.c,v 1.14.8.1 2013/03/14 16:33:09 riz Exp $  */
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: compat_mod.c,v 1.14 2011/08/08 23:44:06 jakllsch Exp $");
+__KERNEL_RCSID(0, "$NetBSD: compat_mod.c,v 1.14.8.1 2013/03/14 16:33:09 riz Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_compat_netbsd.h"
@@ -52,12 +52,18 @@
 #include <sys/syscall.h>
 #include <sys/syscallargs.h>
 #include <sys/syscallvar.h>
+#include <sys/sysctl.h>
 
 #include <uvm/uvm_extern.h>
 #include <uvm/uvm_object.h>
 
 #include <compat/common/compat_util.h>
+#include <compat/common/compat_mod.h>
 
+#if defined(COMPAT_09) || defined(COMPAT_43) || defined(COMPAT_50)
+static struct sysctllog *compat_clog = NULL;
+#endif
+ 
 MODULE(MODULE_CLASS_MISC, compat, NULL);
 
 int    ttcompat(struct tty *, u_long, void *, int, struct lwp *);
@@ -269,9 +275,7 @@
                sendsig_sigcontext_vec = sendsig_sigcontext;
 #endif
 #endif
-#if defined(COMPAT_09) || defined(COMPAT_43)
                compat_sysctl_init();
-#endif
                return 0;
 
        case MODULE_CMD_FINI:
@@ -328,12 +332,31 @@
                rw_exit(&exec_lock);
 #endif
 #endif /* COMPAT_16 */
-#if defined(COMPAT_09) || defined(COMPAT_43)
                compat_sysctl_fini();
-#endif
                return 0;
 
        default:
                return ENOTTY;
        }
 }
+
+void
+compat_sysctl_init(void)
+{
+
+#if defined(COMPAT_09) || defined(COMPAT_43)
+       compat_sysctl_vfs(&compat_clog);
+#endif
+#if defined(COMPAT_50)
+       compat_sysctl_time(&compat_clog);
+#endif
+}
+
+void
+compat_sysctl_fini(void)
+{
+ 
+#if defined(COMPAT_09) || defined(COMPAT_43) || defined(COMPAT_50)
+        sysctl_teardown(&compat_clog);
+#endif
+}
diff -r ae5e4784f897 -r 3ab99d37d74c sys/compat/common/compat_mod.h
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/compat/common/compat_mod.h    Thu Mar 14 16:33:09 2013 +0000
@@ -0,0 +1,41 @@
+/*     $NetBSD: compat_mod.h,v 1.1.6.2 2013/03/14 16:33:09 riz Exp $   */
+
+/*-
+ * Copyright (c) 2013 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Christos Zoulas.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef        _COMPAT_MOD_H
+#define        _COMPAT_MOD_H
+
+void compat_sysctl_init(void);
+void compat_sysctl_fini(void);
+
+void compat_sysctl_time(struct sysctllog **);
+void compat_sysctl_vfs(struct sysctllog **);
+
+#endif /* !_COMPAT_MOD_H_ */
diff -r ae5e4784f897 -r 3ab99d37d74c sys/compat/common/compat_util.h
--- a/sys/compat/common/compat_util.h   Thu Mar 14 15:54:58 2013 +0000
+++ b/sys/compat/common/compat_util.h   Thu Mar 14 16:33:09 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: compat_util.h,v 1.22 2009/12/14 04:09:38 mrg Exp $     */
+/*     $NetBSD: compat_util.h,v 1.22.18.1 2013/03/14 16:33:09 riz Exp $        */
 
 /*-
  * Copyright (c) 1994 The NetBSD Foundation, Inc.
@@ -82,7 +82,4 @@
 
 int compat_elf_check_interp(struct exec_package *, char *, const char *);
 
-void compat_sysctl_init(void);
-void compat_sysctl_fini(void);
-
 #endif /* !_COMPAT_UTIL_H_ */
diff -r ae5e4784f897 -r 3ab99d37d74c sys/compat/common/kern_time_50.c
--- a/sys/compat/common/kern_time_50.c  Thu Mar 14 15:54:58 2013 +0000
+++ b/sys/compat/common/kern_time_50.c  Thu Mar 14 16:33:09 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: kern_time_50.c,v 1.22 2012/01/04 14:31:17 apb Exp $    */
+/*     $NetBSD: kern_time_50.c,v 1.22.2.1 2013/03/14 16:33:09 riz Exp $        */
 
 /*-
  * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_time_50.c,v 1.22 2012/01/04 14:31:17 apb Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_time_50.c,v 1.22.2.1 2013/03/14 16:33:09 riz Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_aio.h"
@@ -58,14 +58,18 @@
 #include <sys/aio.h>
 #include <sys/poll.h>
 #include <sys/syscallargs.h>
+#include <sys/sysctl.h>
 #include <sys/resource.h>
 
 #include <compat/common/compat_util.h>
+#include <compat/common/compat_mod.h>
 #include <compat/sys/time.h>
 #include <compat/sys/timex.h>
 #include <compat/sys/resource.h>
 #include <compat/sys/clockctl.h>
 
+struct timeval50 boottime50; 
+
 int
 compat_50_sys_clock_gettime(struct lwp *l,
     const struct compat_50_sys_clock_gettime_args *uap, register_t *retval)
@@ -717,3 +721,19 @@
 
        return error;
 }
+
+void
+compat_sysctl_time(struct sysctllog **clog)
+{
+       struct timeval tv;
+
+       TIMESPEC_TO_TIMEVAL(&tv, &boottime);
+       timeval_to_timeval50(&tv, &boottime50);
+
+       sysctl_createv(clog, 0, NULL, NULL,
+               CTLFLAG_PERMANENT, 
+               CTLTYPE_STRUCT, "oboottime", 
+               SYSCTL_DESCR("System boot time"),
+               NULL, 0, &boottime50, sizeof(boottime50),
+               CTL_KERN, KERN_OBOOTTIME, CTL_EOL);
+}
diff -r ae5e4784f897 -r 3ab99d37d74c sys/compat/common/vfs_syscalls_43.c
--- a/sys/compat/common/vfs_syscalls_43.c       Thu Mar 14 15:54:58 2013 +0000
+++ b/sys/compat/common/vfs_syscalls_43.c       Thu Mar 14 16:33:09 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: vfs_syscalls_43.c,v 1.54 2010/11/19 06:44:36 dholland Exp $    */
+/*     $NetBSD: vfs_syscalls_43.c,v 1.54.14.1 2013/03/14 16:33:09 riz Exp $    */
 
 /*
  * Copyright (c) 1989, 1993
@@ -37,7 +37,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: vfs_syscalls_43.c,v 1.54 2010/11/19 06:44:36 dholland Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_syscalls_43.c,v 1.54.14.1 2013/03/14 16:33:09 riz Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_compat_netbsd.h"
@@ -58,6 +58,7 @@
 #include <sys/malloc.h>
 #include <sys/ioctl.h>
 #include <sys/fcntl.h>
+#include <sys/sysctl.h>
 #include <sys/syslog.h>
 #include <sys/unistd.h>
 #include <sys/resourcevar.h>
@@ -71,6 +72,7 @@
 #include <compat/sys/mount.h>
 
 #include <compat/common/compat_util.h>
+#include <compat/common/compat_mod.h>
 
 static void cvtstat(struct stat *, struct stat43 *);
 
@@ -458,7 +460,6 @@
  * sysctl helper routine for vfs.generic.conf lookups.
  */
 #if defined(COMPAT_09) || defined(COMPAT_43) || defined(COMPAT_44)
-static struct sysctllog *compat_clog;
 
 static int
 sysctl_vfs_generic_conf(SYSCTLFN_ARGS)
@@ -498,17 +499,17 @@
  * Top level filesystem related information gathering.
  */
 void
-compat_sysctl_init(void)
+compat_sysctl_vfs(struct sysctllog **clog)
 {
        extern int nmountcompatnames;
 
-       sysctl_createv(&compat_clog, 0, NULL, NULL,
+       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(&compat_clog, 0, NULL, NULL,
+       sysctl_createv(clog, 0, NULL, NULL,
                       CTLFLAG_PERMANENT,
                       CTLTYPE_STRUCT, "conf",
                       SYSCTL_DESCR("Filesystem configuration information"),
@@ -516,11 +517,4 @@
                       sizeof(struct vfsconf),
                       CTL_VFS, VFS_GENERIC, VFS_CONF, CTL_EOL);
 }
-
-void
-compat_sysctl_fini(void)
-{
-
-       sysctl_teardown(&compat_clog);
-}
 #endif
diff -r ae5e4784f897 -r 3ab99d37d74c sys/kern/init_main.c
--- a/sys/kern/init_main.c      Thu Mar 14 15:54:58 2013 +0000
+++ b/sys/kern/init_main.c      Thu Mar 14 16:33:09 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: init_main.c,v 1.441.2.2 2012/08/08 15:51:06 martin Exp $       */
+/*     $NetBSD: init_main.c,v 1.441.2.3 2013/03/14 16:33:10 riz Exp $  */
 
 /*-
  * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
@@ -97,7 +97,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: init_main.c,v 1.441.2.2 2012/08/08 15:51:06 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: init_main.c,v 1.441.2.3 2013/03/14 16:33:10 riz Exp $");
 
 #include "opt_ddb.h"
 #include "opt_ipsec.h"
@@ -239,11 +239,6 @@
 
 #include <prop/proplib.h>
 
-#ifdef COMPAT_50
-#include <compat/sys/time.h>
-struct timeval50 boottime50;



Home | Main Index | Thread Index | Old Index