* Access to current ffcounter value. */
| 871 | * Access to current ffcounter value. |
| 872 | */ |
| 873 | void |
| 874 | ffclock_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 | |
| 896 | void |
| 897 | binuptime(struct bintime *bt) |
no test coverage detected