[rtems commit] score: Add _Watchdog_Ticks_from_sbintime

Sebastian Huber sebh at rtems.org
Thu Nov 3 14:19:46 UTC 2016


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

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Thu Nov  3 14:43:03 2016 +0100

score: Add _Watchdog_Ticks_from_sbintime

Necessary to support a network stack update to FreeBSD 12.

---

 cpukit/score/include/rtems/score/watchdogimpl.h | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/cpukit/score/include/rtems/score/watchdogimpl.h b/cpukit/score/include/rtems/score/watchdogimpl.h
index 7253dc4..f6ad05c 100644
--- a/cpukit/score/include/rtems/score/watchdogimpl.h
+++ b/cpukit/score/include/rtems/score/watchdogimpl.h
@@ -25,6 +25,7 @@
 #include <rtems/score/percpu.h>
 #include <rtems/score/rbtreeimpl.h>
 
+#include <sys/types.h>
 #include <sys/timespec.h>
 
 #ifdef __cplusplus
@@ -323,6 +324,17 @@ RTEMS_INLINE_ROUTINE uint64_t _Watchdog_Ticks_from_timespec(
   return ticks;
 }
 
+RTEMS_INLINE_ROUTINE uint64_t _Watchdog_Ticks_from_sbintime(
+  sbintime_t sbt
+)
+{
+  uint64_t ticks = ( sbt >> 32 ) << WATCHDOG_BITS_FOR_1E9_NANOSECONDS;
+
+  ticks |= ( (uint64_t) 1000000000 * (uint32_t) sbt ) >> 32;
+
+  return ticks;
+}
+
 RTEMS_INLINE_ROUTINE void _Watchdog_Per_CPU_acquire_critical(
   Per_CPU_Control  *cpu,
   ISR_lock_Context *lock_context




More information about the vc mailing list