Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/kern move clock sysctls from init_sysctl.c to kern_clock.c
details: https://anonhg.NetBSD.org/src/rev/2446a38e3202
branches: trunk
changeset: 337644:2446a38e3202
user: pooka <pooka%NetBSD.org@localhost>
date: Wed Apr 22 16:42:24 2015 +0000
description:
move clock sysctls from init_sysctl.c to kern_clock.c
diffstat:
sys/kern/init_sysctl.c | 39 ++-------------------------------------
sys/kern/kern_clock.c | 41 +++++++++++++++++++++++++++++++++++++++--
2 files changed, 41 insertions(+), 39 deletions(-)
diffs (154 lines):
diff -r 006cb3c39c94 -r 2446a38e3202 sys/kern/init_sysctl.c
--- a/sys/kern/init_sysctl.c Wed Apr 22 16:01:07 2015 +0000
+++ b/sys/kern/init_sysctl.c Wed Apr 22 16:42:24 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: init_sysctl.c,v 1.204 2014/08/03 09:15:21 apb Exp $ */
+/* $NetBSD: init_sysctl.c,v 1.205 2015/04/22 16:42:24 pooka Exp $ */
/*-
* Copyright (c) 2003, 2007, 2008, 2009 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: init_sysctl.c,v 1.204 2014/08/03 09:15:21 apb Exp $");
+__KERNEL_RCSID(0, "$NetBSD: init_sysctl.c,v 1.205 2015/04/22 16:42:24 pooka Exp $");
#include "opt_sysv.h"
#include "opt_compat_netbsd.h"
@@ -105,7 +105,6 @@
static int sysctl_kern_rtc_offset(SYSCTLFN_PROTO);
static int sysctl_kern_maxproc(SYSCTLFN_PROTO);
static int sysctl_kern_hostid(SYSCTLFN_PROTO);
-static int sysctl_kern_clockrate(SYSCTLFN_PROTO);
static int sysctl_msgbuf(SYSCTLFN_PROTO);
static int sysctl_kern_defcorename(SYSCTLFN_PROTO);
static int sysctl_kern_cptime(SYSCTLFN_PROTO);
@@ -176,19 +175,6 @@
CTL_KERN, KERN_HOSTID, CTL_EOL);
sysctl_createv(clog, 0, NULL, NULL,
CTLFLAG_PERMANENT,
- CTLTYPE_STRUCT, "clockrate",
- SYSCTL_DESCR("Kernel clock rates"),
- sysctl_kern_clockrate, 0, NULL,
- sizeof(struct clockinfo),
- CTL_KERN, KERN_CLOCKRATE, CTL_EOL);
- sysctl_createv(clog, 0, NULL, NULL,
- CTLFLAG_PERMANENT,
- CTLTYPE_INT, "hardclock_ticks",
- SYSCTL_DESCR("Number of hardclock ticks"),
- NULL, 0, &hardclock_ticks, sizeof(hardclock_ticks),
- CTL_KERN, KERN_HARDCLOCK_TICKS, CTL_EOL);
- sysctl_createv(clog, 0, NULL, NULL,
- CTLFLAG_PERMANENT,
CTLTYPE_STRUCT, "vnode",
SYSCTL_DESCR("System vnode table"),
sysctl_kern_vnode, 0, NULL, 0,
@@ -956,27 +942,6 @@
}
/*
- * sysctl helper routine for kern.clockrate. Assembles a struct on
- * the fly to be returned to the caller.
- */
-static int
-sysctl_kern_clockrate(SYSCTLFN_ARGS)
-{
- struct clockinfo clkinfo;
- struct sysctlnode node;
-
- clkinfo.tick = tick;
- clkinfo.tickadj = tickadj;
- clkinfo.hz = hz;
- clkinfo.profhz = profhz;
- clkinfo.stathz = stathz ? stathz : hz;
-
- node = *rnode;
- node.sysctl_data = &clkinfo;
- return (sysctl_lookup(SYSCTLFN_CALL(&node)));
-}
-
-/*
* sysctl helper routine for kern.msgbufsize and kern.msgbuf. For the
* former it merely checks the message buffer is set up. For the latter,
* it also copies out the data if necessary.
diff -r 006cb3c39c94 -r 2446a38e3202 sys/kern/kern_clock.c
--- a/sys/kern/kern_clock.c Wed Apr 22 16:01:07 2015 +0000
+++ b/sys/kern/kern_clock.c Wed Apr 22 16:42:24 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: kern_clock.c,v 1.131 2012/12/02 01:05:16 chs Exp $ */
+/* $NetBSD: kern_clock.c,v 1.132 2015/04/22 16:42:24 pooka Exp $ */
/*-
* Copyright (c) 2000, 2004, 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -69,7 +69,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_clock.c,v 1.131 2012/12/02 01:05:16 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_clock.c,v 1.132 2015/04/22 16:42:24 pooka Exp $");
#include "opt_dtrace.h"
#include "opt_ntp.h"
@@ -101,6 +101,8 @@
cyclic_clock_func_t cyclic_clock_func[MAXCPUS];
#endif
+static int sysctl_kern_clockrate(SYSCTLFN_PROTO);
+
/*
* Clock handling routines.
*
@@ -161,6 +163,7 @@
void
initclocks(void)
{
+ static struct sysctllog *clog;
int i;
/*
@@ -190,6 +193,19 @@
panic("hardscheddiv");
}
+ sysctl_createv(&clog, 0, NULL, NULL,
+ CTLFLAG_PERMANENT,
+ CTLTYPE_STRUCT, "clockrate",
+ SYSCTL_DESCR("Kernel clock rates"),
+ sysctl_kern_clockrate, 0, NULL,
+ sizeof(struct clockinfo),
+ CTL_KERN, KERN_CLOCKRATE, CTL_EOL);
+ sysctl_createv(&clog, 0, NULL, NULL,
+ CTLFLAG_PERMANENT,
+ CTLTYPE_INT, "hardclock_ticks",
+ SYSCTL_DESCR("Number of hardclock ticks"),
+ NULL, 0, &hardclock_ticks, sizeof(hardclock_ticks),
+ CTL_KERN, KERN_HARDCLOCK_TICKS, CTL_EOL);
}
/*
@@ -449,3 +465,24 @@
mutex_spin_exit(&p->p_stmutex);
}
}
+
+/*
+ * sysctl helper routine for kern.clockrate. Assembles a struct on
+ * the fly to be returned to the caller.
+ */
+static int
+sysctl_kern_clockrate(SYSCTLFN_ARGS)
+{
+ struct clockinfo clkinfo;
+ struct sysctlnode node;
+
+ clkinfo.tick = tick;
+ clkinfo.tickadj = tickadj;
+ clkinfo.hz = hz;
+ clkinfo.profhz = profhz;
+ clkinfo.stathz = stathz ? stathz : hz;
+
+ node = *rnode;
+ node.sysctl_data = &clkinfo;
+ return (sysctl_lookup(SYSCTLFN_CALL(&node)));
+}
Home |
Main Index |
Thread Index |
Old Index