summaryrefslogtreecommitdiffstats
path: root/cpukit/include/rtems/score/watchdogimpl.h
diff options
context:
space:
mode:
Diffstat (limited to 'cpukit/include/rtems/score/watchdogimpl.h')
-rw-r--r--cpukit/include/rtems/score/watchdogimpl.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/cpukit/include/rtems/score/watchdogimpl.h b/cpukit/include/rtems/score/watchdogimpl.h
index a8e6de4fbe..7b364b8828 100644
--- a/cpukit/include/rtems/score/watchdogimpl.h
+++ b/cpukit/include/rtems/score/watchdogimpl.h
@@ -535,6 +535,22 @@ RTEMS_INLINE_ROUTINE uint64_t _Watchdog_Ticks_from_timespec(
}
/**
+ * @brief Converts the ticks to timespec.
+ *
+ * @param ticks are the ticks to convert.
+ *
+ * @param[out] ts is the timespec to return the converted ticks.
+ */
+RTEMS_INLINE_ROUTINE void _Watchdog_Ticks_to_timespec(
+ uint64_t ticks,
+ struct timespec *ts
+)
+{
+ ts->tv_sec = ticks >> WATCHDOG_BITS_FOR_1E9_NANOSECONDS;
+ ts->tv_nsec = ticks & ( ( 1U << WATCHDOG_BITS_FOR_1E9_NANOSECONDS ) - 1 );
+}
+
+/**
* @brief Converts the sbintime in ticks.
*
* @param sbt The sbintime to convert to ticks.