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));
114 struct mtx et_hw_mtx; /* Per-CPU timer mutex. */
119 sbintime_t nexttick; /* Next timer tick time. */
222 (timer->et_flags & ET_FLAGS_PERCPU));
283 if ((timer->et_flags & ET_FLAGS_PERCPU) == 0) {
300 /* Hardware timer callback function. */
376 * Load new value into hardware timer.
387 if (timer->et_flags & ET_FLAGS_PERCPU) {
406 et_start(timer, new, timerperiod);
415 et_start(timer, new - now, 0);
421 * Prepare event timer parameters after configuration changes.
428 if (periodic && (timer->et_flags & ET_FLAGS_PERIODIC) == 0)
430 else if (!periodic && (timer->et_flags & ET_FLAGS_ONESHOT) == 0)
436 freq = round_freq(timer, freq);
441 * Reconfigure specified per-CPU timer on other CPU. Called from IPI handler.
461 et_stop(timer);
476 * Reconfigure specified timer.
524 /* Start global timer or per-CPU timer of this CPU. */
528 /* Stop global timer or per-CPU timer of this CPU. */
529 et_stop(timer);
534 /* If timer is global we are done. */
535 if ((timer->et_flags & ET_FLAGS_PERCPU) == 0) {
537 /* If timer is global or there is no other CPUs yet - we are done. */
538 if ((timer->et_flags & ET_FLAGS_PERCPU) == 0 || !smp_started) {
566 * Calculate nearest frequency supported by hardware timer.
580 panic("Event timer \"%s\" doesn't support sub-second periods!",
606 /* Grab requested timer or the best of present. */
608 timer = et_find(timername, 0, 0);
609 if (timer == NULL && periodic) {
610 timer = et_find(NULL,
613 if (timer == NULL) {
614 timer = et_find(NULL,
617 if (timer == NULL && !periodic) {
618 timer = et_find(NULL,
621 if (timer == NULL)
622 panic("No usable event timer found!");
623 et_init(timer, timercb, NULL, NULL);
625 /* Adapt to timer capabilities. */
626 if (periodic && (timer->et_flags & ET_FLAGS_PERIODIC) == 0)
628 else if (!periodic && (timer->et_flags & ET_FLAGS_ONESHOT) == 0)
630 if (timer->et_flags & ET_FLAGS_C3STOP)
647 base = round_freq(timer, hz * singlemul);
661 profhz = round_freq(timer, profhz);
663 hz = round_freq(timer, hz);
664 stathz = round_freq(timer, 127);
665 profhz = round_freq(timer, stathz * 64);
767 (periodic && (timer->et_flags & ET_FLAGS_PERCPU))
818 * Change the frequency of the given timer. This changes et->et_frequency and
819 * if et is the active timer it reconfigures the timer on all CPUs. This is
827 if (et == timer) {
867 /* If timer is periodic -- there is nothing to reprogram. */
870 /* If timer is global or of the current CPU -- reprogram it. */
871 if ((timer->et_flags & ET_FLAGS_PERCPU) == 0 || cpu == curcpu) {
896 et = timer;
901 et = timer;
913 et_free(timer);
916 if (timer->et_flags & ET_FLAGS_C3STOP)
919 timer = et;
920 et_init(timer, timercb, NULL, NULL);
925 SYSCTL_PROC(_kern_eventtimer, OID_AUTO, timer,
927 0, 0, sysctl_kern_eventtimer_timer, "A", "Chosen event timer");
930 * Report or change the active event timer periodicity.
950 0, 0, sysctl_kern_eventtimer_periodic, "I", "Enable event timer periodic mode");