summaryrefslogtreecommitdiffstats
path: root/cpukit/score/include/rtems/score/timestamp64.h
diff options
context:
space:
mode:
Diffstat (limited to 'cpukit/score/include/rtems/score/timestamp64.h')
-rw-r--r--cpukit/score/include/rtems/score/timestamp64.h27
1 files changed, 27 insertions, 0 deletions
diff --git a/cpukit/score/include/rtems/score/timestamp64.h b/cpukit/score/include/rtems/score/timestamp64.h
index 1c1ea2c90c..41735fa144 100644
--- a/cpukit/score/include/rtems/score/timestamp64.h
+++ b/cpukit/score/include/rtems/score/timestamp64.h
@@ -393,6 +393,33 @@ static inline void _Timestamp64_implementation_To_timespec(
);
#endif
+static inline void _Timestamp64_implementation_To_timeval(
+ const Timestamp64_Control *_timestamp,
+ struct timeval *_timeval
+)
+{
+ _timeval->tv_sec = (time_t) (*_timestamp / 1000000000U);
+ _timeval->tv_usec = (suseconds_t) ((*_timestamp % 1000000000U) / 1000U);
+}
+
+/**
+ * @brief Convert Timestamp to struct timeval
+ *
+ * This method returns the seconds portion of the specified timestamp
+ *
+ * @param[in] _timestamp points to the timestamp
+ * @param[out] _timeval points to the timeval
+ */
+#if CPU_TIMESTAMP_USE_INT64_INLINE == TRUE
+ #define _Timestamp64_To_timeval( _timestamp, _timeval ) \
+ _Timestamp64_implementation_To_timeval( _timestamp, _timeval )
+#else
+ void _Timestamp64_To_timeval(
+ const Timestamp64_Control *_timestamp,
+ struct timeval *_timeval
+ );
+#endif
+
#ifdef __cplusplus
}
#endif