Lines Matching refs:timer
91 } timer[VHPET_NUM_TIMERS]; member
128 if ((vhpet->timer[n].cap_config & msi_enable) == msi_enable) in vhpet_timer_msi_enabled()
144 return ((vhpet->timer[n].cap_config & HPET_TCNF_INT_ROUTE) >> 9); in vhpet_timer_ioapic_pin()
190 return ((vhpet->timer[n].cap_config & HPET_TCNF_TYPE) != 0); in vhpet_periodic_timer()
197 return ((vhpet->timer[n].cap_config & HPET_TCNF_INT_ENB) != 0); in vhpet_timer_interrupt_enabled()
207 if ((vhpet->timer[n].cap_config & HPET_TCNF_INT_TYPE) == 0) in vhpet_timer_edge_trig()
231 lapic_intr_msi(vhpet->vm, vhpet->timer[n].msireg >> 32, in vhpet_timer_interrupt()
232 vhpet->timer[n].msireg & 0xffffffff); in vhpet_timer_interrupt()
255 KASSERT(vhpet->timer[n].comprate != 0, ("hpet t%d is not periodic", n)); in vhpet_adjust_compval()
257 compval = vhpet->timer[n].compval; in vhpet_adjust_compval()
258 comprate = vhpet->timer[n].comprate; in vhpet_adjust_compval()
273 vhpet->timer[n].compval = compnext; in vhpet_adjust_compval()
289 callout = &vhpet->timer[n].callout; in vhpet_handler()
319 callout_stop(&vhpet->timer[n].callout); in vhpet_stop_timer()
328 if (vhpet->timer[n].callout_sbt < now) { in vhpet_stop_timer()
340 if (vhpet->timer[n].comprate != 0) in vhpet_start_timer()
351 delta = (vhpet->timer[n].compval - counter) * vhpet->freq_sbt; in vhpet_start_timer()
353 vhpet->timer[n].callout_sbt = now + delta; in vhpet_start_timer()
354 callout_reset_sbt(&vhpet->timer[n].callout, vhpet->timer[n].callout_sbt, in vhpet_start_timer()
355 precision, vhpet_handler, &vhpet->timer[n].arg, C_ABSOLUTE); in vhpet_start_timer()
407 oldval = vhpet->timer[n].cap_config; in vhpet_timer_update_config()
417 vhpet->timer[n].cap_config = newval; in vhpet_timer_update_config()
425 allowed_irqs = vhpet->timer[n].cap_config >> 32; in vhpet_timer_update_config()
431 vhpet->timer[n].cap_config &= ~HPET_TCNF_INT_ROUTE; in vhpet_timer_update_config()
435 vhpet->timer[n].comprate = 0; in vhpet_timer_update_config()
571 old_compval = vhpet->timer[i].compval; in vhpet_mmio_write()
572 old_comprate = vhpet->timer[i].comprate; in vhpet_mmio_write()
580 val64 = vhpet->timer[i].comprate; in vhpet_mmio_write()
582 vhpet->timer[i].comprate = val64; in vhpet_mmio_write()
583 if ((vhpet->timer[i].cap_config & in vhpet_mmio_write()
585 vhpet->timer[i].compval = val64; in vhpet_mmio_write()
588 KASSERT(vhpet->timer[i].comprate == 0, in vhpet_mmio_write()
590 "rate %u", i, vhpet->timer[i].comprate)); in vhpet_mmio_write()
591 val64 = vhpet->timer[i].compval; in vhpet_mmio_write()
593 vhpet->timer[i].compval = val64; in vhpet_mmio_write()
595 vhpet->timer[i].cap_config &= ~HPET_TCNF_VAL_SET; in vhpet_mmio_write()
597 if (vhpet->timer[i].compval != old_compval || in vhpet_mmio_write()
598 vhpet->timer[i].comprate != old_comprate) { in vhpet_mmio_write()
610 update_register(&vhpet->timer[i].msireg, data, mask); in vhpet_mmio_write()
671 data = vhpet->timer[i].cap_config; in vhpet_mmio_read()
677 data = vhpet->timer[i].compval; in vhpet_mmio_read()
683 data = vhpet->timer[i].msireg; in vhpet_mmio_read()
729 vhpet->timer[i].cap_config = allowed_irqs << 32; in vhpet_init()
730 vhpet->timer[i].cap_config |= HPET_TCAP_PER_INT; in vhpet_init()
731 vhpet->timer[i].cap_config |= HPET_TCAP_FSB_INT_DEL; in vhpet_init()
733 vhpet->timer[i].compval = 0xffffffff; in vhpet_init()
734 callout_init(&vhpet->timer[i].callout, 1); in vhpet_init()
736 arg = &vhpet->timer[i].arg; in vhpet_init()
750 callout_drain(&vhpet->timer[i].callout); in vhpet_cleanup()
786 for (i = 0; i < nitems(vhpet->timer); i++) { in vhpet_snapshot()
787 SNAPSHOT_VAR_OR_LEAVE(vhpet->timer[i].cap_config, in vhpet_snapshot()
789 SNAPSHOT_VAR_OR_LEAVE(vhpet->timer[i].msireg, meta, ret, done); in vhpet_snapshot()
790 SNAPSHOT_VAR_OR_LEAVE(vhpet->timer[i].compval, meta, ret, done); in vhpet_snapshot()
791 SNAPSHOT_VAR_OR_LEAVE(vhpet->timer[i].comprate, meta, ret, done); in vhpet_snapshot()
792 SNAPSHOT_VAR_OR_LEAVE(vhpet->timer[i].callout_sbt, in vhpet_snapshot()