summaryrefslogtreecommitdiffstats
path: root/cpukit/score/src/coretod.c
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2007-04-02 18:23:59 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2007-04-02 18:23:59 +0000
commit812da546889eea0b6dea7eb2954f46a4c43d1314 (patch)
tree22fc95d921c3544de770454a2f9c604d5d0a27a2 /cpukit/score/src/coretod.c
parent2007-04-02 Joel Sherrill <joel@OARcorp.com> (diff)
downloadrtems-812da546889eea0b6dea7eb2954f46a4c43d1314.tar.bz2
2007-04-02 Joel Sherrill <joel@OARcorp.com>
* itron/src/itrontime.c, libcsupport/src/__gettod.c, posix/include/rtems/posix/time.h, posix/include/rtems/posix/timer.h, posix/src/clockgettime.c, posix/src/clocksettime.c, posix/src/nanosleep.c, posix/src/posixtimespecsubtract.c, posix/src/posixtimespectointerval.c, posix/src/ptimer1.c, posix/src/sleep.c, rtems/Makefile.am, rtems/include/rtems/rtems/clock.h, rtems/include/rtems/rtems/timer.h, rtems/include/rtems/rtems/types.h, rtems/src/clockget.c, rtems/src/clockset.c, rtems/src/clocktodtoseconds.c, rtems/src/clocktodvalidate.c, rtems/src/taskwakewhen.c, score/Makefile.am, score/include/rtems/score/tod.h, score/inline/rtems/score/tod.inl, score/src/coretod.c, score/src/coretodset.c: Convert from Classic API style TOD_Control as fundamental time structure to POSIX struct timespec. Add clock_get_uptime(). * rtems/src/clockgetuptime.c, score/src/coretodget.c, score/src/coretodgetuptime.c: New files. * score/src/coretodtickle.c, score/src/coretodtoseconds.c, score/src/coretodvalidate.c: Removed.
Diffstat (limited to 'cpukit/score/src/coretod.c')
-rw-r--r--cpukit/score/src/coretod.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/cpukit/score/src/coretod.c b/cpukit/score/src/coretod.c
index 4824be2c36..142d8782bc 100644
--- a/cpukit/score/src/coretod.c
+++ b/cpukit/score/src/coretod.c
@@ -40,24 +40,25 @@ void _TOD_Handler_initialization(
{
_TOD_Microseconds_per_tick = microseconds_per_tick;
- _TOD_Seconds_since_epoch = 0;
+ /* POSIX format TOD (timespec) */
+ _TOD_Now.tv_sec = TOD_SECONDS_1970_THROUGH_1988;
+ _TOD_Now.tv_nsec = 0;
+
+ /* Uptime (timespec) */
+ _TOD_Uptime.tv_sec = 0;
+ _TOD_Uptime.tv_nsec = 0;
- _TOD_Current.year = TOD_BASE_YEAR;
- _TOD_Current.month = 1;
- _TOD_Current.day = 1;
- _TOD_Current.hour = 0;
- _TOD_Current.minute = 0;
- _TOD_Current.second = 0;
- _TOD_Current.ticks = 0;
+ /* Seconds since RTEMS Epoch (1988) */
+ _TOD_Seconds_since_epoch = 0;
+ /* Protect ourselves from a divide by zero fault */
if ( microseconds_per_tick == 0 )
_TOD_Ticks_per_second = 0;
else
_TOD_Ticks_per_second =
TOD_MICROSECONDS_PER_SECOND / microseconds_per_tick;
- _Watchdog_Initialize( &_TOD_Seconds_watchdog, _TOD_Tickle, 0, NULL );
-
+ /* TOD has not been set */
_TOD_Is_set = FALSE;
_TOD_Activate( _TOD_Ticks_per_second );
}