diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2016-11-03 14:43:03 +0100 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2016-11-03 15:02:42 +0100 |
commit | afa92ab764f44a0485e48bf777a741a1f45528be (patch) | |
tree | d9ffec2943504335d17f66ee657e0b5bf725e6eb /cpukit/score/include/rtems/score/watchdogimpl.h | |
parent | score: Delete unused _Scheduler_Is_id_valid() (diff) | |
download | rtems-afa92ab764f44a0485e48bf777a741a1f45528be.tar.bz2 |
score: Add _Watchdog_Ticks_from_sbintime
Necessary to support a network stack update to FreeBSD 12.
Diffstat (limited to 'cpukit/score/include/rtems/score/watchdogimpl.h')
-rw-r--r-- | cpukit/score/include/rtems/score/watchdogimpl.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/cpukit/score/include/rtems/score/watchdogimpl.h b/cpukit/score/include/rtems/score/watchdogimpl.h index 7253dc40e4..f6ad05cd8a 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 |