diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2013-07-31 14:10:20 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2013-08-01 16:45:46 +0200 |
commit | 965a442a4ed63845455956433f7581934663081c (patch) | |
tree | fbc25d4d54b675b14585e82f34130b7692626cb2 /cpukit/score/include/rtems/score/todimpl.h | |
parent | score: Add and use _TOD_Is_set() (diff) | |
download | rtems-965a442a4ed63845455956433f7581934663081c.tar.bz2 |
score: Move nanoseconds since last tick support
Move the nanoseconds since last tick support from the Watchdog to the
TOD handler. Now the TOD managment is encapsulated in the TOD_Control
structure.
Diffstat (limited to 'cpukit/score/include/rtems/score/todimpl.h')
-rw-r--r-- | cpukit/score/include/rtems/score/todimpl.h | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/cpukit/score/include/rtems/score/todimpl.h b/cpukit/score/include/rtems/score/todimpl.h index 0e2da2fcae..a7c3e5d737 100644 --- a/cpukit/score/include/rtems/score/todimpl.h +++ b/cpukit/score/include/rtems/score/todimpl.h @@ -18,7 +18,7 @@ #ifndef _RTEMS_SCORE_TODIMPL_H #define _RTEMS_SCORE_TODIMPL_H -#include <rtems/score/basedefs.h> +#include <rtems/score/tod.h> #include <rtems/score/timestamp.h> #include <sys/time.h> @@ -149,6 +149,13 @@ typedef struct { uint32_t seconds_trigger; /** + * @brief The current nanoseconds since last tick handler. + * + * This field must not be NULL after initialization. + */ + TOD_Nanoseconds_since_last_tick_routine nanoseconds_since_last_tick; + + /** * @brief Indicates if the time of day is set. * * This is true if the application has set the current @@ -300,6 +307,13 @@ RTEMS_INLINE_ROUTINE void _TOD_Get_timeval( _Timestamp_To_timeval( snapshot_as_timestamp_ptr, time ); } +RTEMS_INLINE_ROUTINE void _TOD_Set_nanoseconds_since_last_tick_handler( + TOD_Nanoseconds_since_last_tick_routine routine +) +{ + _TOD.nanoseconds_since_last_tick = routine; +} + RTEMS_INLINE_ROUTINE bool _TOD_Is_set( void ) { return _TOD.is_set; |