summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_tc.c
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>1999-04-25 09:00:00 +0000
committerphk <phk@FreeBSD.org>1999-04-25 09:00:00 +0000
commit9944adfa60560c210f1f7a3ec4eb221351f54eb4 (patch)
treec594604f5475788af19ce08e9d1bb25738ebc626 /sys/kern/kern_tc.c
parenta7774b22060f578874d895e8b12d204255614f55 (diff)
downloadFreeBSD-src-9944adfa60560c210f1f7a3ec4eb221351f54eb4.zip
FreeBSD-src-9944adfa60560c210f1f7a3ec4eb221351f54eb4.tar.gz
Make the machdep.i8254_freq and machdep.tsc_freq sysctls modify the
timecounter as well Asked for by: bde, jhay
Diffstat (limited to 'sys/kern/kern_tc.c')
-rw-r--r--sys/kern/kern_tc.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/sys/kern/kern_tc.c b/sys/kern/kern_tc.c
index 114a592..a1b7727 100644
--- a/sys/kern/kern_tc.c
+++ b/sys/kern/kern_tc.c
@@ -37,7 +37,7 @@
* SUCH DAMAGE.
*
* @(#)kern_clock.c 8.5 (Berkeley) 1/21/94
- * $Id: kern_clock.c,v 1.92 1999/03/12 21:58:54 phk Exp $
+ * $Id: kern_clock.c,v 1.93 1999/04/02 13:57:21 phk Exp $
*/
#include "opt_ntp.h"
@@ -656,13 +656,19 @@ tco_setscales(struct timecounter *tc)
scale = 1000000000LL << 32;
scale += tc->tc_adjustment;
- scale /= tc->tc_frequency;
+ scale /= tc->tc_tweak->tc_frequency;
tc->tc_scale_micro = scale / 1000;
tc->tc_scale_nano_f = scale & 0xffffffff;
tc->tc_scale_nano_i = scale >> 32;
}
void
+update_timecounter(struct timecounter *tc)
+{
+ tco_setscales(tc);
+}
+
+void
init_timecounter(struct timecounter *tc)
{
struct timespec ts1;
@@ -670,9 +676,9 @@ init_timecounter(struct timecounter *tc)
int i;
tc->tc_adjustment = 0;
+ tc->tc_tweak = tc;
tco_setscales(tc);
tc->tc_offset_count = tc->tc_get_timecount(tc);
- tc->tc_tweak = tc;
MALLOC(t1, struct timecounter *, sizeof *t1, M_TIMECOUNTER, M_WAITOK);
*t1 = *tc;
t2 = t1;
OpenPOWER on IntegriCloud