Lines Matching refs:timer

76 		if (timer->et_flags & ET_FLAGS_PERCPU)			\
84 if (timer->et_flags & ET_FLAGS_PERCPU) \
90 static struct eventtimer *timer = NULL;
94 static sbintime_t nexttick; /* Next global timer tick time. */
98 static char timername[32]; /* Wanted timer. */
99 TUNABLE_STR("kern.eventtimer.timer", timername, sizeof(timername));
116 struct mtx et_hw_mtx; /* Per-CPU timer mutex. */
121 sbintime_t nexttick; /* Next timer tick time. */
224 (timer->et_flags & ET_FLAGS_PERCPU));
283 if ((timer->et_flags & ET_FLAGS_PERCPU) == 0) {
298 /* Hardware timer callback function. */
367 * Load new value into hardware timer.
378 if (timer->et_flags & ET_FLAGS_PERCPU) {
397 et_start(timer, new, timerperiod);
406 et_start(timer, new - now, 0);
412 * Prepare event timer parameters after configuration changes.
419 if (periodic && (timer->et_flags & ET_FLAGS_PERIODIC) == 0)
421 else if (!periodic && (timer->et_flags & ET_FLAGS_ONESHOT) == 0)
427 freq = round_freq(timer, freq);
432 * Reconfigure specified per-CPU timer on other CPU. Called from IPI handler.
452 et_stop(timer);
467 * Reconfigure specified timer.
510 /* Start global timer or per-CPU timer of this CPU. */
514 /* Stop global timer or per-CPU timer of this CPU. */
515 et_stop(timer);
519 /* If timer is global or there is no other CPUs yet - we are done. */
520 if ((timer->et_flags & ET_FLAGS_PERCPU) == 0 || !smp_started) {
547 * Calculate nearest frequency supported by hardware timer.
561 panic("Event timer \"%s\" doesn't support sub-second periods!",
587 /* Grab requested timer or the best of present. */
589 timer = et_find(timername, 0, 0);
590 if (timer == NULL && periodic) {
591 timer = et_find(NULL,
594 if (timer == NULL) {
595 timer = et_find(NULL,
598 if (timer == NULL && !periodic) {
599 timer = et_find(NULL,
602 if (timer == NULL)
603 panic("No usable event timer found!");
604 et_init(timer, timercb, NULL, NULL);
606 /* Adapt to timer capabilities. */
607 if (periodic && (timer->et_flags & ET_FLAGS_PERIODIC) == 0)
609 else if (!periodic && (timer->et_flags & ET_FLAGS_ONESHOT) == 0)
611 if (timer->et_flags & ET_FLAGS_C3STOP)
628 base = round_freq(timer, hz * singlemul);
642 profhz = round_freq(timer, profhz);
644 hz = round_freq(timer, hz);
645 stathz = round_freq(timer, 127);
646 profhz = round_freq(timer, stathz * 64);
732 (periodic && (timer->et_flags & ET_FLAGS_PERCPU))
783 * Change the frequency of the given timer. This changes et->et_frequency and
784 * if et is the active timer it reconfigures the timer on all CPUs. This is
792 if (et == timer) {
830 /* If timer is periodic -- there is nothing to reprogram. */
833 /* If timer is global or of the current CPU -- reprogram it. */
834 if ((timer->et_flags & ET_FLAGS_PERCPU) == 0 || cpu == curcpu) {
859 et = timer;
864 et = timer;
876 et_free(timer);
879 if (timer->et_flags & ET_FLAGS_C3STOP)
882 timer = et;
883 et_init(timer, timercb, NULL, NULL);
888 SYSCTL_PROC(_kern_eventtimer, OID_AUTO, timer,
890 0, 0, sysctl_kern_eventtimer_timer, "A", "Chosen event timer");
893 * Report or change the active event timer periodicity.
913 0, 0, sysctl_kern_eventtimer_periodic, "I", "Enable event timer periodic mode");