From owner-svn-src-all@FreeBSD.ORG Tue Nov 29 06:53:36 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 89D8A1065672; Tue, 29 Nov 2011 06:53:36 +0000 (UTC) (envelope-from lstewart@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6EBFC8FC12; Tue, 29 Nov 2011 06:53:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAT6rauT028154; Tue, 29 Nov 2011 06:53:36 GMT (envelope-from lstewart@svn.freebsd.org) Received: (from lstewart@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAT6ras1028151; Tue, 29 Nov 2011 06:53:36 GMT (envelope-from lstewart@svn.freebsd.org) Message-Id: <201111290653.pAT6ras1028151@svn.freebsd.org> From: Lawrence Stewart Date: Tue, 29 Nov 2011 06:53:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r228117 - in head/sys: kern sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Nov 2011 06:53:36 -0000 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. */