Lines Matching refs:clock_calend
67 static struct clock_calend {
79 } clock_calend;
83 * Unlocked calendar flipflop; this is used to track a clock_calend such
84 * that we can safely access a snapshot of a valid clock_calend structure
93 struct clock_calend calend; /* copy of calendar */
146 timer_call_setup(&clock_calend.adjcall, (timer_call_func_t)calend_adjust_call, NULL);
182 clock_calend.adjinterval = abstime;
232 if (clock_calend.adjdelta < 0) {
235 if (now > clock_calend.adjstart) {
236 t32 = now - clock_calend.adjstart;
238 if (t32 > clock_calend.adjoffset)
239 now -= clock_calend.adjoffset;
241 now = clock_calend.adjstart;
245 now += clock_calend.offset;
249 *secs += clock_calend.epoch;
278 if (clock_calend.adjdelta < 0) {
281 if (now > clock_calend.adjstart) {
282 t32 = now - clock_calend.adjstart;
284 if (t32 > clock_calend.adjoffset)
285 now -= clock_calend.adjoffset;
287 now = clock_calend.adjstart;
291 now += clock_calend.offset;
296 *secs += clock_calend.epoch;
326 if (clock_calend.adjdelta >= 0) {
327 clock_gettimeofday_set_commpage(now, clock_calend.epoch, clock_calend.offset, secs, microsecs);
332 if (now > clock_calend.adjstart) {
333 t32 = now - clock_calend.adjstart;
335 if (t32 > clock_calend.adjoffset)
336 now -= clock_calend.adjoffset;
338 now = clock_calend.adjstart;
341 now += clock_calend.offset;
345 *secs += clock_calend.epoch;
391 clock_boottime += secs - clock_calend.epoch;
396 clock_calend.epoch = secs;
397 nanoseconds_to_absolutetime((uint64_t)microsecs * NSEC_PER_USEC, &clock_calend.offset);
402 clock_calend.adjdelta = clock_calend.adjtotal = 0;
461 clock_calend.epoch = secs;
462 nanoseconds_to_absolutetime((uint64_t)microsecs * NSEC_PER_USEC, &clock_calend.offset);
467 clock_calend.adjdelta = clock_calend.adjtotal = 0;
518 clock_calend.adjdeadline = mach_absolute_time() + interval;
519 if (!timer_call_enter(&clock_calend.adjcall, clock_calend.adjdeadline))
520 clock_calend.adjactive++;
523 if (timer_call_cancel(&clock_calend.adjcall))
524 clock_calend.adjactive--;
545 ototal = clock_calend.adjtotal;
557 clock_calend.adjoffset = t64;
566 clock_calend.adjstart = now;
569 clock_calend.adjoffset = t64;
572 clock_calend.adjtotal = total;
573 clock_calend.adjdelta = delta;
575 interval = clock_calend.adjinterval;
578 clock_calend.adjdelta = clock_calend.adjtotal = 0;
603 if (--clock_calend.adjactive == 0) {
607 &clock_calend.adjdeadline);
609 if (!timer_call_enter(&clock_calend.adjcall, clock_calend.adjdeadline))
610 clock_calend.adjactive++;
629 delta = clock_calend.adjdelta;
632 clock_calend.offset += clock_calend.adjoffset;
634 clock_calend.adjtotal -= delta;
635 if (delta > clock_calend.adjtotal) {
636 clock_calend.adjdelta = delta = clock_calend.adjtotal;
639 clock_calend.adjoffset = t64;
644 clock_calend.offset -= clock_calend.adjoffset;
646 clock_calend.adjtotal -= delta;
647 if (delta < clock_calend.adjtotal) {
648 clock_calend.adjdelta = delta = clock_calend.adjtotal;
651 clock_calend.adjoffset = t64;
654 if (clock_calend.adjdelta != 0)
655 clock_calend.adjstart = now;
658 if (clock_calend.adjdelta != 0)
659 interval = clock_calend.adjinterval;
871 struct clock_calend tmp = clock_calend;