[timer] Formalise the timer API

We now have two implementations for the timer API: one using the
time-of-day counter at 40:70 and one using RDTSC.  Both make use of
timer2_udelay().
This commit is contained in:
Michael Brown
2008-10-12 19:56:52 +01:00
parent e6f276ece3
commit 16f1e35775
22 changed files with 386 additions and 284 deletions

View File

@@ -63,7 +63,8 @@ struct job_interface monojob = {
int monojob_wait ( const char *string ) {
int key;
int rc;
tick_t last_progress_dot;
unsigned long last_progress_dot;
unsigned long elapsed;
printf ( "%s.", string );
monojob_rc = -EINPROGRESS;
@@ -81,7 +82,8 @@ int monojob_wait ( const char *string ) {
break;
}
}
if ( ( currticks() - last_progress_dot ) > TICKS_PER_SEC ) {
elapsed = ( currticks() - last_progress_dot );
if ( elapsed > TICKS_PER_SEC ) {
printf ( "." );
last_progress_dot = currticks();
}