Ignore:
Timestamp:
Oct 6, 2017, 1:30:47 PM (2 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
master
Children:
65012bf
Parents:
c0623a99
git-author:
Sebastian Huber <sebastian.huber@…> (10/06/17 13:30:47)
git-committer:
Sebastian Huber <sebastian.huber@…> (10/09/17 06:30:03)
Message:

score: Use struct timespec for TOD

Use the timestamps only for uptime based values. Use struct timespec
for the absolute time values (TOD).

Update #2740.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpukit/score/include/rtems/score/todimpl.h

    rc0623a99 r2256946  
    165165 * The caller must be the owner of the TOD lock.
    166166 *
    167  * @param tod_as_timestamp The new time of day in timestamp format representing
     167 * @param tod The new time of day in timespec format representing
    168168 *   the time since UNIX Epoch.
    169169 * @param lock_context The ISR lock context used for the corresponding
     
    172172 */
    173173void _TOD_Set(
    174   const Timestamp_Control *tod_as_timestamp,
    175   ISR_lock_Context        *lock_context
     174  const struct timespec *tod,
     175  ISR_lock_Context      *lock_context
    176176);
    177177
    178178/**
    179  * @brief Sets the time of day with timespec format.
    180  *
    181  * @param tod_as_timespec The new time of day in timespec format.
    182  *
    183  * @see _TOD_Set().
    184  */
    185 static inline void _TOD_Set_with_timespec(
    186   const struct timespec *tod_as_timespec
    187 )
    188 {
    189   Timestamp_Control tod_as_timestamp;
    190   ISR_lock_Context  lock_context;
    191 
    192   _Timestamp_Set(
    193     &tod_as_timestamp,
    194     tod_as_timespec->tv_sec,
    195     tod_as_timespec->tv_nsec
    196   );
    197 
    198   _TOD_Lock();
    199   _TOD_Acquire( &lock_context );
    200   _TOD_Set( &tod_as_timestamp, &lock_context );
    201   _TOD_Unlock();
    202 }
    203 
    204 /**
    205  *  @brief Gets the current time in the bintime format.
    206  *
    207  *  @param[out] time is the value gathered by the bintime request
     179 *  @brief Gets the current time in the timespec format.
     180 *
     181 *  @param[out] time is the value gathered by the request
    208182 */
    209183static inline void _TOD_Get(
    210   Timestamp_Control *time
    211 )
    212 {
    213   _Timecounter_Bintime(time);
    214 }
    215 
    216 /**
    217  *  @brief Gets the current time in the timespec format.
    218  *
    219  *  @param[out] time is the value gathered by the nanotime request
    220  */
    221 static inline void _TOD_Get_as_timespec(
    222   struct timespec *time
    223 )
    224 {
    225   _Timecounter_Nanotime(time);
     184  struct timespec *tod
     185)
     186{
     187  _Timecounter_Nanotime( tod );
    226188}
    227189
     
    325287 */
    326288void _TOD_Adjust(
    327   const Timestamp_Control *delta
     289  const struct timespec *delta
    328290);
    329291
Note: See TracChangeset for help on using the changeset viewer.