Пример #1
0
static void
timer_callback(int fd, enum ev_type type, void *param)
{
	static int i;

	if (i >= TEVSZ)
		abort();

	tevbuf[i++] = rdtsc();

	if (i == TEVSZ) {
		mevent_delete(tevp);
		timer_print();
	}
}
Пример #2
0
static void
pit_mevent_cb(int fd, enum ev_type type, void *param)
{
	struct counter *c;

	c = param;

	pit_mev_count++;

	vm_ioapic_pulse_irq(c->ctx, 2);

	/*
	 * Delete the timer for one-shots
	 */
	if (c->mode != TIMER_RATEGEN) {
		mevent_delete(c->tevp);
		c->tevp = NULL;
	}
}