* Retrieve feed-forward counter and time of last kernel tick. */
| 785 | * Retrieve feed-forward counter and time of last kernel tick. |
| 786 | */ |
| 787 | void |
| 788 | ffclock_last_tick(ffcounter *ffcount, struct bintime *bt, uint32_t flags) |
| 789 | { |
| 790 | struct fftimehands *ffth; |
| 791 | uint8_t gen; |
| 792 | |
| 793 | /* |
| 794 | * No locking but check generation has not changed. Also need to make |
| 795 | * sure ffdelta is positive, i.e. ffcount > tick_ffcount. |
| 796 | */ |
| 797 | do { |
| 798 | ffth = fftimehands; |
| 799 | gen = ffth->gen; |
| 800 | if ((flags & FFCLOCK_LERP) == FFCLOCK_LERP) |
| 801 | *bt = ffth->tick_time_lerp; |
| 802 | else |
| 803 | *bt = ffth->tick_time; |
| 804 | *ffcount = ffth->tick_ffcount; |
| 805 | } while (gen == 0 || gen != ffth->gen); |
| 806 | } |
| 807 | |
| 808 | /* |
| 809 | * Absolute clock conversion. Low level function to convert ffcounter to |