score: Add _Watchdog_Ticks_from_sbintime

Necessary to support a network stack update to FreeBSD 12.
This commit is contained in:
Sebastian Huber
2016-11-03 14:43:03 +01:00
parent 9599b4683d
commit afa92ab764

View File

@@ -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