qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Andreas Färber" <afaerber@suse.de>
To: qemu-devel@nongnu.org
Cc: "Julien Grall" <julien.grall@citrix.com>,
	"Andreas Färber" <afaerber@suse.de>
Subject: [Qemu-devel] [PATCH 4/6] serial: Replace register_ioport_*
Date: Tue,  4 Dec 2012 17:48:14 +0100	[thread overview]
Message-ID: <1354639696-22168-5-git-send-email-afaerber@suse.de> (raw)
In-Reply-To: <1354639696-22168-1-git-send-email-afaerber@suse.de>

From: Julien Grall <julien.grall@citrix.com>

Replace all register_ioport_*() with a MemoryRegion.
This permits to use the new Memory stuff like listeners.

For more flexibility, the IO address space is passed as an argument.

Signed-off-by: Julien Grall <julien.grall@citrix.com>
Acked-by: Avi Kivity <avi@redhat.com>
[AF: Rebased onto serial split]
Signed-off-by: Andreas Färber <afaerber@suse.de>
---
 hw/mips_mipssim.c |    3 ++-
 hw/serial.c       |    4 ++--
 hw/serial.h       |    2 +-
 3 Dateien geändert, 5 Zeilen hinzugefügt(+), 4 Zeilen entfernt(-)

diff --git a/hw/mips_mipssim.c b/hw/mips_mipssim.c
index a95a3c1..20b5f1a 100644
--- a/hw/mips_mipssim.c
+++ b/hw/mips_mipssim.c
@@ -217,7 +217,8 @@ mips_mipssim_init(QEMUMachineInitArgs *args)
     /* A single 16450 sits at offset 0x3f8. It is attached to
        MIPS CPU INT2, which is interrupt 4. */
     if (serial_hds[0])
-        serial_init(0x3f8, env->irq[4], 115200, serial_hds[0]);
+        serial_init(0x3f8, env->irq[4], 115200, serial_hds[0],
+                    get_system_io());
 
     if (nd_table[0].used)
         /* MIPSnet uses the MIPS CPU INT0, which is interrupt 2. */
diff --git a/hw/serial.c b/hw/serial.c
index 60283ea..07a2a11 100644
--- a/hw/serial.c
+++ b/hw/serial.c
@@ -718,7 +718,7 @@ const MemoryRegionOps serial_io_ops = {
 };
 
 SerialState *serial_init(int base, qemu_irq irq, int baudbase,
-                         CharDriverState *chr)
+                         CharDriverState *chr, MemoryRegion *system_io)
 {
     SerialState *s;
 
@@ -732,7 +732,7 @@ SerialState *serial_init(int base, qemu_irq irq, int baudbase,
     vmstate_register(NULL, base, &vmstate_serial, s);
 
     memory_region_init_io(&s->io, &serial_io_ops, s, "serial", 8);
-    memory_region_add_subregion(get_system_io(), base, &s->io);
+    memory_region_add_subregion(system_io, base, &s->io);
 
     return s;
 }
diff --git a/hw/serial.h b/hw/serial.h
index f1e3c4a..ed1a5cd 100644
--- a/hw/serial.h
+++ b/hw/serial.h
@@ -89,7 +89,7 @@ void serial_set_frequency(SerialState *s, uint32_t frequency);
 
 /* legacy pre qom */
 SerialState *serial_init(int base, qemu_irq irq, int baudbase,
-                         CharDriverState *chr);
+                         CharDriverState *chr, MemoryRegion *system_io);
 SerialState *serial_mm_init(MemoryRegion *address_space,
                             hwaddr base, int it_shift,
                             qemu_irq irq, int baudbase,
-- 
1.7.10.4

  parent reply	other threads:[~2012-12-04 16:48 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-04 16:48 [Qemu-devel] [PULL] Memory API ioport cleanups Andreas Färber
2012-12-04 16:48 ` [Qemu-devel] [PATCH 1/6] isa: Add isa_address_space_io() Andreas Färber
2012-12-04 16:48 ` [Qemu-devel] [PATCH 2/6] hw/apm.c: Replace register_ioport_* Andreas Färber
2012-12-04 16:48 ` [Qemu-devel] [PATCH 3/6] hw/cirrus_vga.c: " Andreas Färber
2012-12-04 16:48 ` Andreas Färber [this message]
2012-12-04 16:48 ` [Qemu-devel] [PATCH 5/6] hw/pc.c: " Andreas Färber
2012-12-04 16:48 ` [Qemu-devel] [PATCH 6/6] hw/dma.c: " Andreas Färber
2012-12-08 17:54 ` [Qemu-devel] [PULL] Memory API ioport cleanups Blue Swirl
2012-12-10 16:48 ` 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=1354639696-22168-5-git-send-email-afaerber@suse.de \
    --to=afaerber@suse.de \
    --cc=julien.grall@citrix.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).