The memory API returns -1 on unassigned reads, different from the original
in exec.c, which returned zero.  This breaks grlib_uart; apparently some
users depend on it.

Fix by returning zero; however if reading from the uart is legal, then it
should be modified to accept reads.

Signed-off-by: Avi Kivity <a...@redhat.com>
---
 memory.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/memory.c b/memory.c
index ee4c98a..afc12dc 100644
--- a/memory.c
+++ b/memory.c
@@ -917,7 +917,7 @@ static uint64_t memory_region_dispatch_read1(MemoryRegion 
*mr,
     uint64_t data = 0;
 
     if (!memory_region_access_valid(mr, addr, size, false)) {
-        return -1U; /* FIXME: better signalling */
+        return 0; /* FIXME: better signalling */
     }
 
     if (!mr->ops->read) {
-- 
1.7.7.1


Reply via email to