Revision 74475455 hw/pl031.c
b/hw/pl031.c | ||
---|---|---|
80 | 80 |
|
81 | 81 |
static uint32_t pl031_get_count(pl031_state *s) |
82 | 82 |
{ |
83 |
/* This assumes qemu_get_clock returns the time since the machine was |
|
83 |
/* This assumes qemu_get_clock_ns returns the time since the machine was
|
|
84 | 84 |
created. */ |
85 |
return s->tick_offset + qemu_get_clock(vm_clock) / get_ticks_per_sec(); |
|
85 |
return s->tick_offset + qemu_get_clock_ns(vm_clock) / get_ticks_per_sec();
|
|
86 | 86 |
} |
87 | 87 |
|
88 | 88 |
static void pl031_set_alarm(pl031_state *s) |
... | ... | |
90 | 90 |
int64_t now; |
91 | 91 |
uint32_t ticks; |
92 | 92 |
|
93 |
now = qemu_get_clock(vm_clock); |
|
93 |
now = qemu_get_clock_ns(vm_clock);
|
|
94 | 94 |
ticks = s->tick_offset + now / get_ticks_per_sec(); |
95 | 95 |
|
96 | 96 |
/* The timer wraps around. This subtraction also wraps in the same way, |
... | ... | |
217 | 217 |
qemu_get_timedate(&tm, 0); |
218 | 218 |
s->tick_offset = mktimegm(&tm); |
219 | 219 |
|
220 |
s->timer = qemu_new_timer(vm_clock, pl031_interrupt, s); |
|
220 |
s->timer = qemu_new_timer_ns(vm_clock, pl031_interrupt, s);
|
|
221 | 221 |
return 0; |
222 | 222 |
} |
223 | 223 |
|
Also available in: Unified diff