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/alarm.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/alarm.c')
-rw-r--r-- | cpukit/posix/src/alarm.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/cpukit/posix/src/alarm.c b/cpukit/posix/src/alarm.c index c061b97e48..71097554c7 100644 --- a/cpukit/posix/src/alarm.c +++ b/cpukit/posix/src/alarm.c @@ -69,9 +69,12 @@ unsigned int alarm( * this. */ - remaining = the_timer->initial - - ((the_timer->stop_time - the_timer->start_time) / - _TOD_Ticks_per_second); + remaining = the_timer->initial; + remaining -= (the_timer->stop_time - the_timer->start_time); + + /* remaining is now in ticks */ + remaining *= _TOD_Microseconds_per_tick; + remaining /= TOD_MICROSECONDS_PER_SECOND; break; } } |