qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Hervé Poussineau" <hpoussin@reactos.org>
To: qemu-devel@nongnu.org
Cc: "Paolo Bonzini" <pbonzini@redhat.com>,
	"Hervé Poussineau" <hpoussin@reactos.org>
Subject: [Qemu-devel] [PATCH v2 2/8] memory: handle old_portio accesses in MMIO path
Date: Sun,  9 Jun 2013 01:44:00 +0800	[thread overview]
Message-ID: <1370713446-9460-3-git-send-email-hpoussin@reactos.org> (raw)
In-Reply-To: <1370713446-9460-1-git-send-email-hpoussin@reactos.org>

This patch is only temporary, and will be removed soon.

Signed-off-by: Hervé Poussineau <hpoussin@reactos.org>
---
 memory.c |   16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/memory.c b/memory.c
index 5cb8f4a..f27167c 100644
--- a/memory.c
+++ b/memory.c
@@ -933,6 +933,14 @@ static uint64_t memory_region_dispatch_read1(MemoryRegion *mr,
                                   mr->ops->impl.min_access_size,
                                   mr->ops->impl.max_access_size,
                                   memory_region_read_accessor, mr);
+    } else if (mr->ops->old_portio) {
+        MemoryRegionIORange mrio;
+        MemoryRegionSection mrs = memory_region_find(get_system_io(), addr,
+                                                     size);
+        mrio.mr = mr;
+        mrio.offset = mrs.offset_within_region;
+        memory_region_iorange_read(&mrio.iorange, addr - mrio.offset, size,
+                                   &data);
     } else {
         access_with_adjusted_size(addr, &data, size, 1, 4,
                                   memory_region_oldmmio_read_accessor, mr);
@@ -994,6 +1002,14 @@ static bool memory_region_dispatch_write(MemoryRegion *mr,
                                   mr->ops->impl.min_access_size,
                                   mr->ops->impl.max_access_size,
                                   memory_region_write_accessor, mr);
+    } else if (mr->ops->old_portio) {
+        MemoryRegionIORange mrio;
+        MemoryRegionSection mrs = memory_region_find(get_system_io(), addr,
+                                                     size);
+        mrio.mr = mr;
+        mrio.offset = mrs.offset_within_region;
+        memory_region_iorange_write(&mrio.iorange, addr - mrio.offset, size,
+                                    data);
     } else {
         access_with_adjusted_size(addr, &data, size, 1, 4,
                                   memory_region_oldmmio_write_accessor, mr);
-- 
1.7.10.4

  parent reply	other threads:[~2013-06-08 17:43 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-08 17:43 [Qemu-devel] [PATCH v2 0/8] memory: remove old_portio usage Hervé Poussineau
2013-06-08 17:43 ` [Qemu-devel] [PATCH v2 1/8] isa: fix documentation of isa_register_portio_list Hervé Poussineau
2013-06-08 17:44 ` Hervé Poussineau [this message]
2013-06-08 17:44 ` [Qemu-devel] [PATCH v2 3/8] ioport: register memory regions for I/O port lists Hervé Poussineau
2013-06-08 17:44 ` [Qemu-devel] [PATCH v2 4/8] memory: remove code dealing with old_portio Hervé Poussineau
2013-06-08 17:44 ` [Qemu-devel] [PATCH v2 5/8] ioport: reimplement cpu_in/cpu_out using address_space_rw Hervé Poussineau
2013-06-08 17:44 ` [Qemu-devel] [PATCH v2 6/8] ppc: simplify access to PReP I/O region Hervé Poussineau
2013-06-08 17:44 ` [Qemu-devel] [PATCH v2 7/8] PPC: pseries: Remove hack for PIO window Hervé Poussineau
2013-06-08 17:44 ` [Qemu-devel] [PATCH v2 8/8] isa_mmio: simplify access to system I/O region Hervé Poussineau
2013-06-16 18:20 ` [Qemu-devel] [PATCH v2 0/8] memory: remove old_portio usage Hervé Poussineau
2013-06-17  7:32   ` Paolo Bonzini
2013-06-17  7:43     ` Jan Kiszka
2013-06-17 20:39       ` Hervé Poussineau
2013-06-18 14:38         ` Jan Kiszka
2013-06-18 18:09           ` Hervé Poussineau
2013-06-21 18:11             ` Jan Kiszka

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=1370713446-9460-3-git-send-email-hpoussin@reactos.org \
    --to=hpoussin@reactos.org \
    --cc=pbonzini@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).