aboutsummaryrefslogtreecommitdiff
path: root/sys/kern/kern_ntptime.c
diff options
context:
space:
mode:
authorLawrence Stewart <lstewart@FreeBSD.org>2011-12-24 01:32:01 +0000
committerLawrence Stewart <lstewart@FreeBSD.org>2011-12-24 01:32:01 +0000
commit6cedd609b7c631d5c417e182ad2735ef6e7a37e2 (patch)
treef6c0eaf45fcae96aeeac68d7acbad79ae3dd9c58 /sys/kern/kern_ntptime.c
parentda914858e19c90b60e6ed777681fa98750cf9e99 (diff)
downloadsrc-6cedd609b7c631d5c417e182ad2735ef6e7a37e2.tar.gz
src-6cedd609b7c631d5c417e182ad2735ef6e7a37e2.zip
Introduce the sysclock_getsnapshot() and sysclock_snap2bintime() KPIs. The
sysclock_getsnapshot() function allows the caller to obtain a snapshot of all the system clock and timecounter state required to create time stamps at a later point. The sysclock_snap2bintime() function converts a previously obtained snapshot into a bintime time stamp according to the specified flags e.g. which system clock, uptime vs absolute time, etc. These KPIs enable useful functionality, including direct comparison of the feedback and feed-forward system clocks and generation of multiple time stamps with different formats from a single timecounter read. Committed on behalf of Julien Ridoux and Darryl Veitch from the University of Melbourne, Australia, as part of the FreeBSD Foundation funded "Feed-Forward Clock Synchronization Algorithms" project. For more information, see http://www.synclab.org/radclock/ In collaboration with: Julien Ridoux (jridoux at unimelb edu au)
Notes
Notes: svn path=/head/; revision=228856
Diffstat (limited to 'sys/kern/kern_ntptime.c')
-rw-r--r--sys/kern/kern_ntptime.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/kern/kern_ntptime.c b/sys/kern/kern_ntptime.c
index 2669a54f0798..7da7de2b5e70 100644
--- a/sys/kern/kern_ntptime.c
+++ b/sys/kern/kern_ntptime.c
@@ -148,13 +148,13 @@ typedef int64_t l_fp;
#define SHIFT_FLL 2 /* FLL loop gain (shift) */
static int time_state = TIME_OK; /* clock state */
-static int time_status = STA_UNSYNC; /* clock status bits */
+int time_status = STA_UNSYNC; /* clock status bits */
static long time_tai; /* TAI offset (s) */
static long time_monitor; /* last time offset scaled (ns) */
static long time_constant; /* poll interval (shift) (s) */
static long time_precision = 1; /* clock precision (ns) */
static long time_maxerror = MAXPHASE / 1000; /* maximum error (us) */
-static long time_esterror = MAXPHASE / 1000; /* estimated error (us) */
+long time_esterror = MAXPHASE / 1000; /* estimated error (us) */
static long time_reftime; /* time at last adjustment (s) */
static l_fp time_offset; /* time offset (ns) */
static l_fp time_freq; /* frequency offset (ns/s) */