From 3888771772a57b4c924e1987e603e7a1b957e07c Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Wed, 27 Apr 2016 21:32:23 +0200 Subject: score: Streamline set time of day functions Rename _TOD_Set() into _TOD_Set_with_timespec(). Rename _TOD_Set_with_timestamp() into _TOD_Set(). This is now in line with _TOD_Get() and _TOD_Get_as_timespec(). The timestamp is the canonical format. --- cpukit/posix/src/clocksettime.c | 2 +- cpukit/rtems/src/clockset.c | 2 +- cpukit/score/include/rtems/score/todimpl.h | 25 +++++++++---------------- cpukit/score/src/coretodadjust.c | 2 +- cpukit/score/src/coretodset.c | 2 +- 5 files changed, 13 insertions(+), 20 deletions(-) diff --git a/cpukit/posix/src/clocksettime.c b/cpukit/posix/src/clocksettime.c index a700ba986b..4d3be3b4a2 100644 --- a/cpukit/posix/src/clocksettime.c +++ b/cpukit/posix/src/clocksettime.c @@ -42,7 +42,7 @@ int clock_settime( rtems_set_errno_and_return_minus_one( EINVAL ); _Thread_Disable_dispatch(); - _TOD_Set( tp ); + _TOD_Set_with_timespec( tp ); _Thread_Enable_dispatch(); } #ifdef _POSIX_CPUTIME diff --git a/cpukit/rtems/src/clockset.c b/cpukit/rtems/src/clockset.c index e87f167b57..8d065b4011 100644 --- a/cpukit/rtems/src/clockset.c +++ b/cpukit/rtems/src/clockset.c @@ -39,7 +39,7 @@ rtems_status_code rtems_clock_set( _Timestamp_Set( &tod_as_timestamp, seconds, nanoseconds ); _Thread_Disable_dispatch(); - _TOD_Set_with_timestamp( &tod_as_timestamp ); + _TOD_Set( &tod_as_timestamp ); _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; diff --git a/cpukit/score/include/rtems/score/todimpl.h b/cpukit/score/include/rtems/score/todimpl.h index b1f8a6d6b6..2b07823e14 100644 --- a/cpukit/score/include/rtems/score/todimpl.h +++ b/cpukit/score/include/rtems/score/todimpl.h @@ -143,30 +143,23 @@ typedef struct { extern TOD_Control _TOD; /** - * @brief Sets the time of day from timestamp. + * @brief Sets the time of day. * - * The @a tod_as_timestamp timestamp represents the time since UNIX epoch. - * The watchdog seconds chain will be adjusted. - * - * @param[in] tod_as_timestamp is the constant of the time of day as a timestamp + * @param tod_as_timestamp The new time of day in timestamp format representing + * the time since UNIX Epoch. */ -void _TOD_Set_with_timestamp( +void _TOD_Set( const Timestamp_Control *tod_as_timestamp ); /** - * @brief Sets the time of day from timespec. - * - * The @a tod_as_timestamp timestamp represents the time since UNIX epoch. - * The watchdog seconds chain will be adjusted. + * @brief Sets the time of day with timespec format. * - * In the process the input given as timespec will be transformed to FreeBSD - * bintime format to guarantee the right format for later setting it with a - * timestamp. + * @param tod_as_timespec The new time of day in timespec format. * - * @param[in] tod_as_timespec is the constant of the time of day as a timespec + * @see _TOD_Set(). */ -static inline void _TOD_Set( +static inline void _TOD_Set_with_timespec( const struct timespec *tod_as_timespec ) { @@ -177,7 +170,7 @@ static inline void _TOD_Set( tod_as_timespec->tv_sec, tod_as_timespec->tv_nsec ); - _TOD_Set_with_timestamp( &tod_as_timestamp ); + _TOD_Set( &tod_as_timestamp ); } /** diff --git a/cpukit/score/src/coretodadjust.c b/cpukit/score/src/coretodadjust.c index 6097e207dc..51c10ec849 100644 --- a/cpukit/score/src/coretodadjust.c +++ b/cpukit/score/src/coretodadjust.c @@ -44,7 +44,7 @@ void _TOD_Adjust( _Timestamp_Add_to( &tod, &delta ); - _TOD_Set_with_timestamp( &tod ); + _TOD_Set( &tod ); _Thread_Enable_dispatch(); } diff --git a/cpukit/score/src/coretodset.c b/cpukit/score/src/coretodset.c index b2efc07115..e11f47c904 100644 --- a/cpukit/score/src/coretodset.c +++ b/cpukit/score/src/coretodset.c @@ -22,7 +22,7 @@ #include #include -void _TOD_Set_with_timestamp( +void _TOD_Set( const Timestamp_Control *tod_as_timestamp ) { -- cgit v1.2.3