diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 1995-07-18 21:19:53 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 1995-07-18 21:19:53 +0000 |
commit | 4ca27cfad71ba89028c13bcab9b5630a96f914a9 (patch) | |
tree | 505a42e039c3aa508b1fa2373496abba815a0569 /c/src/lib/libbsp/i386/go32/timer/timer.c | |
parent | fixed for Linux (diff) | |
download | rtems-4ca27cfad71ba89028c13bcab9b5630a96f914a9.tar.bz2 |
committing for rtems-3.2.01 snapshot
Diffstat (limited to '')
-rw-r--r-- | c/src/lib/libbsp/i386/go32/timer/timer.c | 33 |
1 files changed, 16 insertions, 17 deletions
diff --git a/c/src/lib/libbsp/i386/go32/timer/timer.c b/c/src/lib/libbsp/i386/go32/timer/timer.c index 08bf2c86de..3eb9613186 100644 --- a/c/src/lib/libbsp/i386/go32/timer/timer.c +++ b/c/src/lib/libbsp/i386/go32/timer/timer.c @@ -22,7 +22,6 @@ #include <rtems.h> -#include <cpu.h> #include <bsp.h> volatile rtems_unsigned32 Ttimer_val; @@ -47,27 +46,27 @@ void Timer_initialize() #else /* pentium */ static int First = 1; if ( First ) { - /* install ISR */ - set_vector( timerisr, 0x8, 0 ); + /* install ISR */ + set_vector( timerisr, 0x8, 0 ); - /* Wait for ISR to be called at least once */ - Ttimer_val = 0; - while ( Ttimer_val == 0 ) - continue; + /* Wait for ISR to be called at least once */ + Ttimer_val = 0; + while ( Ttimer_val == 0 ) + continue; - /* load timer for 250 microsecond period */ - outport_byte( TIMER_MODE, TIMER_SEL0|TIMER_16BIT|TIMER_RATEGEN ); - outport_byte( TIMER_CNTR0, US_TO_TICK(250) >> 0 & 0xff); - outport_byte( TIMER_CNTR0, US_TO_TICK(250) >> 8 & 0xff); + /* load timer for 250 microsecond period */ + outport_byte( TIMER_MODE, TIMER_SEL0|TIMER_16BIT|TIMER_RATEGEN ); + outport_byte( TIMER_CNTR0, US_TO_TICK(250) >> 0 & 0xff); + outport_byte( TIMER_CNTR0, US_TO_TICK(250) >> 8 & 0xff); - First = 0; + First = 0; } Ttimer_val = 0; /* clear timer ISR count */ #endif /* PENTIUM */ } -#define AVG_OVERHEAD 0 /* 0.1 microseconds to start/stop timer. */ -#define LEAST_VALID 1 /* Don't trust a value lower than this */ +#define AVG_OVERHEAD 0 /* 0.1 microseconds to start/stop timer. */ +#define LEAST_VALID 1 /* Don't trust a value lower than this */ int Read_timer() @@ -86,11 +85,11 @@ int Read_timer() #endif /* pentium */ if ( Timer_driver_Find_average_overhead == 1 ) - return total; + return total; else if ( total < LEAST_VALID ) - return 0; /* below timer resolution */ + return 0; /* below timer resolution */ else - return total - AVG_OVERHEAD; + return total - AVG_OVERHEAD; } rtems_status_code Empty_function( void ) |