From: "Andreas Färber" <andreas.faerber@web.de>
To: "Hervé Poussineau" <hpoussin@reactos.org>, qemu-devel@nongnu.org
Cc: qemu-ppc@nongnu.org
Subject: Re: [Qemu-devel] [PATCH v4 2/7] raven: implement non-contiguous I/O region
Date: Thu, 20 Mar 2014 00:22:09 +0100 [thread overview]
Message-ID: <532A26A1.9060508@web.de> (raw)
In-Reply-To: <1395093625-17470-3-git-send-email-hpoussin@reactos.org>
Am 17.03.2014 23:00, schrieb Hervé Poussineau:
> +static uint64_t raven_io_read(void *opaque, hwaddr addr,
> + unsigned int size)
> +{
> + PREPPCIState *s = opaque;
> + uint8_t buf[4];
> +
> + addr = raven_io_address(s, addr);
> + address_space_read(&s->pci_io_as, addr, buf, size);
> +
> + if (size == 1) {
> + return buf[0];
> + } else if (size == 2) {
> + return lduw_p(buf);
> + } else if (size == 4) {
> + return ldl_p(buf);
> + } else {
> + assert(false);
> + }
> +}
> +
> +static void raven_io_write(void *opaque, hwaddr addr,
> + uint64_t val, unsigned int size)
> +{
> + PREPPCIState *s = opaque;
> + uint8_t buf[4];
> +
> + addr = raven_io_address(s, addr);
> +
> + if (size == 1) {
> + buf[0] = val;
> + } else if (size == 2) {
> + stw_p(buf, val);
> + } else if (size == 4) {
> + stl_p(buf, val);
> + } else {
> + assert(false);
Replacing these two with g_assert_not_reached().
Regards,
Andreas
next prev parent reply other threads:[~2014-03-19 23:23 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-17 22:00 [Qemu-devel] [PATCH v4 0/7] prep: improve Raven PCI host emulation Hervé Poussineau
2014-03-17 22:00 ` [Qemu-devel] [PATCH v4 1/7] raven: rename intack region to pci_intack Hervé Poussineau
2014-03-17 22:00 ` [Qemu-devel] [PATCH v4 2/7] raven: implement non-contiguous I/O region Hervé Poussineau
2014-03-19 23:22 ` Andreas Färber [this message]
2014-03-17 22:00 ` [Qemu-devel] [PATCH v4 3/7] raven: set a correct PCI I/O memory region Hervé Poussineau
2014-03-17 22:00 ` [Qemu-devel] [PATCH v4 4/7] raven: set a correct PCI " Hervé Poussineau
2014-03-19 23:24 ` Andreas Färber
2014-03-17 22:00 ` [Qemu-devel] [PATCH v4 5/7] raven: add PCI bus mastering address space Hervé Poussineau
2014-03-17 22:00 ` [Qemu-devel] [PATCH v4 6/7] raven: fix PCI bus accesses with size > 1 Hervé Poussineau
2014-03-18 9:23 ` Artyom Tarasenko
2014-03-17 22:00 ` [Qemu-devel] [PATCH v4 7/7] raven: use raven_ for all function prefixes Hervé Poussineau
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=532A26A1.9060508@web.de \
--to=andreas.faerber@web.de \
--cc=hpoussin@reactos.org \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@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).