forked from Imagelibrary/rtems
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.
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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.
|
||||
* @brief Sets the time of day with timespec format.
|
||||
*
|
||||
* The @a tod_as_timestamp timestamp represents the time since UNIX epoch.
|
||||
* The watchdog seconds chain will be adjusted.
|
||||
* @param tod_as_timespec The new time of day in 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[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 );
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -44,7 +44,7 @@ void _TOD_Adjust(
|
||||
|
||||
_Timestamp_Add_to( &tod, &delta );
|
||||
|
||||
_TOD_Set_with_timestamp( &tod );
|
||||
_TOD_Set( &tod );
|
||||
|
||||
_Thread_Enable_dispatch();
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
#include <rtems/score/threaddispatch.h>
|
||||
#include <rtems/score/watchdogimpl.h>
|
||||
|
||||
void _TOD_Set_with_timestamp(
|
||||
void _TOD_Set(
|
||||
const Timestamp_Control *tod_as_timestamp
|
||||
)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user