diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2012-11-16 13:59:27 +0100 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2012-11-21 16:24:22 +0100 |
commit | 62181b21c2ebe7d5b5f82272dc9bfd4175e4254a (patch) | |
tree | 4c308d3c621ebc1dbade0ec4da3cc880f151447e /cpukit/score/inline/rtems | |
parent | score: Add _Timestamp_To_timeval() (diff) | |
download | rtems-62181b21c2ebe7d5b5f82272dc9bfd4175e4254a.tar.bz2 |
score: Add and use _TOD_Get_with_nanoseconds()
Delete _TOD_Get_as_timestamp().
Diffstat (limited to 'cpukit/score/inline/rtems')
-rw-r--r-- | cpukit/score/inline/rtems/score/tod.inl | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/cpukit/score/inline/rtems/score/tod.inl b/cpukit/score/inline/rtems/score/tod.inl index 14c7b6f5ae..d8a8bb7f20 100644 --- a/cpukit/score/inline/rtems/score/tod.inl +++ b/cpukit/score/inline/rtems/score/tod.inl @@ -56,19 +56,12 @@ RTEMS_INLINE_ROUTINE void _TOD_Get_timeval( struct timeval *time ) { - ISR_Level level; - struct timespec now; - suseconds_t useconds; + Timestamp_Control snapshot_as_timestamp; + Timestamp_Control *snapshot_as_timestamp_ptr; - _ISR_Disable(level); - _TOD_Get( &now ); - _ISR_Enable(level); - - useconds = (suseconds_t)now.tv_nsec; - useconds /= (suseconds_t)TOD_NANOSECONDS_PER_MICROSECOND; - - time->tv_sec = now.tv_sec; - time->tv_usec = useconds; + snapshot_as_timestamp_ptr = + _TOD_Get_with_nanoseconds( &snapshot_as_timestamp, &_TOD.now ); + _Timestamp_To_timeval( snapshot_as_timestamp_ptr, time ); } /**@}*/ |