From: Avi Kivity <avi@redhat.com>
To: Anthony Liguori <anthony@codemonkey.ws>, qemu-devel@nongnu.org
Subject: [Qemu-devel] [PATCH 22/24] vmport: Convert to isa_register_ioport
Date: Mon, 10 Oct 2011 16:59:51 +0200 [thread overview]
Message-ID: <1318258793-10576-23-git-send-email-avi@redhat.com> (raw)
In-Reply-To: <1318258793-10576-1-git-send-email-avi@redhat.com>
From: Richard Henderson <rth@twiddle.net>
Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Avi Kivity <avi@redhat.com>
---
hw/vmport.c | 16 +++++++++++++---
1 files changed, 13 insertions(+), 3 deletions(-)
diff --git a/hw/vmport.c b/hw/vmport.c
index c8aefaa..b5c6fa1 100644
--- a/hw/vmport.c
+++ b/hw/vmport.c
@@ -38,6 +38,7 @@
typedef struct _VMPortState
{
ISADevice dev;
+ MemoryRegion io;
IOPortReadFunc *func[VMPORT_ENTRIES];
void *opaque[VMPORT_ENTRIES];
} VMPortState;
@@ -120,13 +121,22 @@ void vmmouse_set_data(const uint32_t *data)
env->regs[R_ESI] = data[4]; env->regs[R_EDI] = data[5];
}
+static const MemoryRegionPortio vmport_portio[] = {
+ {0, 1, 4, .read = vmport_ioport_read, .write = vmport_ioport_write },
+ PORTIO_END_OF_LIST(),
+};
+
+static const MemoryRegionOps vmport_ops = {
+ .old_portio = vmport_portio
+};
+
static int vmport_initfn(ISADevice *dev)
{
VMPortState *s = DO_UPCAST(VMPortState, dev, dev);
- register_ioport_read(0x5658, 1, 4, vmport_ioport_read, s);
- register_ioport_write(0x5658, 1, 4, vmport_ioport_write, s);
- isa_init_ioport(dev, 0x5658);
+ memory_region_init_io(&s->io, &vmport_ops, s, "vmport", 1);
+ isa_register_ioport(dev, &s->io, 0x5658);
+
port_state = s;
/* Register some generic port commands */
vmport_register(VMPORT_CMD_GETVERSION, vmport_cmd_get_version, NULL);
--
1.7.6.3
next prev parent reply other threads:[~2011-10-10 15:00 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-10-10 14:59 [Qemu-devel] [PULL 00/24] Memory API, batch 11 Avi Kivity
2011-10-10 14:59 ` [Qemu-devel] [PATCH 01/24] hw/lan9118.c: Convert to MemoryRegion Avi Kivity
2011-10-10 14:59 ` [Qemu-devel] [PATCH 02/24] palm: convert to memory API Avi Kivity
2011-10-10 14:59 ` [Qemu-devel] [PATCH 03/24] petalogix_ml605: " Avi Kivity
2011-10-10 14:59 ` [Qemu-devel] [PATCH 04/24] petalogix_s2adsp1800: " Avi Kivity
2011-10-10 14:59 ` [Qemu-devel] [PATCH 05/24] ppc405_boards: " Avi Kivity
2011-10-10 14:59 ` [Qemu-devel] [PATCH 06/24] hw/arm11mpcore: Clean up to avoid using sysbus_mmio_init_cb2 Avi Kivity
2011-10-10 14:59 ` [Qemu-devel] [PATCH 07/24] hw/versatile_pci: Expose multiple sysbus mmio regions Avi Kivity
2011-10-10 14:59 ` [Qemu-devel] [PATCH 08/24] ppc_newworld: convert to memory API Avi Kivity
2011-10-10 14:59 ` [Qemu-devel] [PATCH 09/24] isa: Tidy support code for isabus_get_fw_dev_path Avi Kivity
2011-10-10 14:59 ` [Qemu-devel] [PATCH 10/24] Introduce PortioList Avi Kivity
2011-10-10 14:59 ` [Qemu-devel] [PATCH 11/24] memory: Fix old portio word accesses Avi Kivity
2011-10-10 14:59 ` [Qemu-devel] [PATCH 12/24] isa: Add isa_register_portio_list() Avi Kivity
2011-10-10 14:59 ` [Qemu-devel] [PATCH 13/24] fdc: Convert to isa_register_portio_list Avi Kivity
2011-10-10 14:59 ` [Qemu-devel] [PATCH 14/24] gus: " Avi Kivity
2011-10-10 14:59 ` [Qemu-devel] [PATCH 15/24] m48t59: Convert to isa_register_ioport Avi Kivity
2011-10-10 14:59 ` [Qemu-devel] [PATCH 16/24] rtc: " Avi Kivity
2011-10-10 14:59 ` [Qemu-devel] [PATCH 17/24] ne2000: " Avi Kivity
2011-10-10 14:59 ` [Qemu-devel] [PATCH 18/24] parallel: Convert to isa_register_portio_list Avi Kivity
2011-10-10 14:59 ` [Qemu-devel] [PATCH 19/24] sb16: " Avi Kivity
2011-10-10 14:59 ` [Qemu-devel] [PATCH 20/24] vga: " Avi Kivity
2011-10-10 14:59 ` [Qemu-devel] [PATCH 21/24] pc: Convert port92 to isa_register_ioport Avi Kivity
2011-10-10 14:59 ` Avi Kivity [this message]
2011-10-10 14:59 ` [Qemu-devel] [PATCH 23/24] ide: Convert to isa_register_portio_list Avi Kivity
2011-10-10 14:59 ` [Qemu-devel] [PATCH 24/24] isa: Remove isa_init_ioport_range and isa_init_ioport Avi Kivity
2011-10-11 13:25 ` [Qemu-devel] [PULL 00/24] Memory API, batch 11 Anthony Liguori
2011-10-11 13:51 ` Avi Kivity
2011-10-11 13:58 ` Avi Kivity
2011-10-14 16:25 ` 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=1318258793-10576-23-git-send-email-avi@redhat.com \
--to=avi@redhat.com \
--cc=anthony@codemonkey.ws \
--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).