+static uint64_t calend_adjstart; /* Absolute time value for start of this adjustment period */
+static uint32_t calend_adjoffset; /* Absolute time offset for this adjustment period as absolute value */
+
+static int32_t calend_adjdelta; /* Nanosecond time delta for this adjustment period */
+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(
+ int32_t *secs,
+ int32_t *microsecs);
+
+static void calend_adjust_call(void);
+static uint32_t calend_adjust(void);
+
+static thread_call_data_t calend_wakecall;
+
+extern void IOKitResetTime(void);
+
+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 ((int32_t)((rfrac) -= (frac)) < 0) { \
+ (rfrac) += (unit); \
+ (rsecs) -= 1; \
+ } \
+ (rsecs) -= (secs); \
+MACRO_END