+static void clock_track_calend_nowait(void);
+
+#endif
+
+/*
+ * Calendar adjustment variables and values.
+ */
+#define calend_adjperiod (NSEC_PER_SEC / 100) /* adjustment period, ns */
+#define calend_adjskew (40 * NSEC_PER_USEC) /* "standard" skew, ns / period */
+#define calend_adjbig (NSEC_PER_SEC) /* use 10x skew above adjbig ns */
+
+static int64_t calend_adjtotal; /* Nanosecond remaining total adjustment */
+static uint64_t calend_adjdeadline; /* Absolute time value for next adjustment period */
+static uint32_t calend_adjinterval; /* Absolute time interval of adjustment period */
+
+static timer_call_data_t calend_adjcall;
+static uint32_t calend_adjactive;
+
+static uint32_t calend_set_adjustment(
+ long *secs,
+ int *microsecs);
+
+static void calend_adjust_call(void);
+static uint32_t calend_adjust(void);
+
+static thread_call_data_t calend_wakecall;
+
+extern void IOKitResetTime(void);
+
+void _clock_delay_until_deadline(uint64_t interval,
+ uint64_t deadline);
+
+static uint64_t clock_boottime; /* Seconds boottime epoch */
+
+#define TIME_ADD(rsecs, secs, rfrac, frac, unit) \
+MACRO_BEGIN \
+ if (((rfrac) += (frac)) >= (unit)) { \
+ (rfrac) -= (unit); \
+ (rsecs) += 1; \
+ } \
+ (rsecs) += (secs); \
+MACRO_END
+
+#define TIME_SUB(rsecs, secs, rfrac, frac, unit) \
+MACRO_BEGIN \
+ if ((int)((rfrac) -= (frac)) < 0) { \
+ (rfrac) += (unit); \
+ (rsecs) -= 1; \
+ } \
+ (rsecs) -= (secs); \
+MACRO_END