Revision 6ee093c9 hw/i8254.c
b/hw/i8254.c | ||
---|---|---|
66 | 66 |
uint64_t d; |
67 | 67 |
int counter; |
68 | 68 |
|
69 |
d = muldiv64(qemu_get_clock(vm_clock) - s->count_load_time, PIT_FREQ, ticks_per_sec); |
|
69 |
d = muldiv64(qemu_get_clock(vm_clock) - s->count_load_time, PIT_FREQ, |
|
70 |
get_ticks_per_sec()); |
|
70 | 71 |
switch(s->mode) { |
71 | 72 |
case 0: |
72 | 73 |
case 1: |
... | ... | |
91 | 92 |
uint64_t d; |
92 | 93 |
int out; |
93 | 94 |
|
94 |
d = muldiv64(current_time - s->count_load_time, PIT_FREQ, ticks_per_sec); |
|
95 |
d = muldiv64(current_time - s->count_load_time, PIT_FREQ, |
|
96 |
get_ticks_per_sec()); |
|
95 | 97 |
switch(s->mode) { |
96 | 98 |
default: |
97 | 99 |
case 0: |
... | ... | |
130 | 132 |
uint64_t d, next_time, base; |
131 | 133 |
int period2; |
132 | 134 |
|
133 |
d = muldiv64(current_time - s->count_load_time, PIT_FREQ, ticks_per_sec); |
|
135 |
d = muldiv64(current_time - s->count_load_time, PIT_FREQ, |
|
136 |
get_ticks_per_sec()); |
|
134 | 137 |
switch(s->mode) { |
135 | 138 |
default: |
136 | 139 |
case 0: |
... | ... | |
166 | 169 |
break; |
167 | 170 |
} |
168 | 171 |
/* convert to timer units */ |
169 |
next_time = s->count_load_time + muldiv64(next_time, ticks_per_sec, PIT_FREQ); |
|
172 |
next_time = s->count_load_time + muldiv64(next_time, get_ticks_per_sec(), |
|
173 |
PIT_FREQ); |
|
170 | 174 |
/* fix potential rounding problems */ |
171 | 175 |
/* XXX: better solution: use a clock at PIT_FREQ Hz */ |
172 | 176 |
if (next_time <= current_time) |
... | ... | |
373 | 377 |
#ifdef DEBUG_PIT |
374 | 378 |
printf("irq_level=%d next_delay=%f\n", |
375 | 379 |
irq_level, |
376 |
(double)(expire_time - current_time) / ticks_per_sec);
|
|
380 |
(double)(expire_time - current_time) / get_ticks_per_sec());
|
|
377 | 381 |
#endif |
378 | 382 |
s->next_transition_time = expire_time; |
379 | 383 |
if (expire_time != -1) |
Also available in: Unified diff