qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Andreas Färber" <andreas.faerber@web.de>
To: qemu-devel@nongnu.org
Cc: "Anthony Liguori" <aliguori@us.ibm.com>,
	"Benoît Canet" <benoit.canet@gmail.com>,
	"Michael S. Tsirkin" <mst@redhat.com>,
	"Alexander Graf" <agraf@suse.de>,
	"Andreas Färber" <andreas.faerber@web.de>,
	qemu-ppc@nongnu.org, "Avi Kivity" <avi@redhat.com>,
	"Richard Henderson" <rth@twiddle.net>
Subject: [Qemu-devel] [PATCH 05/10] prep_pci: Update I/O to MemoryRegion ops
Date: Fri, 20 Jan 2012 00:35:26 +0100	[thread overview]
Message-ID: <1327016131-5344-6-git-send-email-andreas.faerber@web.de> (raw)
In-Reply-To: <1327016131-5344-1-git-send-email-andreas.faerber@web.de>

Convert to new-style read/write callbacks.

Signed-off-by: Andreas Färber <andreas.faerber@web.de>
Cc: Alexander Graf <agraf@suse.de>
Cc: Michael S. Tsirkin <mst@redhat.com>
Cc: Avi Kivity <avi@redhat.com>
Cc: Benoît Canet <benoit.canet@gmail.com>
---
 hw/prep_pci.c |   46 ++++++++--------------------------------------
 1 files changed, 8 insertions(+), 38 deletions(-)

diff --git a/hw/prep_pci.c b/hw/prep_pci.c
index edfb25d..2600e26 100644
--- a/hw/prep_pci.c
+++ b/hw/prep_pci.c
@@ -44,53 +44,23 @@ static inline uint32_t PPC_PCIIO_config(target_phys_addr_t addr)
     return (addr & 0x7ff) |  (i << 11);
 }
 
-static void PPC_PCIIO_writeb (void *opaque, target_phys_addr_t addr, uint32_t val)
+static void ppc_pci_io_write(void *opaque, target_phys_addr_t addr,
+                             uint64_t val, unsigned int size)
 {
     PREPPCIState *s = opaque;
-    pci_data_write(s->bus, PPC_PCIIO_config(addr), val, 1);
+    pci_data_write(s->bus, PPC_PCIIO_config(addr), val, size);
 }
 
-static void PPC_PCIIO_writew (void *opaque, target_phys_addr_t addr, uint32_t val)
+static uint64_t ppc_pci_io_read(void *opaque, target_phys_addr_t addr,
+                                unsigned int size)
 {
     PREPPCIState *s = opaque;
-    pci_data_write(s->bus, PPC_PCIIO_config(addr), val, 2);
-}
-
-static void PPC_PCIIO_writel (void *opaque, target_phys_addr_t addr, uint32_t val)
-{
-    PREPPCIState *s = opaque;
-    pci_data_write(s->bus, PPC_PCIIO_config(addr), val, 4);
-}
-
-static uint32_t PPC_PCIIO_readb (void *opaque, target_phys_addr_t addr)
-{
-    PREPPCIState *s = opaque;
-    uint32_t val;
-    val = pci_data_read(s->bus, PPC_PCIIO_config(addr), 1);
-    return val;
-}
-
-static uint32_t PPC_PCIIO_readw (void *opaque, target_phys_addr_t addr)
-{
-    PREPPCIState *s = opaque;
-    uint32_t val;
-    val = pci_data_read(s->bus, PPC_PCIIO_config(addr), 2);
-    return val;
-}
-
-static uint32_t PPC_PCIIO_readl (void *opaque, target_phys_addr_t addr)
-{
-    PREPPCIState *s = opaque;
-    uint32_t val;
-    val = pci_data_read(s->bus, PPC_PCIIO_config(addr), 4);
-    return val;
+    return pci_data_read(s->bus, PPC_PCIIO_config(addr), size);
 }
 
 static const MemoryRegionOps PPC_PCIIO_ops = {
-    .old_mmio = {
-        .read = { PPC_PCIIO_readb, PPC_PCIIO_readw, PPC_PCIIO_readl, },
-        .write = { PPC_PCIIO_writeb, PPC_PCIIO_writew, PPC_PCIIO_writel, },
-    },
+    .read = ppc_pci_io_read,
+    .write = ppc_pci_io_write,
     .endianness = DEVICE_LITTLE_ENDIAN,
 };
 
-- 
1.7.7

  parent reply	other threads:[~2012-01-19 23:37 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-19 23:35 [Qemu-devel] [PULL] PReP patch queue 2012-01-20 Andreas Färber
2012-01-19 23:35 ` [Qemu-devel] [PATCH 01/10] prep: Fix offset of BIOS MemoryRegion Andreas Färber
2012-01-19 23:35 ` [Qemu-devel] [PATCH 02/10] prep: Use ISA m48t59 Andreas Färber
2012-01-19 23:35 ` [Qemu-devel] [PATCH 03/10] prep: qdev'ify Raven host bridge (PCIDevice) Andreas Färber
2012-01-19 23:35 ` [Qemu-devel] [PATCH 04/10] prep_pci: Simplify I/O endianness Andreas Färber
2012-01-19 23:35 ` Andreas Färber [this message]
2012-01-19 23:35 ` [Qemu-devel] [PATCH 06/10] prep: qdev'ify Raven host bridge (SysBus) Andreas Färber
2012-01-19 23:35 ` [Qemu-devel] [PATCH 07/10] MAINTAINERS: Add PCI host bridge files to PReP machine Andreas Färber
2012-01-19 23:35 ` [Qemu-devel] [PATCH 08/10] prep: Add i82374 DMA emulation Andreas Färber
2012-01-19 23:35 ` [Qemu-devel] [PATCH 09/10] prep: Add i82378 PCI-to-ISA bridge emulation Andreas Färber
2012-01-19 23:35 ` [Qemu-devel] [PATCH 10/10] prep: Use i82378 PCI->ISA bridge for 'prep' machine Andreas Färber
2012-01-23 17:44 ` [Qemu-devel] [PULL] PReP patch queue 2012-01-20 Anthony Liguori

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=1327016131-5344-6-git-send-email-andreas.faerber@web.de \
    --to=andreas.faerber@web.de \
    --cc=agraf@suse.de \
    --cc=aliguori@us.ibm.com \
    --cc=avi@redhat.com \
    --cc=benoit.canet@gmail.com \
    --cc=mst@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.org \
    --cc=rth@twiddle.net \
    /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).