Lines Matching refs:timer

85 #define vhpet_tmr(v, n)	(&(v)->timer[n].tmrlst[(v)->timer[n].tmridx].t)
86 #define vhpet_tmrarg(v, n) (&(v)->timer[n].tmrlst[(v)->timer[n].tmridx].a)
132 } timer[VHPET_NUM_TIMERS]; member
180 return ((vhpet->timer[n].cap_config & msi_enable) == msi_enable); in vhpet_timer_msi_enabled()
193 return ((vhpet->timer[n].cap_config & HPET_TCNF_INT_ROUTE) >> 9); in vhpet_timer_ioapic_pin()
256 return ((vhpet->timer[n].cap_config & HPET_TCNF_TYPE) != 0); in vhpet_periodic_timer()
262 return ((vhpet->timer[n].cap_config & HPET_TCNF_INT_ENB) != 0); in vhpet_timer_interrupt_enabled()
283 (vhpet->timer[n].cap_config & HPET_TCNF_INT_TYPE) == 0); in vhpet_timer_edge_trig()
312 vm_lapic_msi(vhpet->vm, vhpet->timer[n].msireg >> 32, in vhpet_timer_interrupt()
313 vhpet->timer[n].msireg & 0xffffffff); in vhpet_timer_interrupt()
357 if (!ts_is_zero(&vhpet->timer[n].expts)) { in vhpet_timer_handler()
359 ts_set_zero(&vhpet->timer[n].expts); in vhpet_timer_handler()
386 vhpet->timer[n].expts = tmrts.it_value; in vhpet_timer_handler()
399 vhpet->timer[n].compval += nexp * vhpet->timer[n].comprate; in vhpet_timer_handler()
413 compval = vhpet->timer[n].compval; in vhpet_adjust_compval()
414 comprate = vhpet->timer[n].comprate; in vhpet_adjust_compval()
416 if (!comprate || timespeccmp(&vhpet->timer[n].expts, now, >=)) in vhpet_adjust_compval()
421 timespecsub(&delta, &vhpet->timer[n].expts); in vhpet_adjust_compval()
441 vhpet->timer[n].compval = compnext; in vhpet_adjust_compval()
453 if (ts_is_zero(&vhpet->timer[n].expts)) in vhpet_stop_timer()
465 if (++vhpet->timer[n].tmridx == nitems(vhpet->timer[n].tmrlst)) in vhpet_stop_timer()
466 vhpet->timer[n].tmridx = 0; in vhpet_stop_timer()
470 n, vhpet->timer[n].tmridx); in vhpet_stop_timer()
481 if (!ts_is_zero(&vhpet->timer[n].expts)) { in vhpet_stop_timer()
482 if (timespeccmp(&vhpet->timer[n].expts, now, <)) { in vhpet_stop_timer()
490 ts_set_zero(&vhpet->timer[n].expts); in vhpet_stop_timer()
512 delta = vhpet->timer[n].compval - counter; in vhpet_start_timer()
516 if (vhpet->timer[n].comprate != 0) in vhpet_start_timer()
517 vhpet_ticks_to_ts(vhpet->timer[n].comprate, &ts.it_interval); in vhpet_start_timer()
529 vhpet->timer[n].expts = ts.it_value; in vhpet_start_timer()
613 oldval = vhpet->timer[n].cap_config; in vhpet_timer_update_config()
623 vhpet->timer[n].cap_config = newval; in vhpet_timer_update_config()
628 vhpet->timer[n].comprate = 0; in vhpet_timer_update_config()
656 allowed_irqs = vhpet->timer[n].cap_config >> 32; in vhpet_timer_update_config()
663 vhpet->timer[n].cap_config &= ~HPET_TCNF_INT_ROUTE; in vhpet_timer_update_config()
790 old_compval = vhpet->timer[i].compval; in vhpet_mmio_write()
791 old_comprate = vhpet->timer[i].comprate; in vhpet_mmio_write()
800 val64 = vhpet->timer[i].comprate; in vhpet_mmio_write()
802 vhpet->timer[i].comprate = val64; in vhpet_mmio_write()
804 if ((vhpet->timer[i].cap_config & in vhpet_mmio_write()
806 vhpet->timer[i].compval = val64; in vhpet_mmio_write()
808 if (vhpet->timer[i].comprate) { in vhpet_mmio_write()
810 " - should be 0", i, vhpet->timer[i].comprate); in vhpet_mmio_write()
811 vhpet->timer[i].comprate = 0; in vhpet_mmio_write()
813 val64 = vhpet->timer[i].compval; in vhpet_mmio_write()
815 vhpet->timer[i].compval = val64; in vhpet_mmio_write()
818 vhpet->timer[i].cap_config &= ~HPET_TCNF_VAL_SET; in vhpet_mmio_write()
820 if (vhpet->timer[i].compval != old_compval || in vhpet_mmio_write()
821 vhpet->timer[i].comprate != old_comprate) { in vhpet_mmio_write()
831 update_register(&vhpet->timer[i].msireg, data, mask); in vhpet_mmio_write()
887 data = vhpet->timer[i].cap_config; in vhpet_mmio_read()
893 data = vhpet->timer[i].compval; in vhpet_mmio_read()
899 data = vhpet->timer[i].msireg; in vhpet_mmio_read()
948 for (j = 0; j < nitems(vhpet->timer[i].tmrlst); j++) { in vhpet_deinit_timers()
949 tmr = &vhpet->timer[i].tmrlst[j].t; in vhpet_deinit_timers()
990 vhpet->timer[i].cap_config = allowed_irqs << 32; in vhpet_init()
991 vhpet->timer[i].cap_config |= HPET_TCAP_PER_INT; in vhpet_init()
992 vhpet->timer[i].cap_config |= HPET_TCAP_FSB_INT_DEL; in vhpet_init()
993 vhpet->timer[i].compval = 0xffffffff; in vhpet_init()
995 for (j = 0; j < nitems(vhpet->timer[i].tmrlst); j++) { in vhpet_init()
996 arg = &vhpet->timer[i].tmrlst[j].a; in vhpet_init()
1000 tmr = &vhpet->timer[i].tmrlst[j].t; in vhpet_init()