From afb0f8ee7ecec8000aa6f6e0d80e8c8cbfddac0e Mon Sep 17 00:00:00 2001 From: Ot ten Thije Date: Wed, 22 Sep 2010 15:47:33 +0100 Subject: 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 --- hw/goldfish_timer.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'hw') 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); -- cgit v1.1