Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 29 Nov 2011 06:53:36 +0000 (UTC)
From:      Lawrence Stewart <lstewart@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r228117 - in head/sys: kern sys
Message-ID:  <201111290653.pAT6ras1028151@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: lstewart
Date: Tue Nov 29 06:53:36 2011
New Revision: 228117
URL: http://svn.freebsd.org/changeset/base/228117

Log:
  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)

Modified:
  head/sys/kern/kern_tc.c
  head/sys/sys/timeffc.h

Modified: head/sys/kern/kern_tc.c
==============================================================================
--- head/sys/kern/kern_tc.c	Tue Nov 29 06:21:01 2011	(r228116)
+++ head/sys/kern/kern_tc.c	Tue Nov 29 06:53:36 2011	(r228117)
@@ -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 *t
 	} 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 *t
 	} 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;

Modified: head/sys/sys/timeffc.h
==============================================================================
--- head/sys/sys/timeffc.h	Tue Nov 29 06:21:01 2011	(r228116)
+++ head/sys/sys/timeffc.h	Tue Nov 29 06:53:36 2011	(r228117)
@@ -164,6 +164,28 @@ void ffclock_bindifftime(ffcounter ffdel
 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. */



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201111290653.pAT6ras1028151>