diff options
Diffstat (limited to 'sys')
-rw-r--r-- | sys/kern/kern_clock.c | 2 | ||||
-rw-r--r-- | sys/kern/kern_tc.c | 10 | ||||
-rw-r--r-- | sys/sys/timetc.h | 1 |
3 files changed, 9 insertions, 4 deletions
diff --git a/sys/kern/kern_clock.c b/sys/kern/kern_clock.c index 2e7ca8b..e50b731 100644 --- a/sys/kern/kern_clock.c +++ b/sys/kern/kern_clock.c @@ -59,6 +59,7 @@ #include <sys/sysctl.h> #include <sys/bus.h> #include <sys/interrupt.h> +#include <sys/timetc.h> #include <machine/cpu.h> #include <machine/limits.h> @@ -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 e2607bf..d3d437d 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 b009030..f0d70d5 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_ */ |