Submit #3368 » 0001-trivial-Clean-up-white-space-at-ends-of-lines.patch
sys/kern/kern_clock.c | ||
---|---|---|
/*
|
||
* Copyright (c) 2003,2004 The DragonFly Project. All rights reserved.
|
||
*
|
||
*
|
||
* This code is derived from software contributed to The DragonFly Project
|
||
* by Matthew Dillon <dillon@backplane.com>
|
||
*
|
||
*
|
||
* Redistribution and use in source and binary forms, with or without
|
||
* modification, are permitted provided that the following conditions
|
||
* are met:
|
||
*
|
||
*
|
||
* 1. Redistributions of source code must retain the above copyright
|
||
* notice, this list of conditions and the following disclaimer.
|
||
* 2. Redistributions in binary form must reproduce the above copyright
|
||
... | ... | |
* 3. Neither the name of The DragonFly Project nor the names of its
|
||
* contributors may be used to endorse or promote products derived
|
||
* from this software without specific, prior written permission.
|
||
*
|
||
*
|
||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||
... | ... | |
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
||
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||
* SUCH DAMAGE.
|
||
*
|
||
*
|
||
* Copyright (c) 1997, 1998 Poul-Henning Kamp <phk@FreeBSD.org>
|
||
* Copyright (c) 1982, 1986, 1991, 1993
|
||
* The Regents of the University of California. All rights reserved.
|
||
... | ... | |
/*
|
||
* basetime is used to calculate the compensated real time of day. The
|
||
* basetime can be modified on a per-tick basis by the adjtime(),
|
||
* basetime can be modified on a per-tick basis by the adjtime(),
|
||
* ntp_adjtime(), and sysctl-based time correction APIs.
|
||
*
|
||
* Note that frequency corrections can also be made by adjusting
|
||
... | ... | |
* Note that basetime diverges from boottime as the clock drift is
|
||
* compensated for, so we cannot do away with boottime. When setting
|
||
* the absolute time of day the drift is 0 (for an instant) and we
|
||
* can simply assign boottime to basetime.
|
||
* can simply assign boottime to basetime.
|
||
*
|
||
* Note that nanouptime() is based on gd_time_seconds which is drift
|
||
* compensated up to a point (it is guaranteed to remain monotonically
|
||
... | ... | |
crit_exit();
|
||
}
|
||
|
||
/*
|
||
* Each cpu has its own hardclock, but we only increment ticks and softticks
|
||
* on cpu #0.
|
||
... | ... | |
atomic_add_int_nonlocked(&ticktime_update, 1);
|
||
#if 0
|
||
if (tco->tc_poll_pps)
|
||
if (tco->tc_poll_pps)
|
||
tco->tc_poll_pps(tco);
|
||
#endif
|
||
... | ... | |
* so that we know how much of its real time was spent
|
||
* in ``non-process'' (i.e., interrupt) work.
|
||
*
|
||
* XXX assume system if frame is NULL. A NULL frame
|
||
* XXX assume system if frame is NULL. A NULL frame
|
||
* can occur if ipi processing is done from a crit_exit().
|
||
*/
|
||
if ((frame && CLKF_INTR(intr_nest)) ||
|
||
... | ... | |
struct kinfo_pctrack *pctrack;
|
||
pctrack = &cputime_pctrack[mycpu->gd_cpuid][which];
|
||
pctrack->pc_array[pctrack->pc_index & PCTRACK_ARYMASK] =
|
||
pctrack->pc_array[pctrack->pc_index & PCTRACK_ARYMASK] =
|
||
(void *)CLKF_PC(frame);
|
||
++pctrack->pc_index;
|
||
}
|
||
... | ... | |
}
|
||
/*
|
||
* Compute number of ticks for the specified amount of time. The
|
||
* Compute number of ticks for the specified amount of time. The
|
||
* return value is intended to be used in a clock interrupt timed
|
||
* operation and guaranteed to meet or exceed the requested time.
|
||
* If the representation overflows, return INT_MAX. The minimum return
|
||
... | ... | |
app = (pps_params_t *)data;
|
||
if (app->mode & ~pps->ppscap)
|
||
return (EINVAL);
|
||
pps->ppsparam = *app;
|
||
pps->ppsparam = *app;
|
||
return (0);
|
||
case PPS_IOC_GETPARAMS:
|
||
app = (pps_params_t *)data;
|
||
... | ... | |
return (EINVAL);
|
||
if (fapi->timeout.tv_sec || fapi->timeout.tv_nsec)
|
||
return (EOPNOTSUPP);
|
||
pps->ppsinfo.current_mode = pps->ppsparam.mode;
|
||
pps->ppsinfo.current_mode = pps->ppsparam.mode;
|
||
fapi->pps_info_buf = pps->ppsinfo;
|
||
return (0);
|
||
case PPS_IOC_KCBIND:
|
||
... | ... | |
pps->ppscount[2] = count;
|
||
if (tcount >= sys_cputimer->freq) {
|
||
delta = (1000000000 * (tcount / sys_cputimer->freq) +
|
||
sys_cputimer->freq64_nsec *
|
||
sys_cputimer->freq64_nsec *
|
||
(tcount % sys_cputimer->freq)) >> 32;
|
||
} else {
|
||
delta = muldivu64(sys_cputimer->freq64_nsec,
|
- « Previous
- 1
- 2
- Next »