qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Hervé Poussineau" <hpoussin@reactos.org>
To: qemu-devel@nongnu.org
Cc: "Andreas Färber" <andreas.faerber@web.de>,
	"Hervé Poussineau" <hpoussin@reactos.org>,
	"Gerd Hoffmann" <kraxel@redhat.com>
Subject: [Qemu-devel] [RFC 8/8] memory: remove old_portio-style callbacks support
Date: Sun, 23 Dec 2012 16:32:48 +0100	[thread overview]
Message-ID: <1356276769-7357-9-git-send-email-hpoussin@reactos.org> (raw)
In-Reply-To: <1356276769-7357-1-git-send-email-hpoussin@reactos.org>

Signed-off-by: Hervé Poussineau <hpoussin@reactos.org>
---
 memory.c |   44 --------------------------------------------
 memory.h |    4 ----
 2 files changed, 48 deletions(-)

diff --git a/memory.c b/memory.c
index 7419853..ea3bb8a 100644
--- a/memory.c
+++ b/memory.c
@@ -365,21 +365,6 @@ static void access_with_adjusted_size(hwaddr addr,
     }
 }
 
-static const MemoryRegionPortio *find_portio(MemoryRegion *mr, uint64_t offset,
-                                             unsigned width, bool write)
-{
-    const MemoryRegionPortio *mrp;
-
-    for (mrp = mr->ops->old_portio; mrp->size; ++mrp) {
-        if (offset >= mrp->offset && offset < mrp->offset + mrp->len
-            && width == mrp->size
-            && (write ? (bool)mrp->write : (bool)mrp->read)) {
-            return mrp;
-        }
-    }
-    return NULL;
-}
-
 static void memory_region_iorange_read(IORange *iorange,
                                        uint64_t offset,
                                        unsigned width,
@@ -390,21 +375,6 @@ static void memory_region_iorange_read(IORange *iorange,
     MemoryRegion *mr = mrio->mr;
 
     offset += mrio->offset;
-    if (mr->ops->old_portio) {
-        const MemoryRegionPortio *mrp = find_portio(mr, offset - mrio->offset,
-                                                    width, false);
-
-        *data = ((uint64_t)1 << (width * 8)) - 1;
-        if (mrp) {
-            *data = mrp->read(mr->opaque, offset);
-        } else if (width == 2) {
-            mrp = find_portio(mr, offset - mrio->offset, 1, false);
-            assert(mrp);
-            *data = mrp->read(mr->opaque, offset) |
-                    (mrp->read(mr->opaque, offset + 1) << 8);
-        }
-        return;
-    }
     *data = 0;
     access_with_adjusted_size(offset, data, width,
                               mr->ops->impl.min_access_size,
@@ -422,20 +392,6 @@ static void memory_region_iorange_write(IORange *iorange,
     MemoryRegion *mr = mrio->mr;
 
     offset += mrio->offset;
-    if (mr->ops->old_portio) {
-        const MemoryRegionPortio *mrp = find_portio(mr, offset - mrio->offset,
-                                                    width, true);
-
-        if (mrp) {
-            mrp->write(mr->opaque, offset, data);
-        } else if (width == 2) {
-            mrp = find_portio(mr, offset - mrio->offset, 1, true);
-            assert(mrp);
-            mrp->write(mr->opaque, offset, data & 0xff);
-            mrp->write(mr->opaque, offset + 1, data >> 8);
-        }
-        return;
-    }
     access_with_adjusted_size(offset, &data, width,
                               mr->ops->impl.min_access_size,
                               mr->ops->impl.max_access_size,
diff --git a/memory.h b/memory.h
index 9462bfd..bdde0d0 100644
--- a/memory.h
+++ b/memory.h
@@ -103,10 +103,6 @@ struct MemoryRegionOps {
          bool unaligned;
     } impl;
 
-    /* If .read and .write are not present, old_portio may be used for
-     * backwards compatibility with old portio registration
-     */
-    const MemoryRegionPortio *old_portio;
     /* If .read and .write are not present, old_mmio may be used for
      * backwards compatibility with old mmio registration
      */
-- 
1.7.10.4

  parent reply	other threads:[~2012-12-23 15:32 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-23 15:32 [Qemu-devel] [RFC 0/8] Remove old_portio usage Hervé Poussineau
2012-12-23 15:32 ` [Qemu-devel] [RFC 1/8] pc: disable bochs bios debug ports (do not apply!) Hervé Poussineau
2012-12-23 15:32 ` [Qemu-devel] [RFC 2/8] xen_platform: do not use old_portio-style callbacks Hervé Poussineau
2012-12-23 15:32 ` [Qemu-devel] [RFC 3/8] uhci: " Hervé Poussineau
2013-01-03 14:09   ` Gerd Hoffmann
2012-12-23 15:32 ` [Qemu-devel] [RFC 4/8] acpi-piix4: " Hervé Poussineau
2012-12-23 15:32 ` [Qemu-devel] [RFC 5/8] vga/qxl: do not use portio_list_init/portio_list_add Hervé Poussineau
2012-12-23 15:32 ` [Qemu-devel] [RFC 6/8] isa: use memory regions instead of portio_list_* functions Hervé Poussineau
2012-12-23 15:32 ` [Qemu-devel] [RFC 7/8] ioport: remove now useless " Hervé Poussineau
2012-12-23 15:32 ` Hervé Poussineau [this message]
2013-01-02 23:32 ` [Qemu-devel] [RFC 0/8] Remove old_portio usage Andreas Färber
2013-01-03 14:05   ` Gerd Hoffmann

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=1356276769-7357-9-git-send-email-hpoussin@reactos.org \
    --to=hpoussin@reactos.org \
    --cc=andreas.faerber@web.de \
    --cc=kraxel@redhat.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).