summaryrefslogtreecommitdiffstats
path: root/sys/isa/atrtc.c
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>2000-03-20 14:09:06 +0000
committerphk <phk@FreeBSD.org>2000-03-20 14:09:06 +0000
commit1a34cea0e84fcb827b7af5b82e87e94c16fd337b (patch)
tree410ee16f844a72e84e097fb4326b0ddaedd2f446 /sys/isa/atrtc.c
parent1055c7c0e96ac64764f10b1d87889aa4e0ef2ddf (diff)
downloadFreeBSD-src-1a34cea0e84fcb827b7af5b82e87e94c16fd337b.zip
FreeBSD-src-1a34cea0e84fcb827b7af5b82e87e94c16fd337b.tar.gz
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!)
Diffstat (limited to 'sys/isa/atrtc.c')
-rw-r--r--sys/isa/atrtc.c13
1 files changed, 7 insertions, 6 deletions
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 <sys/param.h>
#include <sys/systm.h>
#include <sys/time.h>
+#include <sys/timetc.h>
#include <sys/kernel.h>
#ifndef SMP
#include <sys/lock.h>
@@ -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);
}
OpenPOWER on IntegriCloud