From b4cda1b8c90b36bcecd7170cf99a9e269cab1a10 Mon Sep 17 00:00:00 2001 From: Miodrag Dinic Date: Tue, 31 Mar 2015 19:43:11 +0200 Subject: hw/char/goldfish_tty.c: Sign extend addresses for mips When running 32-bit mips kernel with 64-bit qemu-system-mips64el addresses coming from this device should be sign-extended to be properly translated. Change-Id: Idf513bd4000201f64dcc30e8bf69c24d7640dd3c Signed-off-by: Miodrag Dinic --- hw/char/goldfish_tty.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/hw/char/goldfish_tty.c b/hw/char/goldfish_tty.c index a7aee8c1d2..5525e3f3d6 100644 --- a/hw/char/goldfish_tty.c +++ b/hw/char/goldfish_tty.c @@ -172,7 +172,11 @@ static void goldfish_tty_write(void *opaque, hwaddr offset, uint64_t value, unsi break; case TTY_DATA_PTR: +#if defined(TARGET_MIPS64) + s->ptr = (int32_t)deposit64(s->ptr, 0, 32, value); +#else s->ptr = deposit64(s->ptr, 0, 32, value); +#endif break; case TTY_DATA_PTR_HIGH: -- cgit v1.2.3