Lines Matching refs:t

99 static uint32_t timer_fsb_route(HPETTimer *t)  in timer_fsb_route()  argument
101 return t->config & HPET_TN_FSB_ENABLE; in timer_fsb_route()
109 static uint32_t timer_is_periodic(HPETTimer *t) in timer_is_periodic() argument
111 return t->config & HPET_TN_PERIODIC; in timer_is_periodic()
114 static uint32_t timer_enabled(HPETTimer *t) in timer_enabled() argument
116 return t->config & HPET_TN_ENABLE; in timer_enabled()
166 static uint64_t hpet_calculate_cmp64(HPETTimer *t, uint64_t cur_tick, uint64_t target) in hpet_calculate_cmp64() argument
168 if (t->config & HPET_TN_32BIT) { in hpet_calculate_cmp64()
268 HPETTimer *t = &s->timer[i]; in hpet_post_load() local
269 t->cmp64 = hpet_calculate_cmp64(t, s->hpet_counter, t->cmp); in hpet_post_load()
270 t->last = qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL) - NANOSECONDS_PER_SECOND; in hpet_post_load()
367 static void hpet_arm(HPETTimer *t, uint64_t tick) in hpet_arm() argument
369 uint64_t ns = hpet_get_ns(t->state, tick); in hpet_arm()
372 if (timer_is_periodic(t) && ns - t->last < 1000) { in hpet_arm()
373 ns = t->last + 1000; in hpet_arm()
376 t->last = ns; in hpet_arm()
377 timer_mod(t->qemu_timer, ns); in hpet_arm()
385 HPETTimer *t = opaque; in hpet_timer() local
386 uint64_t period = t->period; in hpet_timer()
387 uint64_t cur_tick = hpet_get_ticks(t->state); in hpet_timer()
389 if (timer_is_periodic(t) && period != 0) { in hpet_timer()
390 while (hpet_time_after(cur_tick, t->cmp64)) { in hpet_timer()
391 t->cmp64 += period; in hpet_timer()
393 if (t->config & HPET_TN_32BIT) { in hpet_timer()
394 t->cmp = (uint32_t)t->cmp64; in hpet_timer()
396 t->cmp = t->cmp64; in hpet_timer()
398 hpet_arm(t, t->cmp64); in hpet_timer()
399 } else if (t->wrap_flag) { in hpet_timer()
400 t->wrap_flag = 0; in hpet_timer()
401 hpet_arm(t, t->cmp64); in hpet_timer()
403 update_irq(t, 1); in hpet_timer()
406 static void hpet_set_timer(HPETTimer *t) in hpet_set_timer() argument
408 uint64_t cur_tick = hpet_get_ticks(t->state); in hpet_set_timer()
410 t->wrap_flag = 0; in hpet_set_timer()
411 t->cmp64 = hpet_calculate_cmp64(t, cur_tick, t->cmp); in hpet_set_timer()
412 if (t->config & HPET_TN_32BIT) { in hpet_set_timer()
417 if (!timer_is_periodic(t) && t->cmp64 > hpet_next_wrap(cur_tick)) { in hpet_set_timer()
418 t->wrap_flag = 1; in hpet_set_timer()
419 hpet_arm(t, hpet_next_wrap(cur_tick)); in hpet_set_timer()
423 hpet_arm(t, t->cmp64); in hpet_set_timer()
426 static void hpet_del_timer(HPETTimer *t) in hpet_del_timer() argument
428 HPETState *s = t->state; in hpet_del_timer()
429 timer_del(t->qemu_timer); in hpet_del_timer()
431 if (s->isr & (1 << t->tn)) { in hpet_del_timer()
433 update_irq(t, 1); in hpet_del_timer()