[rtems commit] timecounter: Synchronize with FreeBSD

Sebastian Huber sebh at rtems.org
Tue Jun 9 13:19:51 UTC 2015


Module:    rtems
Branch:    master
Commit:    b5b8116d20d87e62517736c7e5f591b8d4f0f0d3
Changeset: http://git.rtems.org/rtems/commit/?id=b5b8116d20d87e62517736c7e5f591b8d4f0f0d3

Author:    hselasky <hselasky at FreeBSD.org>
Date:      Sat Mar  7 18:23:32 2015 +0000

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 5479927..700c86b 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) {



More information about the vc mailing list