summaryrefslogtreecommitdiffstats
path: root/cpukit/score/src/coretod.c
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2013-07-31 14:10:20 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2013-08-01 16:45:46 +0200
commit965a442a4ed63845455956433f7581934663081c (patch)
treefbc25d4d54b675b14585e82f34130b7692626cb2 /cpukit/score/src/coretod.c
parentscore: Add and use _TOD_Is_set() (diff)
downloadrtems-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/src/coretod.c')
-rw-r--r--cpukit/score/src/coretod.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/cpukit/score/src/coretod.c b/cpukit/score/src/coretod.c
index bcdfa39009..3359d4e8ca 100644
--- a/cpukit/score/src/coretod.c
+++ b/cpukit/score/src/coretod.c
@@ -20,14 +20,22 @@
#include <rtems/score/todimpl.h>
+static uint32_t _TOD_Nanoseconds_since_tick_default_handler( void )
+{
+ return 0;
+}
+
void _TOD_Handler_initialization(void)
{
- /* POSIX format TOD (timespec) */
- _Timestamp_Set( &_TOD.now, TOD_SECONDS_1970_THROUGH_1988, 0 );
+ TOD_Control *tod = &_TOD;
+
+ _Timestamp_Set( &tod->now, TOD_SECONDS_1970_THROUGH_1988, 0 );
+
+ _Timestamp_Set_to_zero( &tod->uptime );
- /* Uptime (timespec) */
- _Timestamp_Set_to_zero( &_TOD.uptime );
+ tod->nanoseconds_since_last_tick =
+ _TOD_Nanoseconds_since_tick_default_handler;
/* TOD has not been set */
- _TOD.is_set = false;
+ tod->is_set = false;
}