From: Avi Kivity <avi@redhat.com>
To: atar4qemu@gmail.com
Cc: Blue Swirl <blauwirbel@gmail.com>,
qemu-devel@nongnu.org, chouteau@adacore.com
Subject: [Qemu-devel] [PATCH] memory: fix return value on unassigned reads
Date: Thu, 26 Jan 2012 11:33:31 +0200 [thread overview]
Message-ID: <1327570411-20432-1-git-send-email-avi@redhat.com> (raw)
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
next reply other threads:[~2012-01-26 9:34 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-01-26 9:33 Avi Kivity [this message]
2012-01-26 11:31 ` [Qemu-devel] [PATCH] memory: fix return value on unassigned reads Fabien Chouteau
2012-01-26 12:18 ` Avi Kivity
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1327570411-20432-1-git-send-email-avi@redhat.com \
--to=avi@redhat.com \
--cc=atar4qemu@gmail.com \
--cc=blauwirbel@gmail.com \
--cc=chouteau@adacore.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).