MCPcopy Create free account
hub / github.com/F-Stack/f-stack / ffclock_read_counter

Function ffclock_read_counter

freebsd/kern/kern_tc.c:873–894  ·  view source on GitHub ↗

* Access to current ffcounter value. */

Source from the content-addressed store, hash-verified

871 * Access to current ffcounter value.
872 */
873void
874ffclock_read_counter(ffcounter *ffcount)
875{
876 struct timehands *th;
877 struct fftimehands *ffth;
878 unsigned int gen, delta;
879
880 /*
881 * ffclock_windup() called from tc_windup(), safe to rely on
882 * th->th_generation only, for correct delta and ffcounter.
883 */
884 do {
885 th = timehands;
886 gen = atomic_load_acq_int(&th->th_generation);
887 ffth = fftimehands;
888 delta = tc_delta(th);
889 *ffcount = ffth->tick_ffcount;
890 atomic_thread_fence_acq();
891 } while (gen == 0 || gen != th->th_generation);
892
893 *ffcount += delta;
894}
895
896void
897binuptime(struct bintime *bt)

Callers 3

ffclock_abstimeFunction · 0.85
sys_ffclock_getcounterFunction · 0.85
ffclock_reset_clockFunction · 0.85

Calls 2

tc_deltaFunction · 0.85
atomic_thread_fence_acqFunction · 0.50

Tested by

no test coverage detected