aboutsummaryrefslogtreecommitdiff
path: root/hw/core/ptimer.c
diff options
context:
space:
mode:
Diffstat (limited to 'hw/core/ptimer.c')
-rw-r--r--hw/core/ptimer.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/hw/core/ptimer.c b/hw/core/ptimer.c
index b5a54e2536..c6d2beb1da 100644
--- a/hw/core/ptimer.c
+++ b/hw/core/ptimer.c
@@ -7,11 +7,11 @@
*/
#include "qemu/osdep.h"
-#include "qemu/timer.h"
#include "hw/ptimer.h"
#include "migration/vmstate.h"
#include "qemu/host-utils.h"
#include "sysemu/replay.h"
+#include "sysemu/cpu-timers.h"
#include "sysemu/qtest.h"
#include "block/aio.h"
#include "sysemu/cpus.h"
@@ -134,7 +134,8 @@ static void ptimer_reload(ptimer_state *s, int delta_adjust)
* on the current generation of host machines.
*/
- if (s->enabled == 1 && (delta * period < 10000) && !use_icount) {
+ if (s->enabled == 1 && (delta * period < 10000) &&
+ !icount_enabled() && !qtest_enabled()) {
period = 10000 / delta;
period_frac = 0;
}
@@ -217,7 +218,8 @@ uint64_t ptimer_get_count(ptimer_state *s)
uint32_t period_frac = s->period_frac;
uint64_t period = s->period;
- if (!oneshot && (s->delta * period < 10000) && !use_icount) {
+ if (!oneshot && (s->delta * period < 10000) &&
+ !icount_enabled() && !qtest_enabled()) {
period = 10000 / s->delta;
period_frac = 0;
}