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 <miodrag.dinic@imgtec.com>
diff --git a/hw/char/goldfish_tty.c b/hw/char/goldfish_tty.c
index a7aee8c..5525e3f 100644
--- a/hw/char/goldfish_tty.c
+++ b/hw/char/goldfish_tty.c
@@ -172,7 +172,11 @@
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: