qemu-e2k/hw/watchdog
Laurent Vivier fee562e9e4 i6300esb: fix timer overflow
We use muldiv64() to compute the time to wait:

    timeout = muldiv64(get_ticks_per_sec(), timeout, 33000000);

but get_ticks_per_sec() is 10^9 (30 bit value) and timeout
is a 35 bit value.

Whereas muldiv64 is:

    uint64_t muldiv64(uint64_t a, uint32_t b, uint32_t c)

So we loose 3 bits of timeout.

Swapping get_ticks_per_sec() and timeout fixes it.

We can also replace it by a multiplication by 30 ns,
but this changes PCI clock frequency from 33MHz to 33.333333MHz
and we need to do this on all the QEMU PCI devices (later...)

Signed-off-by: Laurent Vivier <lvivier@redhat.com>
Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2015-09-11 10:21:38 +03:00
..
Makefile.objs s390x/watchdog: introduce diag288 watchdog device 2015-06-11 17:45:49 +02:00
watchdog.c watchdog: Add new Virtual Watchdog action INJECT-NMI 2015-06-11 17:45:50 +02:00
wdt_diag288.c watchdog/diag288: correctly register for system reset requests 2015-07-14 19:10:03 +02:00
wdt_i6300esb.c i6300esb: fix timer overflow 2015-09-11 10:21:38 +03:00
wdt_ib700.c vmstate: accept QEMUTimer in VMSTATE_TIMER*, add VMSTATE_TIMER_PTR* 2015-01-26 12:22:44 +01:00