diff options
author | lstewart <lstewart@FreeBSD.org> | 2011-11-21 01:26:10 +0000 |
---|---|---|
committer | lstewart <lstewart@FreeBSD.org> | 2011-11-21 01:26:10 +0000 |
commit | cca3084242962a9999626670f9251e776ee73876 (patch) | |
tree | e812bc9031b95cd473bdb74037774c00712f0667 /sys/sys | |
parent | f05b192013cff01ec4bb794f07f85846cb2915b3 (diff) | |
download | FreeBSD-src-cca3084242962a9999626670f9251e776ee73876.zip FreeBSD-src-cca3084242962a9999626670f9251e776ee73876.tar.gz |
- Add the ffclock_getcounter(), ffclock_getestimate() and ffclock_setestimate()
system calls to provide feed-forward clock management capabilities to
userspace processes. ffclock_getcounter() returns the current value of the
kernel's feed-forward clock counter. ffclock_getestimate() returns the current
feed-forward clock parameter estimates and ffclock_setestimate() updates the
feed-forward clock parameter estimates.
- Document the syscalls in the ffclock.2 man page.
- Regenerate the script-derived syscall related files.
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/
Submitted by: Julien Ridoux (jridoux at unimelb edu au)
Diffstat (limited to 'sys/sys')
-rw-r--r-- | sys/sys/syscall.h | 3 | ||||
-rw-r--r-- | sys/sys/syscall.mk | 3 | ||||
-rw-r--r-- | sys/sys/sysproto.h | 16 | ||||
-rw-r--r-- | sys/sys/timeffc.h | 9 |
4 files changed, 31 insertions, 0 deletions
diff --git a/sys/sys/syscall.h b/sys/sys/syscall.h index e8e213f..a9a1fb2 100644 --- a/sys/sys/syscall.h +++ b/sys/sys/syscall.h @@ -216,6 +216,9 @@ #define SYS_ktimer_gettime 238 #define SYS_ktimer_getoverrun 239 #define SYS_nanosleep 240 +#define SYS_ffclock_getcounter 241 +#define SYS_ffclock_setestimate 242 +#define SYS_ffclock_getestimate 243 #define SYS_ntp_gettime 248 #define SYS_minherit 250 #define SYS_rfork 251 diff --git a/sys/sys/syscall.mk b/sys/sys/syscall.mk index 6a17b71..1113886 100644 --- a/sys/sys/syscall.mk +++ b/sys/sys/syscall.mk @@ -168,6 +168,9 @@ MIASM = \ ktimer_gettime.o \ ktimer_getoverrun.o \ nanosleep.o \ + ffclock_getcounter.o \ + ffclock_setestimate.o \ + ffclock_getestimate.o \ ntp_gettime.o \ minherit.o \ rfork.o \ diff --git a/sys/sys/sysproto.h b/sys/sys/sysproto.h index cf4eaec..84a0ed7 100644 --- a/sys/sys/sysproto.h +++ b/sys/sys/sysproto.h @@ -12,6 +12,7 @@ #include <sys/signal.h> #include <sys/acl.h> #include <sys/cpuset.h> +#include <sys/_ffcounter.h> #include <sys/_semaphore.h> #include <sys/ucontext.h> @@ -726,6 +727,15 @@ struct nanosleep_args { char rqtp_l_[PADL_(const struct timespec *)]; const struct timespec * rqtp; char rqtp_r_[PADR_(const struct timespec *)]; char rmtp_l_[PADL_(struct timespec *)]; struct timespec * rmtp; char rmtp_r_[PADR_(struct timespec *)]; }; +struct ffclock_getcounter_args { + char ffcount_l_[PADL_(ffcounter *)]; ffcounter * ffcount; char ffcount_r_[PADR_(ffcounter *)]; +}; +struct ffclock_setestimate_args { + char cest_l_[PADL_(struct ffclock_estimate *)]; struct ffclock_estimate * cest; char cest_r_[PADR_(struct ffclock_estimate *)]; +}; +struct ffclock_getestimate_args { + char cest_l_[PADL_(struct ffclock_estimate *)]; struct ffclock_estimate * cest; char cest_r_[PADR_(struct ffclock_estimate *)]; +}; struct ntp_gettime_args { char ntvp_l_[PADL_(struct ntptimeval *)]; struct ntptimeval * ntvp; char ntvp_r_[PADR_(struct ntptimeval *)]; }; @@ -1894,6 +1904,9 @@ int sys_ktimer_settime(struct thread *, struct ktimer_settime_args *); int sys_ktimer_gettime(struct thread *, struct ktimer_gettime_args *); int sys_ktimer_getoverrun(struct thread *, struct ktimer_getoverrun_args *); int sys_nanosleep(struct thread *, struct nanosleep_args *); +int sys_ffclock_getcounter(struct thread *, struct ffclock_getcounter_args *); +int sys_ffclock_setestimate(struct thread *, struct ffclock_setestimate_args *); +int sys_ffclock_getestimate(struct thread *, struct ffclock_getestimate_args *); int sys_ntp_gettime(struct thread *, struct ntp_gettime_args *); int sys_minherit(struct thread *, struct minherit_args *); int sys_rfork(struct thread *, struct rfork_args *); @@ -2581,6 +2594,9 @@ int freebsd7_shmctl(struct thread *, struct freebsd7_shmctl_args *); #define SYS_AUE_ktimer_gettime AUE_NULL #define SYS_AUE_ktimer_getoverrun AUE_NULL #define SYS_AUE_nanosleep AUE_NULL +#define SYS_AUE_ffclock_getcounter AUE_NULL +#define SYS_AUE_ffclock_setestimate AUE_NULL +#define SYS_AUE_ffclock_getestimate AUE_NULL #define SYS_AUE_ntp_gettime AUE_NULL #define SYS_AUE_minherit AUE_MINHERIT #define SYS_AUE_rfork AUE_RFORK diff --git a/sys/sys/timeffc.h b/sys/sys/timeffc.h index c2a04ab..0c58c05 100644 --- a/sys/sys/timeffc.h +++ b/sys/sys/timeffc.h @@ -164,6 +164,15 @@ void ffclock_bindifftime(ffcounter ffdelta, struct bintime *bt); void ffclock_nanodifftime(ffcounter ffdelta, struct timespec *tsp); void ffclock_microdifftime(ffcounter ffdelta, struct timeval *tvp); +#else /* !_KERNEL */ + +/* Feed-Forward Clock system calls. */ +__BEGIN_DECLS +int ffclock_getcounter(ffcounter *ffcount); +int ffclock_getestimate(struct ffclock_estimate *cest); +int ffclock_setestimate(struct ffclock_estimate *cest); +__END_DECLS + #endif /* _KERNEL */ #endif /* __BSD_VISIBLE */ #endif /* _SYS_TIMEFF_H_ */ |