diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 2007-04-02 21:51:52 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 2007-04-02 21:51:52 +0000 |
commit | f6e09342eea83a34edeb71a140c988a818053a32 (patch) | |
tree | e95c73dd531486201f9285b7deac1d4627cbf5d6 /cpukit/posix/src/ualarm.c | |
parent | 2007-04-02 Jennifer Averett <jennifer.averrett@oarcorp.com> (diff) | |
download | rtems-f6e09342eea83a34edeb71a140c988a818053a32.tar.bz2 |
2007-04-02 Joel Sherrill <joel@OARcorp.com>
* posix/include/rtems/posix/timer.h, posix/src/alarm.c,
posix/src/posixtimespectointerval.c, posix/src/ptimer1.c,
posix/src/sysconf.c, posix/src/ualarm.c, rtems/src/clockget.c,
rtems/src/clocktodvalidate.c, score/include/rtems/score/tod.h,
score/inline/rtems/score/tod.inl, score/src/coretod.c: Eliminate
TOD_Ticks_per_second variable.
Diffstat (limited to 'cpukit/posix/src/ualarm.c')
-rw-r--r-- | cpukit/posix/src/ualarm.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/cpukit/posix/src/ualarm.c b/cpukit/posix/src/ualarm.c index ab268d105c..d2b524ef5b 100644 --- a/cpukit/posix/src/ualarm.c +++ b/cpukit/posix/src/ualarm.c @@ -73,10 +73,12 @@ useconds_t ualarm( * this. */ - - ticks = the_timer->initial - - ((the_timer->stop_time - the_timer->start_time) / - _TOD_Ticks_per_second); + ticks = the_timer->initial; + ticks -= (the_timer->stop_time - the_timer->start_time); + + /* remaining is now in ticks */ + ticks *= _TOD_Microseconds_per_tick; + ticks /= TOD_MICROSECONDS_PER_SECOND; _POSIX_Interval_to_timespec( ticks, &tp ); remaining = tp.tv_sec * TOD_MICROSECONDS_PER_SECOND; |