aboutsummaryrefslogtreecommitdiffstats
path: root/hw
diff options
context:
space:
mode:
authorOt ten Thije <ottenthije@google.com>2010-09-22 15:47:33 +0100
committerOt ten Thije <ottenthije@google.com>2010-09-24 10:15:19 +0100
commitafb0f8ee7ecec8000aa6f6e0d80e8c8cbfddac0e (patch)
tree8e64b9625b977b0427e7a53c4f95217c5b81efce /hw
parent4e024bb4f5c8aa8b07459f7fbd65c35122127fd1 (diff)
downloadexternal_qemu-afb0f8ee7ecec8000aa6f6e0d80e8c8cbfddac0e.zip
external_qemu-afb0f8ee7ecec8000aa6f6e0d80e8c8cbfddac0e.tar.gz
external_qemu-afb0f8ee7ecec8000aa6f6e0d80e8c8cbfddac0e.tar.bz2
Permanent fix for workaround of timer issue (commit a7f114bc).
The compiler generated incorrect instructions when loading timers, because qemu_get_be64 was used before it was declared. This caused the compiler to assume that a normal (32 bit) int would be returned, rather than a 64 bit one. Just including the "hw/hw.h" header is sufficient to correct this. The makefile for the project has recently been changed to build with -Wall, which should prevent this from going unnoticed again. Change-Id: I74c98183287cf26b767a36f7a6ff9ebf0b891826
Diffstat (limited to 'hw')
-rw-r--r--hw/goldfish_timer.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/hw/goldfish_timer.c b/hw/goldfish_timer.c
index ca90e0e..a714b22 100644
--- a/hw/goldfish_timer.c
+++ b/hw/goldfish_timer.c
@@ -66,8 +66,7 @@ static int goldfish_timer_load(QEMUFile* f, void* opaque, int version_id)
if (version_id != GOLDFISH_TIMER_SAVE_VERSION)
return -1;
- s->now_ns = qemu_get_sbe64(f); /* using qemu_get_be64 (without 's') causes faulty code generation
- in the compiler, dropping the 32 most significant bits */
+ s->now_ns = qemu_get_be64(f);
s->armed = qemu_get_byte(f);
if (s->armed) {
int64_t now_tks = qemu_get_clock(vm_clock);