qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] memory: fix return value on unassigned reads
@ 2012-01-26  9:33 Avi Kivity
  2012-01-26 11:31 ` Fabien Chouteau
  0 siblings, 1 reply; 3+ messages in thread
From: Avi Kivity @ 2012-01-26  9:33 UTC (permalink / raw)
  To: atar4qemu; +Cc: Blue Swirl, qemu-devel, chouteau

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 <avi@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

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-01-26 12:19 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-01-26  9:33 [Qemu-devel] [PATCH] memory: fix return value on unassigned reads Avi Kivity
2012-01-26 11:31 ` Fabien Chouteau
2012-01-26 12:18   ` Avi Kivity

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).