From a52752a4572e872c703d21e13309cfdcf7973e93 Mon Sep 17 00:00:00 2001 From: Poul-Henning Kamp Date: Tue, 14 Nov 1995 09:07:14 +0000 Subject: [PATCH] Move KERN_NTP to a more suitable file. --- sys/kern/kern_ntptime.c | 21 ++++++++------------- sys/kern/kern_sysctl.c | 5 +---- 2 files changed, 9 insertions(+), 17 deletions(-) diff --git a/sys/kern/kern_ntptime.c b/sys/kern/kern_ntptime.c index 421200a37312..8a2e0063b390 100644 --- a/sys/kern/kern_ntptime.c +++ b/sys/kern/kern_ntptime.c @@ -81,23 +81,13 @@ extern long pps_errcnt; /* calibration errors */ extern long pps_stbcnt; /* stability limit exceeded */ #endif /* PPS_SYNC */ -int -ntp_sysctl(int *name, u_int namelen, void *oldp, size_t *oldlenp, - void *newp, size_t newlen, struct proc *p) +static int +ntp_sysctl SYSCTL_HANDLER_ARGS { struct timeval atv; struct ntptimeval ntv; int s; - /* All names at this level are terminal. */ - if (namelen != 1) { - return ENOTDIR; - } - - if (name[0] != NTP_PLL_GETTIME) { - return EOPNOTSUPP; - } - s = splclock(); #ifdef EXT_CLOCK /* @@ -163,9 +153,14 @@ ntp_sysctl(int *name, u_int namelen, void *oldp, size_t *oldlenp, time_status & (STA_PPSWANDER | STA_PPSERROR)) { ntv.time_state = TIME_ERROR; } - return(sysctl_rdstruct(oldp, oldlenp, newp, &ntv, sizeof ntv)); + return (sysctl_handle_opaque(oidp, &ntv, sizeof ntv, req)); } +SYSCTL_NODE(_kern, KERN_NTP_PLL, ntp_pll, CTLFLAG_RW, 0, + "NTP kernel PLL related stuff"); +SYSCTL_PROC(_kern_ntp_pll, NTP_PLL_GETTIME, gettime, CTLTYPE_OPAQUE|CTLFLAG_RD, + 0, sizeof(struct ntptimeval) , ntp_sysctl, ""); + /* * ntp_adjtime() - NTP daemon application interface */ diff --git a/sys/kern/kern_sysctl.c b/sys/kern/kern_sysctl.c index fd0e30d9fc23..1b20069eafd3 100644 --- a/sys/kern/kern_sysctl.c +++ b/sys/kern/kern_sysctl.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * @(#)kern_sysctl.c 8.4 (Berkeley) 4/14/94 - * $Id: kern_sysctl.c,v 1.39 1995/11/13 13:54:09 phk Exp $ + * $Id: kern_sysctl.c,v 1.40 1995/11/14 09:05:40 phk Exp $ */ /* @@ -729,9 +729,6 @@ kern_sysctl(name, namelen, oldp, oldlenp, newp, newlen, p) return (sysctl_doprof(name + 1, namelen - 1, oldp, oldlenp, newp, newlen)); #endif - case KERN_NTP_PLL: - return (ntp_sysctl(name + 1, namelen - 1, oldp, oldlenp, - newp, newlen, p)); case KERN_DUMPDEV: ndumpdev = dumpdev; error = sysctl_struct(oldp, oldlenp, newp, newlen, &ndumpdev,