1a9643ea8Slogwang /*-
2*22ce4affSfengbojiang * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
3*22ce4affSfengbojiang *
4a9643ea8Slogwang * Copyright (c) 2011 The University of Melbourne
5a9643ea8Slogwang * All rights reserved.
6a9643ea8Slogwang *
7a9643ea8Slogwang * This software was developed by Julien Ridoux at the University of Melbourne
8a9643ea8Slogwang * under sponsorship from the FreeBSD Foundation.
9a9643ea8Slogwang *
10a9643ea8Slogwang * Redistribution and use in source and binary forms, with or without
11a9643ea8Slogwang * modification, are permitted provided that the following conditions
12a9643ea8Slogwang * are met:
13a9643ea8Slogwang * 1. Redistributions of source code must retain the above copyright
14a9643ea8Slogwang * notice, this list of conditions and the following disclaimer.
15a9643ea8Slogwang * 2. Redistributions in binary form must reproduce the above copyright
16a9643ea8Slogwang * notice, this list of conditions and the following disclaimer in the
17a9643ea8Slogwang * documentation and/or other materials provided with the distribution.
18a9643ea8Slogwang *
19a9643ea8Slogwang * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
20a9643ea8Slogwang * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21a9643ea8Slogwang * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22a9643ea8Slogwang * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
23a9643ea8Slogwang * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24a9643ea8Slogwang * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
25a9643ea8Slogwang * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26a9643ea8Slogwang * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27a9643ea8Slogwang * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
28a9643ea8Slogwang * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
29a9643ea8Slogwang * SUCH DAMAGE.
30a9643ea8Slogwang *
31a9643ea8Slogwang * $FreeBSD$
32a9643ea8Slogwang */
33a9643ea8Slogwang
34a9643ea8Slogwang #ifndef _SYS_TIMEFF_H_
35a9643ea8Slogwang #define _SYS_TIMEFF_H_
36a9643ea8Slogwang
37a9643ea8Slogwang #include <sys/_ffcounter.h>
38a9643ea8Slogwang
39a9643ea8Slogwang /*
40a9643ea8Slogwang * Feed-forward clock estimate
41a9643ea8Slogwang * Holds time mark as a ffcounter and conversion to bintime based on current
42a9643ea8Slogwang * timecounter period and offset estimate passed by the synchronization daemon.
43a9643ea8Slogwang * Provides time of last daemon update, clock status and bound on error.
44a9643ea8Slogwang */
45a9643ea8Slogwang struct ffclock_estimate {
46a9643ea8Slogwang struct bintime update_time; /* Time of last estimates update. */
47a9643ea8Slogwang ffcounter update_ffcount; /* Counter value at last update. */
48a9643ea8Slogwang ffcounter leapsec_next; /* Counter value of next leap second. */
49a9643ea8Slogwang uint64_t period; /* Estimate of counter period. */
50a9643ea8Slogwang uint32_t errb_abs; /* Bound on absolute clock error [ns]. */
51a9643ea8Slogwang uint32_t errb_rate; /* Bound on counter rate error [ps/s]. */
52a9643ea8Slogwang uint32_t status; /* Clock status. */
53a9643ea8Slogwang int16_t leapsec_total; /* All leap seconds seen so far. */
54a9643ea8Slogwang int8_t leapsec; /* Next leap second (in {-1,0,1}). */
55a9643ea8Slogwang };
56a9643ea8Slogwang
57a9643ea8Slogwang #if __BSD_VISIBLE
58a9643ea8Slogwang #ifdef _KERNEL
59a9643ea8Slogwang
60a9643ea8Slogwang /* Define the kern.sysclock sysctl tree. */
61a9643ea8Slogwang SYSCTL_DECL(_kern_sysclock);
62a9643ea8Slogwang
63a9643ea8Slogwang /* Define the kern.sysclock.ffclock sysctl tree. */
64a9643ea8Slogwang SYSCTL_DECL(_kern_sysclock_ffclock);
65a9643ea8Slogwang
66a9643ea8Slogwang /*
67a9643ea8Slogwang * Index into the sysclocks array for obtaining the ASCII name of a particular
68a9643ea8Slogwang * sysclock.
69a9643ea8Slogwang */
70a9643ea8Slogwang #define SYSCLOCK_FBCK 0
71a9643ea8Slogwang #define SYSCLOCK_FFWD 1
72a9643ea8Slogwang extern int sysclock_active;
73a9643ea8Slogwang
74a9643ea8Slogwang /*
75a9643ea8Slogwang * Parameters of counter characterisation required by feed-forward algorithms.
76a9643ea8Slogwang */
77a9643ea8Slogwang #define FFCLOCK_SKM_SCALE 1024
78a9643ea8Slogwang
79a9643ea8Slogwang /*
80a9643ea8Slogwang * Feed-forward clock status
81a9643ea8Slogwang */
82a9643ea8Slogwang #define FFCLOCK_STA_UNSYNC 1
83a9643ea8Slogwang #define FFCLOCK_STA_WARMUP 2
84a9643ea8Slogwang
85a9643ea8Slogwang /*
86a9643ea8Slogwang * Flags for use by sysclock_snap2bintime() and various ffclock_ functions to
87a9643ea8Slogwang * control how the timecounter hardware is read and how the hardware snapshot is
88a9643ea8Slogwang * converted into absolute time.
89a9643ea8Slogwang * {FB|FF}CLOCK_FAST: Do not read the hardware counter, instead using the
90a9643ea8Slogwang * value at last tick. The time returned has a resolution
91a9643ea8Slogwang * of the kernel tick timer (1/hz [s]).
92a9643ea8Slogwang * FFCLOCK_LERP: Linear interpolation of ffclock time to guarantee
93a9643ea8Slogwang * monotonic time.
94a9643ea8Slogwang * FFCLOCK_LEAPSEC: Include leap seconds.
95a9643ea8Slogwang * {FB|FF}CLOCK_UPTIME: Time stamp should be relative to system boot, not epoch.
96a9643ea8Slogwang */
97a9643ea8Slogwang #define FFCLOCK_FAST 0x00000001
98a9643ea8Slogwang #define FFCLOCK_LERP 0x00000002
99a9643ea8Slogwang #define FFCLOCK_LEAPSEC 0x00000004
100a9643ea8Slogwang #define FFCLOCK_UPTIME 0x00000008
101a9643ea8Slogwang #define FFCLOCK_MASK 0x0000ffff
102a9643ea8Slogwang
103a9643ea8Slogwang #define FBCLOCK_FAST 0x00010000 /* Currently unused. */
104a9643ea8Slogwang #define FBCLOCK_UPTIME 0x00020000
105a9643ea8Slogwang #define FBCLOCK_MASK 0xffff0000
106a9643ea8Slogwang
107a9643ea8Slogwang /*
108a9643ea8Slogwang * Feedback clock specific info structure. The feedback clock's estimation of
109a9643ea8Slogwang * clock error is an absolute figure determined by the NTP algorithm. The status
110a9643ea8Slogwang * is determined by the userland daemon.
111a9643ea8Slogwang */
112a9643ea8Slogwang struct fbclock_info {
113a9643ea8Slogwang struct bintime error;
114a9643ea8Slogwang struct bintime tick_time;
115a9643ea8Slogwang uint64_t th_scale;
116a9643ea8Slogwang int status;
117a9643ea8Slogwang };
118a9643ea8Slogwang
119a9643ea8Slogwang /*
120a9643ea8Slogwang * Feed-forward clock specific info structure. The feed-forward clock's
121a9643ea8Slogwang * estimation of clock error is an upper bound, which although potentially
122a9643ea8Slogwang * looser than the feedback clock equivalent, is much more reliable. The status
123a9643ea8Slogwang * is determined by the userland daemon.
124a9643ea8Slogwang */
125a9643ea8Slogwang struct ffclock_info {
126a9643ea8Slogwang struct bintime error;
127a9643ea8Slogwang struct bintime tick_time;
128a9643ea8Slogwang struct bintime tick_time_lerp;
129a9643ea8Slogwang uint64_t period;
130a9643ea8Slogwang uint64_t period_lerp;
131a9643ea8Slogwang int leapsec_adjustment;
132a9643ea8Slogwang int status;
133a9643ea8Slogwang };
134a9643ea8Slogwang
135a9643ea8Slogwang /*
136a9643ea8Slogwang * Snapshot of system clocks and related information. Holds time read from each
137a9643ea8Slogwang * clock based on a single read of the active hardware timecounter, as well as
138a9643ea8Slogwang * respective clock information such as error estimates and the ffcounter value
139a9643ea8Slogwang * at the time of the read.
140a9643ea8Slogwang */
141a9643ea8Slogwang struct sysclock_snap {
142a9643ea8Slogwang struct fbclock_info fb_info;
143a9643ea8Slogwang struct ffclock_info ff_info;
144a9643ea8Slogwang ffcounter ffcount;
145a9643ea8Slogwang unsigned int delta;
146a9643ea8Slogwang int sysclock_active;
147a9643ea8Slogwang };
148a9643ea8Slogwang
149a9643ea8Slogwang /* Take a snapshot of the system clocks and related information. */
150a9643ea8Slogwang void sysclock_getsnapshot(struct sysclock_snap *clock_snap, int fast);
151a9643ea8Slogwang
152a9643ea8Slogwang /* Convert a timestamp from the selected system clock into bintime. */
153a9643ea8Slogwang int sysclock_snap2bintime(struct sysclock_snap *cs, struct bintime *bt,
154a9643ea8Slogwang int whichclock, uint32_t flags);
155a9643ea8Slogwang
156a9643ea8Slogwang /* Resets feed-forward clock from RTC */
157a9643ea8Slogwang void ffclock_reset_clock(struct timespec *ts);
158a9643ea8Slogwang
159a9643ea8Slogwang /*
160a9643ea8Slogwang * Return the current value of the feed-forward clock counter. Essential to
161a9643ea8Slogwang * measure time interval in counter units. If a fast timecounter is used by the
162a9643ea8Slogwang * system, may also allow fast but accurate timestamping.
163a9643ea8Slogwang */
164a9643ea8Slogwang void ffclock_read_counter(ffcounter *ffcount);
165a9643ea8Slogwang
166a9643ea8Slogwang /*
167a9643ea8Slogwang * Retrieve feed-forward counter value and time of last kernel tick. This
168a9643ea8Slogwang * accepts the FFCLOCK_LERP flag.
169a9643ea8Slogwang */
170a9643ea8Slogwang void ffclock_last_tick(ffcounter *ffcount, struct bintime *bt, uint32_t flags);
171a9643ea8Slogwang
172a9643ea8Slogwang /*
173a9643ea8Slogwang * Low level routines to convert a counter timestamp into absolute time and a
174a9643ea8Slogwang * counter timestamp interval into an interval in seconds. The absolute time
175a9643ea8Slogwang * conversion accepts the FFCLOCK_LERP flag.
176a9643ea8Slogwang */
177a9643ea8Slogwang void ffclock_convert_abs(ffcounter ffcount, struct bintime *bt, uint32_t flags);
178a9643ea8Slogwang void ffclock_convert_diff(ffcounter ffdelta, struct bintime *bt);
179a9643ea8Slogwang
180a9643ea8Slogwang /*
181a9643ea8Slogwang * Feed-forward clock routines.
182a9643ea8Slogwang *
183a9643ea8Slogwang * These functions rely on the timecounters and ffclock_estimates stored in
184a9643ea8Slogwang * fftimehands. Note that the error_bound parameter is not the error of the
185a9643ea8Slogwang * clock but an upper bound on the error of the absolute time or time interval
186a9643ea8Slogwang * returned.
187a9643ea8Slogwang *
188a9643ea8Slogwang * ffclock_abstime(): retrieves current time as counter value and convert this
189a9643ea8Slogwang * timestamp in seconds. The value (in seconds) of the converted timestamp
190a9643ea8Slogwang * depends on the flags passed: for a given counter value, different
191a9643ea8Slogwang * conversions are possible. Different clock models can be selected by
192a9643ea8Slogwang * combining flags (for example (FFCLOCK_LERP|FFCLOCK_UPTIME) produces
193a9643ea8Slogwang * linearly interpolated uptime).
194a9643ea8Slogwang * ffclock_difftime(): computes a time interval in seconds based on an interval
195a9643ea8Slogwang * measured in ffcounter units. This should be the preferred way to measure
196a9643ea8Slogwang * small time intervals very accurately.
197a9643ea8Slogwang */
198a9643ea8Slogwang void ffclock_abstime(ffcounter *ffcount, struct bintime *bt,
199a9643ea8Slogwang struct bintime *error_bound, uint32_t flags);
200a9643ea8Slogwang void ffclock_difftime(ffcounter ffdelta, struct bintime *bt,
201a9643ea8Slogwang struct bintime *error_bound);
202a9643ea8Slogwang
203a9643ea8Slogwang /*
204a9643ea8Slogwang * Wrapper routines to return current absolute time using the feed-forward
205a9643ea8Slogwang * clock. These functions are named after those defined in <sys/time.h>, which
206a9643ea8Slogwang * contains a description of the original ones.
207a9643ea8Slogwang */
208a9643ea8Slogwang void ffclock_bintime(struct bintime *bt);
209a9643ea8Slogwang void ffclock_nanotime(struct timespec *tsp);
210a9643ea8Slogwang void ffclock_microtime(struct timeval *tvp);
211a9643ea8Slogwang
212a9643ea8Slogwang void ffclock_getbintime(struct bintime *bt);
213a9643ea8Slogwang void ffclock_getnanotime(struct timespec *tsp);
214a9643ea8Slogwang void ffclock_getmicrotime(struct timeval *tvp);
215a9643ea8Slogwang
216a9643ea8Slogwang void ffclock_binuptime(struct bintime *bt);
217a9643ea8Slogwang void ffclock_nanouptime(struct timespec *tsp);
218a9643ea8Slogwang void ffclock_microuptime(struct timeval *tvp);
219a9643ea8Slogwang
220a9643ea8Slogwang void ffclock_getbinuptime(struct bintime *bt);
221a9643ea8Slogwang void ffclock_getnanouptime(struct timespec *tsp);
222a9643ea8Slogwang void ffclock_getmicrouptime(struct timeval *tvp);
223a9643ea8Slogwang
224a9643ea8Slogwang /*
225a9643ea8Slogwang * Wrapper routines to convert a time interval specified in ffcounter units into
226a9643ea8Slogwang * seconds using the current feed-forward clock estimates.
227a9643ea8Slogwang */
228a9643ea8Slogwang void ffclock_bindifftime(ffcounter ffdelta, struct bintime *bt);
229a9643ea8Slogwang void ffclock_nanodifftime(ffcounter ffdelta, struct timespec *tsp);
230a9643ea8Slogwang void ffclock_microdifftime(ffcounter ffdelta, struct timeval *tvp);
231a9643ea8Slogwang
232a9643ea8Slogwang /*
233a9643ea8Slogwang * When FFCLOCK is enabled in the kernel, [get]{bin,nano,micro}[up]time() become
234a9643ea8Slogwang * wrappers around equivalent feedback or feed-forward functions. Provide access
235a9643ea8Slogwang * outside of kern_tc.c to the feedback clock equivalent functions for
236a9643ea8Slogwang * specialised use i.e. these are not for general consumption.
237a9643ea8Slogwang */
238a9643ea8Slogwang void fbclock_bintime(struct bintime *bt);
239a9643ea8Slogwang void fbclock_nanotime(struct timespec *tsp);
240a9643ea8Slogwang void fbclock_microtime(struct timeval *tvp);
241a9643ea8Slogwang
242a9643ea8Slogwang void fbclock_getbintime(struct bintime *bt);
243a9643ea8Slogwang void fbclock_getnanotime(struct timespec *tsp);
244a9643ea8Slogwang void fbclock_getmicrotime(struct timeval *tvp);
245a9643ea8Slogwang
246a9643ea8Slogwang void fbclock_binuptime(struct bintime *bt);
247a9643ea8Slogwang void fbclock_nanouptime(struct timespec *tsp);
248a9643ea8Slogwang void fbclock_microuptime(struct timeval *tvp);
249a9643ea8Slogwang
250a9643ea8Slogwang void fbclock_getbinuptime(struct bintime *bt);
251a9643ea8Slogwang void fbclock_getnanouptime(struct timespec *tsp);
252a9643ea8Slogwang void fbclock_getmicrouptime(struct timeval *tvp);
253a9643ea8Slogwang
254a9643ea8Slogwang /*
255a9643ea8Slogwang * Public system clock wrapper API which allows consumers to select which clock
256a9643ea8Slogwang * to obtain time from, independent of the current default system clock. These
257a9643ea8Slogwang * wrappers should be used instead of directly calling the underlying fbclock_
258a9643ea8Slogwang * or ffclock_ functions.
259a9643ea8Slogwang */
260a9643ea8Slogwang static inline void
bintime_fromclock(struct bintime * bt,int whichclock)261a9643ea8Slogwang bintime_fromclock(struct bintime *bt, int whichclock)
262a9643ea8Slogwang {
263a9643ea8Slogwang
264a9643ea8Slogwang if (whichclock == SYSCLOCK_FFWD)
265a9643ea8Slogwang ffclock_bintime(bt);
266a9643ea8Slogwang else
267a9643ea8Slogwang fbclock_bintime(bt);
268a9643ea8Slogwang }
269a9643ea8Slogwang
270a9643ea8Slogwang static inline void
nanotime_fromclock(struct timespec * tsp,int whichclock)271a9643ea8Slogwang nanotime_fromclock(struct timespec *tsp, int whichclock)
272a9643ea8Slogwang {
273a9643ea8Slogwang
274a9643ea8Slogwang if (whichclock == SYSCLOCK_FFWD)
275a9643ea8Slogwang ffclock_nanotime(tsp);
276a9643ea8Slogwang else
277a9643ea8Slogwang fbclock_nanotime(tsp);
278a9643ea8Slogwang }
279a9643ea8Slogwang
280a9643ea8Slogwang static inline void
microtime_fromclock(struct timeval * tvp,int whichclock)281a9643ea8Slogwang microtime_fromclock(struct timeval *tvp, int whichclock)
282a9643ea8Slogwang {
283a9643ea8Slogwang
284a9643ea8Slogwang if (whichclock == SYSCLOCK_FFWD)
285a9643ea8Slogwang ffclock_microtime(tvp);
286a9643ea8Slogwang else
287a9643ea8Slogwang fbclock_microtime(tvp);
288a9643ea8Slogwang }
289a9643ea8Slogwang
290a9643ea8Slogwang static inline void
getbintime_fromclock(struct bintime * bt,int whichclock)291a9643ea8Slogwang getbintime_fromclock(struct bintime *bt, int whichclock)
292a9643ea8Slogwang {
293a9643ea8Slogwang
294a9643ea8Slogwang if (whichclock == SYSCLOCK_FFWD)
295a9643ea8Slogwang ffclock_getbintime(bt);
296a9643ea8Slogwang else
297a9643ea8Slogwang fbclock_getbintime(bt);
298a9643ea8Slogwang }
299a9643ea8Slogwang
300a9643ea8Slogwang static inline void
getnanotime_fromclock(struct timespec * tsp,int whichclock)301a9643ea8Slogwang getnanotime_fromclock(struct timespec *tsp, int whichclock)
302a9643ea8Slogwang {
303a9643ea8Slogwang
304a9643ea8Slogwang if (whichclock == SYSCLOCK_FFWD)
305a9643ea8Slogwang ffclock_getnanotime(tsp);
306a9643ea8Slogwang else
307a9643ea8Slogwang fbclock_getnanotime(tsp);
308a9643ea8Slogwang }
309a9643ea8Slogwang
310a9643ea8Slogwang static inline void
getmicrotime_fromclock(struct timeval * tvp,int whichclock)311a9643ea8Slogwang getmicrotime_fromclock(struct timeval *tvp, int whichclock)
312a9643ea8Slogwang {
313a9643ea8Slogwang
314a9643ea8Slogwang if (whichclock == SYSCLOCK_FFWD)
315a9643ea8Slogwang ffclock_getmicrotime(tvp);
316a9643ea8Slogwang else
317a9643ea8Slogwang fbclock_getmicrotime(tvp);
318a9643ea8Slogwang }
319a9643ea8Slogwang
320a9643ea8Slogwang static inline void
binuptime_fromclock(struct bintime * bt,int whichclock)321a9643ea8Slogwang binuptime_fromclock(struct bintime *bt, int whichclock)
322a9643ea8Slogwang {
323a9643ea8Slogwang
324a9643ea8Slogwang if (whichclock == SYSCLOCK_FFWD)
325a9643ea8Slogwang ffclock_binuptime(bt);
326a9643ea8Slogwang else
327a9643ea8Slogwang fbclock_binuptime(bt);
328a9643ea8Slogwang }
329a9643ea8Slogwang
330a9643ea8Slogwang static inline void
nanouptime_fromclock(struct timespec * tsp,int whichclock)331a9643ea8Slogwang nanouptime_fromclock(struct timespec *tsp, int whichclock)
332a9643ea8Slogwang {
333a9643ea8Slogwang
334a9643ea8Slogwang if (whichclock == SYSCLOCK_FFWD)
335a9643ea8Slogwang ffclock_nanouptime(tsp);
336a9643ea8Slogwang else
337a9643ea8Slogwang fbclock_nanouptime(tsp);
338a9643ea8Slogwang }
339a9643ea8Slogwang
340a9643ea8Slogwang static inline void
microuptime_fromclock(struct timeval * tvp,int whichclock)341a9643ea8Slogwang microuptime_fromclock(struct timeval *tvp, int whichclock)
342a9643ea8Slogwang {
343a9643ea8Slogwang
344a9643ea8Slogwang if (whichclock == SYSCLOCK_FFWD)
345a9643ea8Slogwang ffclock_microuptime(tvp);
346a9643ea8Slogwang else
347a9643ea8Slogwang fbclock_microuptime(tvp);
348a9643ea8Slogwang }
349a9643ea8Slogwang
350a9643ea8Slogwang static inline void
getbinuptime_fromclock(struct bintime * bt,int whichclock)351a9643ea8Slogwang getbinuptime_fromclock(struct bintime *bt, int whichclock)
352a9643ea8Slogwang {
353a9643ea8Slogwang
354a9643ea8Slogwang if (whichclock == SYSCLOCK_FFWD)
355a9643ea8Slogwang ffclock_getbinuptime(bt);
356a9643ea8Slogwang else
357a9643ea8Slogwang fbclock_getbinuptime(bt);
358a9643ea8Slogwang }
359a9643ea8Slogwang
360a9643ea8Slogwang static inline void
getnanouptime_fromclock(struct timespec * tsp,int whichclock)361a9643ea8Slogwang getnanouptime_fromclock(struct timespec *tsp, int whichclock)
362a9643ea8Slogwang {
363a9643ea8Slogwang
364a9643ea8Slogwang if (whichclock == SYSCLOCK_FFWD)
365a9643ea8Slogwang ffclock_getnanouptime(tsp);
366a9643ea8Slogwang else
367a9643ea8Slogwang fbclock_getnanouptime(tsp);
368a9643ea8Slogwang }
369a9643ea8Slogwang
370a9643ea8Slogwang static inline void
getmicrouptime_fromclock(struct timeval * tvp,int whichclock)371a9643ea8Slogwang getmicrouptime_fromclock(struct timeval *tvp, int whichclock)
372a9643ea8Slogwang {
373a9643ea8Slogwang
374a9643ea8Slogwang if (whichclock == SYSCLOCK_FFWD)
375a9643ea8Slogwang ffclock_getmicrouptime(tvp);
376a9643ea8Slogwang else
377a9643ea8Slogwang fbclock_getmicrouptime(tvp);
378a9643ea8Slogwang }
379a9643ea8Slogwang
380a9643ea8Slogwang #else /* !_KERNEL */
381a9643ea8Slogwang
382a9643ea8Slogwang /* Feed-Forward Clock system calls. */
383a9643ea8Slogwang __BEGIN_DECLS
384a9643ea8Slogwang int ffclock_getcounter(ffcounter *ffcount);
385a9643ea8Slogwang int ffclock_getestimate(struct ffclock_estimate *cest);
386a9643ea8Slogwang int ffclock_setestimate(struct ffclock_estimate *cest);
387a9643ea8Slogwang __END_DECLS
388a9643ea8Slogwang
389a9643ea8Slogwang #endif /* _KERNEL */
390a9643ea8Slogwang #endif /* __BSD_VISIBLE */
391a9643ea8Slogwang #endif /* _SYS_TIMEFF_H_ */
392