Lines Matching defs:tc
8 void timecounter_init(struct timecounter *tc,
12 tc->cc = cc;
13 tc->cycle_last = cc->read(cc);
14 tc->nsec = start_tstamp;
15 tc->mask = (1ULL << cc->shift) - 1;
16 tc->frac = 0;
22 * @tc: Pointer to time counter
31 static u64 timecounter_read_delta(struct timecounter *tc)
37 cycle_now = tc->cc->read(tc->cc);
40 cycle_delta = (cycle_now - tc->cycle_last) & tc->cc->mask;
43 ns_offset = cyclecounter_cyc2ns(tc->cc, cycle_delta,
44 tc->mask, &tc->frac);
47 tc->cycle_last = cycle_now;
52 u64 timecounter_read(struct timecounter *tc)
57 nsec = timecounter_read_delta(tc);
58 nsec += tc->nsec;
59 tc->nsec = nsec;