aboutsummaryrefslogtreecommitdiff
path: root/hw/vmport.c
diff options
context:
space:
mode:
authorRichard Henderson <rth@twiddle.net>2011-08-16 08:38:14 -0700
committerAvi Kivity <avi@redhat.com>2011-10-11 15:57:11 +0200
commitf75317b420ed8eba70937b398086a0a3e7a2a4a2 (patch)
tree00cbb3b0bee36baf0fd981a680de5b83adab941d /hw/vmport.c
parent23af670e5350e3c022a5217c7d8c73de3f37abe8 (diff)
vmport: Convert to isa_register_ioport
Signed-off-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'hw/vmport.c')
-rw-r--r--hw/vmport.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/hw/vmport.c b/hw/vmport.c
index c8aefaabb8..b5c6fa19cd 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);