53 struct bintime update_time;
54 ffcounter update_ffcount;
55 ffcounter leapsec_next;
60 int16_t leapsec_total;
69SYSCTL_DECL(_kern_sysclock);
72SYSCTL_DECL(_kern_sysclock_ffclock);
79#define SYSCLOCK_FBCK 0
80#define SYSCLOCK_FFWD 1
81extern int sysclock_active;
86#define FFCLOCK_SKM_SCALE 1024
91#define FFCLOCK_STA_UNSYNC 1
92#define FFCLOCK_STA_WARMUP 2
106#define FFCLOCK_FAST 0x00000001
107#define FFCLOCK_LERP 0x00000002
108#define FFCLOCK_LEAPSEC 0x00000004
109#define FFCLOCK_UPTIME 0x00000008
110#define FFCLOCK_MASK 0x0000ffff
112#define FBCLOCK_FAST 0x00010000
113#define FBCLOCK_UPTIME 0x00020000
114#define FBCLOCK_MASK 0xffff0000
122 struct bintime error;
123 struct bintime tick_time;
135 struct bintime error;
136 struct bintime tick_time;
137 struct bintime tick_time_lerp;
139 uint64_t period_lerp;
140 int leapsec_adjustment;
150struct sysclock_snap {
151 struct fbclock_info fb_info;
152 struct ffclock_info ff_info;
159void sysclock_getsnapshot(
struct sysclock_snap *clock_snap,
int fast);
162int sysclock_snap2bintime(
struct sysclock_snap *cs,
struct bintime *bt,
163 int whichclock, uint32_t flags);
166void ffclock_reset_clock(
struct timespec *ts);
173void ffclock_read_counter(ffcounter *ffcount);
179void ffclock_last_tick(ffcounter *ffcount,
struct bintime *bt, uint32_t flags);
186void ffclock_convert_abs(ffcounter ffcount,
struct bintime *bt, uint32_t flags);
187void ffclock_convert_diff(ffcounter ffdelta,
struct bintime *bt);
207void ffclock_abstime(ffcounter *ffcount,
struct bintime *bt,
208 struct bintime *error_bound, uint32_t flags);
209void ffclock_difftime(ffcounter ffdelta,
struct bintime *bt,
210 struct bintime *error_bound);
217void ffclock_bintime(
struct bintime *bt);
218void ffclock_nanotime(
struct timespec *tsp);
219void ffclock_microtime(
struct timeval *tvp);
221void ffclock_getbintime(
struct bintime *bt);
222void ffclock_getnanotime(
struct timespec *tsp);
223void ffclock_getmicrotime(
struct timeval *tvp);
225void ffclock_binuptime(
struct bintime *bt);
226void ffclock_nanouptime(
struct timespec *tsp);
227void ffclock_microuptime(
struct timeval *tvp);
229void ffclock_getbinuptime(
struct bintime *bt);
230void ffclock_getnanouptime(
struct timespec *tsp);
231void ffclock_getmicrouptime(
struct timeval *tvp);
237void ffclock_bindifftime(ffcounter ffdelta,
struct bintime *bt);
238void ffclock_nanodifftime(ffcounter ffdelta,
struct timespec *tsp);
239void ffclock_microdifftime(ffcounter ffdelta,
struct timeval *tvp);
247void fbclock_bintime(
struct bintime *bt);
248void fbclock_nanotime(
struct timespec *tsp);
249void fbclock_microtime(
struct timeval *tvp);
251void fbclock_getbintime(
struct bintime *bt);
252void fbclock_getnanotime(
struct timespec *tsp);
253void fbclock_getmicrotime(
struct timeval *tvp);
255void fbclock_binuptime(
struct bintime *bt);
256void fbclock_nanouptime(
struct timespec *tsp);
257void fbclock_microuptime(
struct timeval *tvp);
259void fbclock_getbinuptime(
struct bintime *bt);
260void fbclock_getnanouptime(
struct timespec *tsp);
261void fbclock_getmicrouptime(
struct timeval *tvp);
270bintime_fromclock(
struct bintime *bt,
int whichclock)
273 if (whichclock == SYSCLOCK_FFWD)
280nanotime_fromclock(
struct timespec *tsp,
int whichclock)
283 if (whichclock == SYSCLOCK_FFWD)
284 ffclock_nanotime(tsp);
286 fbclock_nanotime(tsp);
290microtime_fromclock(
struct timeval *tvp,
int whichclock)
293 if (whichclock == SYSCLOCK_FFWD)
294 ffclock_microtime(tvp);
296 fbclock_microtime(tvp);
300getbintime_fromclock(
struct bintime *bt,
int whichclock)
303 if (whichclock == SYSCLOCK_FFWD)
304 ffclock_getbintime(bt);
306 fbclock_getbintime(bt);
310getnanotime_fromclock(
struct timespec *tsp,
int whichclock)
313 if (whichclock == SYSCLOCK_FFWD)
314 ffclock_getnanotime(tsp);
316 fbclock_getnanotime(tsp);
320getmicrotime_fromclock(
struct timeval *tvp,
int whichclock)
323 if (whichclock == SYSCLOCK_FFWD)
324 ffclock_getmicrotime(tvp);
326 fbclock_getmicrotime(tvp);
330binuptime_fromclock(
struct bintime *bt,
int whichclock)
333 if (whichclock == SYSCLOCK_FFWD)
334 ffclock_binuptime(bt);
336 fbclock_binuptime(bt);
340nanouptime_fromclock(
struct timespec *tsp,
int whichclock)
343 if (whichclock == SYSCLOCK_FFWD)
344 ffclock_nanouptime(tsp);
346 fbclock_nanouptime(tsp);
350microuptime_fromclock(
struct timeval *tvp,
int whichclock)
353 if (whichclock == SYSCLOCK_FFWD)
354 ffclock_microuptime(tvp);
356 fbclock_microuptime(tvp);
360getbinuptime_fromclock(
struct bintime *bt,
int whichclock)
363 if (whichclock == SYSCLOCK_FFWD)
364 ffclock_getbinuptime(bt);
366 fbclock_getbinuptime(bt);
370getnanouptime_fromclock(
struct timespec *tsp,
int whichclock)
373 if (whichclock == SYSCLOCK_FFWD)
374 ffclock_getnanouptime(tsp);
376 fbclock_getnanouptime(tsp);
380getmicrouptime_fromclock(
struct timeval *tvp,
int whichclock)
383 if (whichclock == SYSCLOCK_FFWD)
384 ffclock_getmicrouptime(tvp);
386 fbclock_getmicrouptime(tvp);
393int ffclock_getcounter(ffcounter *ffcount);
This header file provides interfaces of the feed-forward clock counter.