aboutsummaryrefslogtreecommitdiff
path: root/hw/watchdog/wdt_i6300esb.c
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2015-03-26 17:33:35 +0000
committerPeter Maydell <peter.maydell@linaro.org>2015-03-26 17:33:35 +0000
commitf75d4f82950c9e74c7202081f1cb97ae94b7c7d8 (patch)
tree76a73ae48508d50e1c456441e47c06608cd78c5e /hw/watchdog/wdt_i6300esb.c
parent896848f0d3e2393905845ef2b244bb2601f9df0c (diff)
parent4020db0475b3e527b3bdc97dff873c2be9da2698 (diff)
Merge remote-tracking branch 'remotes/bonzini/tags/for-upstream' into staging
Bugfixes and making SCSI adapters IOMMU-friendly. # gpg: Signature made Thu Mar 26 13:24:05 2015 GMT using RSA key ID 78C7AE83 # gpg: Good signature from "Paolo Bonzini <bonzini@gnu.org>" # gpg: aka "Paolo Bonzini <pbonzini@redhat.com>" # gpg: WARNING: This key is not certified with sufficiently trusted signatures! # gpg: It is not certain that the signature belongs to the owner. # Primary key fingerprint: 46F5 9FBD 57D6 12E7 BFD4 E2F7 7E15 100C CD36 69B1 # Subkey fingerprint: F133 3857 4B66 2389 866C 7682 BFFB D25F 78C7 AE83 * remotes/bonzini/tags/for-upstream: virtio-scsi-dataplane: fix memory leak for VirtIOSCSIVring misc: fix typos in copyright declaration exec: avoid possible overwriting of mmaped area in qemu_ram_remap sparc: memory: Replace memory_region_init_ram with memory_region_allocate_system_memory mips: memory: Replace memory_region_init_ram with memory_region_allocate_system_memory m68k: memory: Replace memory_region_init_ram with memory_region_allocate_system_memory nbd: Fix up comment after commit e140177 vmw_pvscsi: use PCI DMA APIs megasas: use PCI DMA APIs cpus: Don't kick un-realized cpus. i6300esb: Fix signed integer overflow i6300esb: Correct endiannness fw_cfg: factor out initialization of FW_CFG_ID (rev. number) rcu tests: fix compilation on 32-bit ppc Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'hw/watchdog/wdt_i6300esb.c')
-rw-r--r--hw/watchdog/wdt_i6300esb.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/hw/watchdog/wdt_i6300esb.c b/hw/watchdog/wdt_i6300esb.c
index b2d158f7ba..4ebdbb8586 100644
--- a/hw/watchdog/wdt_i6300esb.c
+++ b/hw/watchdog/wdt_i6300esb.c
@@ -125,8 +125,14 @@ static void i6300esb_restart_timer(I6300State *d, int stage)
else
timeout <<= 5;
- /* Get the timeout in units of ticks_per_sec. */
- timeout = get_ticks_per_sec() * timeout / 33000000;
+ /* Get the timeout in units of ticks_per_sec.
+ *
+ * ticks_per_sec is typically 10^9 == 0x3B9ACA00 (30 bits), with
+ * 20 bits of user supplied preload, and 15 bits of scale, the
+ * multiply here can exceed 64-bits, before we divide by 33MHz, so
+ * we use a higher-precision intermediate result.
+ */
+ timeout = muldiv64(get_ticks_per_sec(), timeout, 33000000);
i6300esb_debug("stage %d, timeout %" PRIi64 "\n", d->stage, timeout);
@@ -369,7 +375,7 @@ static const MemoryRegionOps i6300esb_ops = {
i6300esb_mem_writel,
},
},
- .endianness = DEVICE_NATIVE_ENDIAN,
+ .endianness = DEVICE_LITTLE_ENDIAN,
};
static const VMStateDescription vmstate_i6300esb = {