hpet: Fix emulation of HPET_TN_SETVAL (Jan Kiszka)
[qemu] / hw / hpet.c
index 7df2d05..c7945ec 100644 (file)
--- a/hw/hpet.c
+++ b/hw/hpet.c
@@ -411,7 +411,7 @@ static void hpet_ram_writel(void *opaque, target_phys_addr_t addr,
                            (timer->config & HPET_TN_SETVAL))
                     timer->cmp = (timer->cmp & 0xffffffff00000000ULL)
                                   | new_val;
-                else {
+                if (timer_is_periodic(timer)) {
                     /*
                      * FIXME: Clamp period to reasonable min value?
                      * Clamp period to reasonable max value