summaryrefslogtreecommitdiffstats
path: root/cpukit/score/include/rtems/score/tod.h
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2012-11-16 13:59:27 +0100
committerSebastian Huber <sebastian.huber@embedded-brains.de>2012-11-21 16:24:22 +0100
commit62181b21c2ebe7d5b5f82272dc9bfd4175e4254a (patch)
tree4c308d3c621ebc1dbade0ec4da3cc880f151447e /cpukit/score/include/rtems/score/tod.h
parentscore: Add _Timestamp_To_timeval() (diff)
downloadrtems-62181b21c2ebe7d5b5f82272dc9bfd4175e4254a.tar.bz2
score: Add and use _TOD_Get_with_nanoseconds()
Delete _TOD_Get_as_timestamp().
Diffstat (limited to 'cpukit/score/include/rtems/score/tod.h')
-rw-r--r--cpukit/score/include/rtems/score/tod.h29
1 files changed, 20 insertions, 9 deletions
diff --git a/cpukit/score/include/rtems/score/tod.h b/cpukit/score/include/rtems/score/tod.h
index 797f4bbccd..1f21fdbeae 100644
--- a/cpukit/score/include/rtems/score/tod.h
+++ b/cpukit/score/include/rtems/score/tod.h
@@ -197,22 +197,30 @@ static inline void _TOD_Set(
}
/**
- * @brief Returns the time of day in @a tod_as_timestamp.
+ * @brief Returns a snapshot of a clock.
*
- * The @a tod_as_timestamp timestamp represents the time since UNIX epoch.
+ * This function invokes the nanoseconds extension.
+ *
+ * @param[out] snapshot The snapshot.
+ * @param[in] source The clock.
+ *
+ * @return The snapshot.
*/
-void _TOD_Get_as_timestamp(
- Timestamp_Control *tod_as_timestamp
+Timestamp_Control *_TOD_Get_with_nanoseconds(
+ Timestamp_Control *snapshot,
+ const Timestamp_Control *clock
);
static inline void _TOD_Get(
struct timespec *tod_as_timespec
)
{
- Timestamp_Control tod_as_timestamp;
+ Timestamp_Control tod_as_timestamp;
+ Timestamp_Control *tod_as_timestamp_ptr;
- _TOD_Get_as_timestamp( &tod_as_timestamp );
- _Timestamp_To_timespec( &tod_as_timestamp, tod_as_timespec );
+ tod_as_timestamp_ptr =
+ _TOD_Get_with_nanoseconds( &tod_as_timestamp, &_TOD.now );
+ _Timestamp_To_timespec( tod_as_timestamp_ptr, tod_as_timespec );
}
/**
@@ -223,9 +231,12 @@ static inline void _TOD_Get(
*
* @param[in] time is a pointer to the uptime to be returned
*/
-void _TOD_Get_uptime(
+static inline void _TOD_Get_uptime(
Timestamp_Control *time
-);
+)
+{
+ _TOD_Get_with_nanoseconds( time, &_TOD.uptime );
+}
/**
* @brief _TOD_Get_uptime_as_timespec