From b5b8116d20d87e62517736c7e5f591b8d4f0f0d3 Mon Sep 17 00:00:00 2001 From: hselasky Date: Sat, 7 Mar 2015 18:23:32 +0000 Subject: 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 --- cpukit/score/src/kern_tc.c | 14 ++++++-------- 1 file 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 #endif /* __rtems__ */ #include -__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 #include -#else /* __rtems__ */ -#include -#endif /* __rtems__ */ -#ifdef FFCLOCK #include #include -#endif -#ifndef __rtems__ #include #include #include @@ -66,6 +60,7 @@ __FBSDID("$FreeBSD r277406 2015-01-20T03:54:30Z$"); #include #endif /* __rtems__ */ #ifdef __rtems__ +#include #include 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) { -- cgit v1.2.3