projects
/
qemu
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
avoid rounding problems
[qemu]
/
hw
/
i8254.c
diff --git
a/hw/i8254.c
b/hw/i8254.c
index
20cca0e
..
ad61a14
100644
(file)
--- a/
hw/i8254.c
+++ b/
hw/i8254.c
@@
-136,6
+136,10
@@
static int64_t pit_get_next_transition_time(PITChannelState *s,
}
/* convert to timer units */
next_time = s->count_load_time + muldiv64(next_time, ticks_per_sec, PIT_FREQ);
}
/* convert to timer units */
next_time = s->count_load_time + muldiv64(next_time, ticks_per_sec, PIT_FREQ);
+ /* fix potential rounding problems */
+ /* XXX: better solution: use a clock at PIT_FREQ Hz */
+ if (next_time <= current_time)
+ next_time = current_time + 1;
return next_time;
}
return next_time;
}