Lines Matching full:timer
57 int cpu_disable_c2_sleep = 0; /* Timer dies in C2. */
58 int cpu_disable_c3_sleep = 0; /* Timer dies in C3. */
75 if (timer->et_flags & ET_FLAGS_PERCPU) \
83 if (timer->et_flags & ET_FLAGS_PERCPU) \
89 static struct eventtimer *timer = NULL; variable
90 static sbintime_t timerperiod; /* Timer period for periodic mode. */
93 static sbintime_t nexttick; /* Next global timer tick time. */
97 static char timername[32]; /* Wanted timer. */
98 TUNABLE_STR("kern.eventtimer.timer", timername, sizeof(timername));
113 struct mtx et_hw_mtx; /* Per-CPU timer mutex. */
118 sbintime_t nexttick; /* Next timer tick time. */
132 * Timer broadcast IPI handler.
221 (timer->et_flags & ET_FLAGS_PERCPU)); in handleevents()
279 if ((timer->et_flags & ET_FLAGS_PERCPU) == 0) { in getnextevent()
296 /* Hardware timer callback function. */
372 * Load new value into hardware timer.
384 if (timer->et_flags & ET_FLAGS_PERCPU)
402 et_start(timer, new, timerperiod);
411 et_start(timer, new - now, 0);
417 * Prepare event timer parameters after configuration changes.
424 if (periodic && (timer->et_flags & ET_FLAGS_PERIODIC) == 0)
426 else if (!periodic && (timer->et_flags & ET_FLAGS_ONESHOT) == 0)
432 freq = round_freq(timer, freq);
437 * Reconfigure specified per-CPU timer on other CPU. Called from IPI handler.
457 et_stop(timer);
472 * Reconfigure specified timer.
520 /* Start global timer or per-CPU timer of this CPU. */
524 /* Stop global timer or per-CPU timer of this CPU. */
525 et_stop(timer);
530 /* If timer is global we are done. */
531 if ((timer->et_flags & ET_FLAGS_PERCPU) == 0) {
533 /* If timer is global or there is no other CPUs yet - we are done. */
534 if ((timer->et_flags & ET_FLAGS_PERCPU) == 0 || !smp_started) {
562 * Calculate nearest frequency supported by hardware timer.
576 panic("Event timer \"%s\" doesn't support sub-second periods!",
602 /* Grab requested timer or the best of present. */
604 timer = et_find(timername, 0, 0);
605 if (timer == NULL && periodic) {
606 timer = et_find(NULL,
609 if (timer == NULL) {
610 timer = et_find(NULL,
613 if (timer == NULL && !periodic) {
614 timer = et_find(NULL,
617 if (timer == NULL)
618 panic("No usable event timer found!");
619 et_init(timer, timercb, NULL, NULL);
621 /* Adapt to timer capabilities. */
622 if (periodic && (timer->et_flags & ET_FLAGS_PERIODIC) == 0)
624 else if (!periodic && (timer->et_flags & ET_FLAGS_ONESHOT) == 0)
626 if (timer->et_flags & ET_FLAGS_C3STOP)
643 base = round_freq(timer, hz * singlemul);
657 profhz = round_freq(timer, profhz);
659 hz = round_freq(timer, hz);
660 stathz = round_freq(timer, 127);
661 profhz = round_freq(timer, stathz * 64);
761 (periodic && (timer->et_flags & ET_FLAGS_PERCPU))
812 * Change the frequency of the given timer. This changes et->et_frequency and
813 * if et is the active timer it reconfigures the timer on all CPUs. This is
821 if (et == timer) {
862 /* If timer is periodic -- there is nothing to reprogram. */
865 /* If timer is global or of the current CPU -- reprogram it. */
866 if ((timer->et_flags & ET_FLAGS_PERCPU) == 0 || cpu == curcpu) {
891 et = timer;
896 et = timer;
908 et_free(timer);
911 if (timer->et_flags & ET_FLAGS_C3STOP)
914 timer = et;
915 et_init(timer, timercb, NULL, NULL);
920 SYSCTL_PROC(_kern_eventtimer, OID_AUTO, timer,
922 0, 0, sysctl_kern_eventtimer_timer, "A", "Chosen event timer");
925 * Report or change the active event timer periodicity.
945 0, 0, sysctl_kern_eventtimer_periodic, "I", "Enable event timer periodic mode");