From 1a34cea0e84fcb827b7af5b82e87e94c16fd337b Mon Sep 17 00:00:00 2001 From: phk Date: Mon, 20 Mar 2000 14:09:06 +0000 Subject: Isolate the Timecounter internals in their own two files. Make the public interface more systematically named. Remove the alternate method, it doesn't do any good, only ruins performance. Add counters to profile the usage of the 8 access functions. Apply the beer-ware to my code. The weird +/- counts are caused by two repocopies behind the scenes: kern/kern_clock.c -> kern/kern_tc.c sys/time.h -> sys/timetc.h (thanks peter!) --- sys/isa/atrtc.c | 13 +++++++------ sys/isa/sio.c | 1 + 2 files changed, 8 insertions(+), 6 deletions(-) (limited to 'sys/isa') diff --git a/sys/isa/atrtc.c b/sys/isa/atrtc.c index ea39018..871724c 100644 --- a/sys/isa/atrtc.c +++ b/sys/isa/atrtc.c @@ -54,6 +54,7 @@ #include #include #include +#include #include #ifndef SMP #include @@ -771,7 +772,7 @@ startrtclock() set_timer_freq(timer_freq, hz); i8254_timecounter.tc_frequency = timer_freq; - init_timecounter(&i8254_timecounter); + tc_init(&i8254_timecounter); #ifndef CLK_USE_TSC_CALIBRATION if (tsc_freq != 0) { @@ -821,7 +822,7 @@ startrtclock() if (tsc_present && tsc_freq != 0 && !tsc_is_broken) { tsc_timecounter.tc_frequency = tsc_freq; - init_timecounter(&tsc_timecounter); + tc_init(&tsc_timecounter); } #endif /* !defined(SMP) */ @@ -844,7 +845,7 @@ inittodr(time_t base) s = splclock(); ts.tv_sec = base; ts.tv_nsec = 0; - set_timecounter(&ts); + tc_setclock(&ts); splx(s); } @@ -895,7 +896,7 @@ inittodr(time_t base) /* badly off, adjust it */ ts.tv_sec = sec; ts.tv_nsec = 0; - set_timecounter(&ts); + tc_setclock(&ts); } splx(s); return; @@ -1157,7 +1158,7 @@ sysctl_machdep_i8254_freq SYSCTL_HANDLER_ARGS return (EBUSY); /* too much trouble to handle */ set_timer_freq(freq, hz); i8254_timecounter.tc_frequency = freq; - update_timecounter(&i8254_timecounter); + tc_update(&i8254_timecounter); } return (error); } @@ -1178,7 +1179,7 @@ sysctl_machdep_tsc_freq SYSCTL_HANDLER_ARGS if (error == 0 && req->newptr != NULL) { tsc_freq = freq; tsc_timecounter.tc_frequency = tsc_freq; - update_timecounter(&tsc_timecounter); + tc_update(&tsc_timecounter); } return (error); } diff --git a/sys/isa/sio.c b/sys/isa/sio.c index 95b8bfeb..d5681d3 100644 --- a/sys/isa/sio.c +++ b/sys/isa/sio.c @@ -68,6 +68,7 @@ #include #include #include +#include #include #include -- cgit v1.1