diff options
author | hselasky <hselasky@FreeBSD.org> | 2015-03-07 18:23:32 +0000 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2015-06-09 14:56:02 +0200 |
commit | b5b8116d20d87e62517736c7e5f591b8d4f0f0d3 (patch) | |
tree | e7e0b2a1b5cfc4b9b8adaec61a9287c16d30a0b3 | |
parent | sptests/sptimecounter03: New test (diff) | |
download | rtems-b5b8116d20d87e62517736c7e5f591b8d4f0f0d3.tar.bz2 |
timecounter: Synchronize with FreeBSD
Add mutex support to the pps_ioctl() API in the kernel.
Bump kernel version to reflect structure change.
PR: 196897
MFC after: 1 week
-rw-r--r-- | cpukit/score/src/kern_tc.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/cpukit/score/src/kern_tc.c b/cpukit/score/src/kern_tc.c index 54799273b7..700c86b1de 100644 --- a/cpukit/score/src/kern_tc.c +++ b/cpukit/score/src/kern_tc.c @@ -36,7 +36,7 @@ #include <rtems/score/watchdogimpl.h> #endif /* __rtems__ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD r277406 2015-01-20T03:54:30Z$"); +__FBSDID("$FreeBSD r279728 2015-03-07T18:23:32Z$"); #include "opt_compat.h" #include "opt_ntp.h" @@ -46,14 +46,8 @@ __FBSDID("$FreeBSD r277406 2015-01-20T03:54:30Z$"); #ifndef __rtems__ #include <sys/kernel.h> #include <sys/limits.h> -#else /* __rtems__ */ -#include <limits.h> -#endif /* __rtems__ */ -#ifdef FFCLOCK #include <sys/lock.h> #include <sys/mutex.h> -#endif -#ifndef __rtems__ #include <sys/sysctl.h> #include <sys/syslog.h> #include <sys/systm.h> @@ -66,6 +60,7 @@ __FBSDID("$FreeBSD r277406 2015-01-20T03:54:30Z$"); #include <sys/vdso.h> #endif /* __rtems__ */ #ifdef __rtems__ +#include <limits.h> #include <rtems.h> ISR_LOCK_DEFINE(static, _Timecounter_Lock, "Timecounter"); #define hz rtems_clock_get_ticks_per_second() @@ -1607,7 +1602,10 @@ pps_fetch(struct pps_fetch_args *fapi, struct pps_state *pps) cseq = pps->ppsinfo.clear_sequence; while (aseq == pps->ppsinfo.assert_sequence && cseq == pps->ppsinfo.clear_sequence) { - err = tsleep(pps, PCATCH, "ppsfch", timo); + if (pps->mtx != NULL) + err = msleep(pps, pps->mtx, PCATCH, "ppsfch", timo); + else + err = tsleep(pps, PCATCH, "ppsfch", timo); if (err == EWOULDBLOCK && fapi->timeout.tv_sec == -1) { continue; } else if (err != 0) { |