Make the fbclock_[get]{bin,nano,micro}[up]time() function prototypes public so

that new APIs with some performance sensitivity can be built on top of them.
These functions should not be called directly except in special circumstances.

Committed on behalf of Julien Ridoux and Darryl Veitch from the University of
Melbourne, Australia, as part of the FreeBSD Foundation funded "Feed-Forward
Clock Synchronization Algorithms" project.

For more information, see http://www.synclab.org/radclock/

Discussed with:	Julien Ridoux (jridoux at unimelb edu au)
Submitted by:	Julien Ridoux (jridoux at unimelb edu au)
This commit is contained in:
Lawrence Stewart 2011-11-29 06:53:36 +00:00
parent 1e671ba260
commit e977bac333
2 changed files with 34 additions and 12 deletions

View File

@ -178,7 +178,7 @@ tc_delta(struct timehands *th)
*/
#ifdef FFCLOCK
static void
void
fbclock_binuptime(struct bintime *bt)
{
struct timehands *th;
@ -192,7 +192,7 @@ fbclock_binuptime(struct bintime *bt)
} while (gen == 0 || gen != th->th_generation);
}
static void
void
fbclock_nanouptime(struct timespec *tsp)
{
struct bintime bt;
@ -201,7 +201,7 @@ fbclock_nanouptime(struct timespec *tsp)
bintime2timespec(&bt, tsp);
}
static void
void
fbclock_microuptime(struct timeval *tvp)
{
struct bintime bt;
@ -210,7 +210,7 @@ fbclock_microuptime(struct timeval *tvp)
bintime2timeval(&bt, tvp);
}
static void
void
fbclock_bintime(struct bintime *bt)
{
@ -218,7 +218,7 @@ fbclock_bintime(struct bintime *bt)
bintime_add(bt, &boottimebin);
}
static void
void
fbclock_nanotime(struct timespec *tsp)
{
struct bintime bt;
@ -227,7 +227,7 @@ fbclock_nanotime(struct timespec *tsp)
bintime2timespec(&bt, tsp);
}
static void
void
fbclock_microtime(struct timeval *tvp)
{
struct bintime bt;
@ -236,7 +236,7 @@ fbclock_microtime(struct timeval *tvp)
bintime2timeval(&bt, tvp);
}
static void
void
fbclock_getbinuptime(struct bintime *bt)
{
struct timehands *th;
@ -249,7 +249,7 @@ fbclock_getbinuptime(struct bintime *bt)
} while (gen == 0 || gen != th->th_generation);
}
static void
void
fbclock_getnanouptime(struct timespec *tsp)
{
struct timehands *th;
@ -262,7 +262,7 @@ fbclock_getnanouptime(struct timespec *tsp)
} while (gen == 0 || gen != th->th_generation);
}
static void
void
fbclock_getmicrouptime(struct timeval *tvp)
{
struct timehands *th;
@ -275,7 +275,7 @@ fbclock_getmicrouptime(struct timeval *tvp)
} while (gen == 0 || gen != th->th_generation);
}
static void
void
fbclock_getbintime(struct bintime *bt)
{
struct timehands *th;
@ -289,7 +289,7 @@ fbclock_getbintime(struct bintime *bt)
bintime_add(bt, &boottimebin);
}
static void
void
fbclock_getnanotime(struct timespec *tsp)
{
struct timehands *th;
@ -302,7 +302,7 @@ fbclock_getnanotime(struct timespec *tsp)
} while (gen == 0 || gen != th->th_generation);
}
static void
void
fbclock_getmicrotime(struct timeval *tvp)
{
struct timehands *th;

View File

@ -164,6 +164,28 @@ void ffclock_bindifftime(ffcounter ffdelta, struct bintime *bt);
void ffclock_nanodifftime(ffcounter ffdelta, struct timespec *tsp);
void ffclock_microdifftime(ffcounter ffdelta, struct timeval *tvp);
/*
* When FFCLOCK is enabled in the kernel, [get]{bin,nano,micro}[up]time() become
* wrappers around equivalent feedback or feed-forward functions. Provide access
* outside of kern_tc.c to the feedback clock equivalent functions for
* specialised use i.e. these are not for general consumption.
*/
void fbclock_bintime(struct bintime *bt);
void fbclock_nanotime(struct timespec *tsp);
void fbclock_microtime(struct timeval *tvp);
void fbclock_getbintime(struct bintime *bt);
void fbclock_getnanotime(struct timespec *tsp);
void fbclock_getmicrotime(struct timeval *tvp);
void fbclock_binuptime(struct bintime *bt);
void fbclock_nanouptime(struct timespec *tsp);
void fbclock_microuptime(struct timeval *tvp);
void fbclock_getbinuptime(struct bintime *bt);
void fbclock_getnanouptime(struct timespec *tsp);
void fbclock_getmicrouptime(struct timeval *tvp);
#else /* !_KERNEL */
/* Feed-Forward Clock system calls. */