summaryrefslogtreecommitdiffstats
path: root/cpukit/score/include
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2017-10-20 08:43:15 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2017-10-24 09:37:28 +0200
commit7ed377bc69e8cf96b989018322dc43bc0f2d2e36 (patch)
tree135e4735f7bbf8ccf96543803753de1bebcbf9c6 /cpukit/score/include
parentscore: Add _Watchdog_Is_valid_interval_timespec() (diff)
downloadrtems-7ed377bc69e8cf96b989018322dc43bc0f2d2e36.tar.bz2
score: _Watchdog_Is_far_future_monotonic_timespec
Update #3117. Update #3182.
Diffstat (limited to 'cpukit/score/include')
-rw-r--r--cpukit/score/include/rtems/score/watchdog.h9
-rw-r--r--cpukit/score/include/rtems/score/watchdogimpl.h7
2 files changed, 16 insertions, 0 deletions
diff --git a/cpukit/score/include/rtems/score/watchdog.h b/cpukit/score/include/rtems/score/watchdog.h
index bbe2a93b26..8c3710334b 100644
--- a/cpukit/score/include/rtems/score/watchdog.h
+++ b/cpukit/score/include/rtems/score/watchdog.h
@@ -166,6 +166,15 @@ extern volatile Watchdog_Interval _Watchdog_Ticks_since_boot;
*/
extern const uint32_t _Watchdog_Ticks_per_second;
+/**
+ * @brief The maximum number of seconds representable in the monotonic watchdog
+ * format.
+ *
+ * This constant is defined by the application configuration via
+ * <rtems/confdefs.h>.
+ */
+extern const uint64_t _Watchdog_Monotonic_max_seconds;
+
/**@}*/
#ifdef __cplusplus
diff --git a/cpukit/score/include/rtems/score/watchdogimpl.h b/cpukit/score/include/rtems/score/watchdogimpl.h
index 9fc1f05837..31b44f1d0b 100644
--- a/cpukit/score/include/rtems/score/watchdogimpl.h
+++ b/cpukit/score/include/rtems/score/watchdogimpl.h
@@ -319,6 +319,13 @@ RTEMS_INLINE_ROUTINE bool _Watchdog_Is_valid_interval_timespec(
return _Watchdog_Is_valid_timespec( ts ) && ts->tv_sec >= 0;
}
+RTEMS_INLINE_ROUTINE bool _Watchdog_Is_far_future_monotonic_timespec(
+ const struct timespec *ts
+)
+{
+ return ts->tv_sec >= _Watchdog_Monotonic_max_seconds;
+}
+
RTEMS_INLINE_ROUTINE bool _Watchdog_Is_far_future_realtime_timespec(
const struct timespec *ts
)