Lines Matching +full:counter +full:- +full:1
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
14 #define CYCLECOUNTER_MASK(bits) (u64)((bits) < 64 ? ((1ULL<<(bits))-1) : -1)
17 * struct cyclecounter - hardware abstraction for a free running counter
18 * Provides completely state-free accessors to the underlying hardware.
19 * Depending on which hardware it reads, the cycle counter may wrap
38 * struct timecounter - layer above a %struct cyclecounter which counts nanoseconds
40 * cycle counter wrap around. Initialize with
44 * cycle counter hardware, locking issues and reading the time
45 * more often than the cycle counter wraps around. The nanosecond
46 * counter will only wrap around after ~585 years.
48 * @cc: the cycle counter used by this instance
49 * @cycle_last: most recent cycle counter value seen by
64 * cyclecounter_cyc2ns - converts cycle counter cycles to nanoseconds
65 * @cc: Pointer to cycle counter.
75 ns = (ns * cc->mult) + *frac; in cyclecounter_cyc2ns()
77 return ns >> cc->shift; in cyclecounter_cyc2ns()
81 * timecounter_adjtime - Shifts the time of the clock.
86 tc->nsec += delta; in timecounter_adjtime()
90 * timecounter_init - initialize a time counter
91 * @tc: Pointer to time counter which is to be initialized/reset
92 * @cc: A cycle counter, ready to be used.
97 * the time stamp counter by the number of elapsed nanoseconds.
104 * timecounter_read - return nanoseconds elapsed since timecounter_init()
106 * @tc: Pointer to time counter.
114 * timecounter_cyc2time - convert a cycle counter to same
117 * @tc: Pointer to time counter.
118 * @cycle_tstamp: a value returned by tc->cc->read()
121 * fall into the interval [-1/2 max cycle count, +1/2 max cycle count],
122 * with "max cycle count" == cs->mask+1.
124 * This allows conversion of cycle counter values which were generated