Revision 74475455 hw/i8254.c
b/hw/i8254.c | ||
---|---|---|
69 | 69 |
uint64_t d; |
70 | 70 |
int counter; |
71 | 71 |
|
72 |
d = muldiv64(qemu_get_clock(vm_clock) - s->count_load_time, PIT_FREQ, |
|
72 |
d = muldiv64(qemu_get_clock_ns(vm_clock) - s->count_load_time, PIT_FREQ,
|
|
73 | 73 |
get_ticks_per_sec()); |
74 | 74 |
switch(s->mode) { |
75 | 75 |
case 0: |
... | ... | |
198 | 198 |
case 5: |
199 | 199 |
if (s->gate < val) { |
200 | 200 |
/* restart counting on rising edge */ |
201 |
s->count_load_time = qemu_get_clock(vm_clock); |
|
201 |
s->count_load_time = qemu_get_clock_ns(vm_clock);
|
|
202 | 202 |
pit_irq_timer_update(s, s->count_load_time); |
203 | 203 |
} |
204 | 204 |
break; |
... | ... | |
206 | 206 |
case 3: |
207 | 207 |
if (s->gate < val) { |
208 | 208 |
/* restart counting on rising edge */ |
209 |
s->count_load_time = qemu_get_clock(vm_clock); |
|
209 |
s->count_load_time = qemu_get_clock_ns(vm_clock);
|
|
210 | 210 |
pit_irq_timer_update(s, s->count_load_time); |
211 | 211 |
} |
212 | 212 |
/* XXX: disable/enable counting */ |
... | ... | |
240 | 240 |
{ |
241 | 241 |
if (val == 0) |
242 | 242 |
val = 0x10000; |
243 |
s->count_load_time = qemu_get_clock(vm_clock); |
|
243 |
s->count_load_time = qemu_get_clock_ns(vm_clock);
|
|
244 | 244 |
s->count = val; |
245 | 245 |
pit_irq_timer_update(s, s->count_load_time); |
246 | 246 |
} |
... | ... | |
274 | 274 |
if (!(val & 0x10) && !s->status_latched) { |
275 | 275 |
/* status latch */ |
276 | 276 |
/* XXX: add BCD and null count */ |
277 |
s->status = (pit_get_out1(s, qemu_get_clock(vm_clock)) << 7) | |
|
277 |
s->status = (pit_get_out1(s, qemu_get_clock_ns(vm_clock)) << 7) |
|
|
278 | 278 |
(s->rw_mode << 4) | |
279 | 279 |
(s->mode << 1) | |
280 | 280 |
s->bcd; |
... | ... | |
513 | 513 |
|
514 | 514 |
s = &pit->channels[0]; |
515 | 515 |
/* the timer 0 is connected to an IRQ */ |
516 |
s->irq_timer = qemu_new_timer(vm_clock, pit_irq_timer, s); |
|
516 |
s->irq_timer = qemu_new_timer_ns(vm_clock, pit_irq_timer, s);
|
|
517 | 517 |
s->irq = isa_get_irq(pit->irq); |
518 | 518 |
|
519 | 519 |
register_ioport_write(pit->iobase, 4, 1, pit_ioport_write, pit); |
Also available in: Unified diff