summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_sysctl.c
diff options
context:
space:
mode:
authorwollman <wollman@FreeBSD.org>1994-09-18 20:40:01 +0000
committerwollman <wollman@FreeBSD.org>1994-09-18 20:40:01 +0000
commit9028bd50ffd972e1a3b8145652ee9287ebd2f680 (patch)
tree0542820657279835e2be295c7ffed111332b0a03 /sys/kern/kern_sysctl.c
parent5de9aa67de26f3a6ec87731670b4bd6c04d312c3 (diff)
downloadFreeBSD-src-9028bd50ffd972e1a3b8145652ee9287ebd2f680.zip
FreeBSD-src-9028bd50ffd972e1a3b8145652ee9287ebd2f680.tar.gz
Redo Kernel NTP PLL support, kernel side.
This code is mostly taken from the 1.1 port (which was in turn taken from Dave Mills's kern.tar.Z example). A few significant differences: 1) ntp_gettime() is now a MIB variable rather than a system call. A few fiddles are done in libc to make it behave the same. 2) mono_time does not participate in the PLL adjustments. 3) A new interface has been defined (in <machine/clock.h>) for doing possibly machine-dependent things around the time of the clock update. This is used in Pentium kernels to disable interrupts, set `time', and reset the CPU cycle counter as quickly as possible to avoid jitter in microtime(). Measurements show an apparent resolution of a bit more than 8.14usec, which is reasonable given system-call overhead.
Diffstat (limited to 'sys/kern/kern_sysctl.c')
-rw-r--r--sys/kern/kern_sysctl.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/sys/kern/kern_sysctl.c b/sys/kern/kern_sysctl.c
index 9911879..457734d 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.10 1994/09/14 23:21:00 ache Exp $
+ * $Id: kern_sysctl.c,v 1.11 1994/09/16 00:53:58 ache Exp $
*/
/*
@@ -64,6 +64,7 @@ extern sysctlfn vm_sysctl;
extern sysctlfn fs_sysctl;
extern sysctlfn net_sysctl;
extern sysctlfn cpu_sysctl;
+extern sysctlfn ntp_sysctl;
/*
* Locking and stats
@@ -201,7 +202,8 @@ kern_sysctl(name, namelen, oldp, oldlenp, newp, newlen, p)
extern char ostype[], osrelease[];
/* all sysctl names at this level are terminal */
- if (namelen != 1 && !(name[0] == KERN_PROC || name[0] == KERN_PROF))
+ if (namelen != 1 && !(name[0] == KERN_PROC || name[0] == KERN_PROF
+ || name[0] == KERN_NTP_PLL))
return (ENOTDIR); /* overloaded */
switch (name[0]) {
@@ -289,6 +291,9 @@ kern_sysctl(name, namelen, oldp, oldlenp, newp, newlen, p)
#else
return (sysctl_rdint(oldp, oldlenp, newp, 0));
#endif
+ case KERN_NTP_PLL:
+ return (ntp_sysctl(name + 1, namelen - 1, oldp, oldlenp,
+ newp, newlen, p));
default:
return (EOPNOTSUPP);
}
OpenPOWER on IntegriCloud