diff --git a/sys/kern/kern_clock.c b/sys/kern/kern_clock.c index 2e7ca8b7853..e50b73182a9 100644 --- a/sys/kern/kern_clock.c +++ b/sys/kern/kern_clock.c @@ -59,6 +59,7 @@ #include #include #include +#include #include #include @@ -208,6 +209,7 @@ hardclock(frame) hardclock_process(curthread, CLKF_USERMODE(frame)); mtx_unlock_spin_flags(&sched_lock, MTX_QUIET); + tc_ticktock(); /* * If no separate statistics clock is available, run it from here. * diff --git a/sys/kern/kern_tc.c b/sys/kern/kern_tc.c index e2607bf352a..d3d437d441d 100644 --- a/sys/kern/kern_tc.c +++ b/sys/kern/kern_tc.c @@ -647,12 +647,15 @@ pps_event(struct pps_state *pps, int event) static int tc_tick; SYSCTL_INT(_kern_timecounter, OID_AUTO, tick, CTLFLAG_RD, &tick, 0, ""); -static void -tc_ticktock(void *dummy) +void +tc_ticktock(void) { + static int count; + if (++count < tc_tick) + return; + count = 0; tc_windup(); - timeout(tc_ticktock, NULL, tc_tick); } static void @@ -678,7 +681,6 @@ inittimecounter(void *dummy) /* warm up new timecounter (again) and get rolling. */ (void)timecounter->tc_get_timecount(timecounter); (void)timecounter->tc_get_timecount(timecounter); - tc_ticktock(NULL); } SYSINIT(timecounter, SI_SUB_CLOCKS, SI_ORDER_FIRST, inittimecounter, NULL) diff --git a/sys/sys/timetc.h b/sys/sys/timetc.h index b0090300c57..f0d70d5fc63 100644 --- a/sys/sys/timetc.h +++ b/sys/sys/timetc.h @@ -62,5 +62,6 @@ extern struct timecounter *timecounter; u_int32_t tc_getfrequency(void); void tc_init(struct timecounter *tc); void tc_setclock(struct timespec *ts); +void tc_ticktock(void); #endif /* !_SYS_TIMETC_H_ */