From 62181b21c2ebe7d5b5f82272dc9bfd4175e4254a Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Fri, 16 Nov 2012 13:59:27 +0100 Subject: score: Add and use _TOD_Get_with_nanoseconds() Delete _TOD_Get_as_timestamp(). --- cpukit/score/inline/rtems/score/tod.inl | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) (limited to 'cpukit/score/inline/rtems') 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 ); } /**@}*/ -- cgit v1.2.3