* support is used as described above; if false, the kernel is bypassed
* entirely and the daemon PLL used instead.
*
+ * There have been three versions of the kernel discipline code. The
+ * first (microkernel) now in Solaris discipilnes the microseconds. The
+ * second and third (nanokernel) disciplines the clock in nanoseconds.
+ * These versions are identifed if the symbol STA_PLL is present in the
+ * header file /usr/include/sys/timex.h. The third and current version
+ * includes TAI offset and is identified by the symbol NTP_API with
+ * value 4.
+ *
* Each update to a prefer peer sets pps_stratum if it survives the
* intersection algorithm and its time is within range. The PPS time
* discipline is enabled (STA_PPSTIME bit set in the status word) when
#ifdef KERNEL_PLL
struct timex ntv; /* kernel API parameters */
int pll_status; /* status bits for kernel pll */
-int pll_nano; /* nanosecond kernel switch */
#endif /* KERNEL_PLL */
/*
break;
}
}
-#ifdef STA_NANO
+#if defined(STA_NANO) && NTP_API == 4
if (pll_control && kern_enable && sys_tai == 0) {
memset(&ntv, 0, sizeof(ntv));
ntv.modes = MOD_TAI;
dtemp = -.5;
else
dtemp = .5;
- if (pll_nano) {
- ntv.offset = (int32)(clock_offset *
- 1e9 + dtemp);
- ntv.constant = sys_poll;
- } else {
- ntv.offset = (int32)(clock_offset *
- 1e6 + dtemp);
- ntv.constant = sys_poll - 4;
- }
+#ifdef STA_NANO
+ ntv.offset = (int32)(clock_offset * 1e9 +
+ dtemp);
+ ntv.constant = sys_poll;
+#else /* STA_NANO */
+ ntv.offset = (int32)(clock_offset * 1e6 +
+ dtemp);
+ ntv.constant = sys_poll - 4;
+#endif /* STA_NANO */
if (clock_frequency != 0) {
ntv.modes |= MOD_FREQUENCY;
ntv.freq = (int32)((clock_frequency +
ntv.status);
}
pll_status = ntv.status;
- if (pll_nano)
- clock_offset = ntv.offset / 1e9;
- else
- clock_offset = ntv.offset / 1e6;
+#ifdef STA_NANO
+ clock_offset = ntv.offset / 1e9;
+#else /* STA_NANO */
+ clock_offset = ntv.offset / 1e6;
+#endif /* STA_NANO */
clock_frequency = ntv.freq / 65536e6 - drift_comp;
flladj = plladj = 0;
*/
if (ntv.status & STA_PPSTIME) {
pps_control = current_time;
- if (pll_nano)
- clock_jitter = ntv.jitter / 1e9;
- else
- clock_jitter = ntv.jitter / 1e6;
+#ifdef STA_NANO
+ clock_jitter = ntv.jitter / 1e9;
+#else /* STA_NANO */
+ clock_jitter = ntv.jitter / 1e6;
+#endif /* STA_NANO */
}
}
#endif /* KERNEL_PLL */
memset(&ntv, 0, sizeof(ntv));
#ifdef STA_NANO
ntv.modes = MOD_BITS | MOD_NANO;
-#else
+#else /* STA_NANO */
ntv.modes = MOD_BITS;
#endif /* STA_NANO */
ntv.maxerror = MAXDISPERSE;
pll_status = ntv.status;
if (pll_control) {
#ifdef STA_NANO
- if (pll_status & STA_NANO)
- pll_nano = 1;
if (pll_status & STA_CLK)
ext_enable = 1;
#endif /* STA_NANO */