aboutsummaryrefslogtreecommitdiff
path: root/hw/pc.c
diff options
context:
space:
mode:
authorAnthony Liguori <aliguori@us.ibm.com>2011-10-14 10:44:52 -0500
committerAnthony Liguori <aliguori@us.ibm.com>2011-10-14 10:44:52 -0500
commit36f490b176afab3096e9c2877b365354f67e269d (patch)
treeb99964fa0e30e9a7931c4944cd1897f8f735aee3 /hw/pc.c
parentebffe2afceb1a17b5d134b5debf553955fe5ea1a (diff)
parent0d9595245393f6e59831447a06235a0a1b2cdfd4 (diff)
Merge remote-tracking branch 'qemu-kvm-tmp/memory/batch' into staging
Diffstat (limited to 'hw/pc.c')
-rw-r--r--hw/pc.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/hw/pc.c b/hw/pc.c
index 203627d46e..ded475805f 100644
--- a/hw/pc.c
+++ b/hw/pc.c
@@ -428,6 +428,7 @@ void pc_cmos_init(ram_addr_t ram_size, ram_addr_t above_4g_mem_size,
/* port 92 stuff: could be split off */
typedef struct Port92State {
ISADevice dev;
+ MemoryRegion io;
uint8_t outport;
qemu_irq *a20_out;
} Port92State;
@@ -479,13 +480,22 @@ static void port92_reset(DeviceState *d)
s->outport &= ~1;
}
+static const MemoryRegionPortio port92_portio[] = {
+ { 0, 1, 1, .read = port92_read, .write = port92_write },
+ PORTIO_END_OF_LIST(),
+};
+
+static const MemoryRegionOps port92_ops = {
+ .old_portio = port92_portio
+};
+
static int port92_initfn(ISADevice *dev)
{
Port92State *s = DO_UPCAST(Port92State, dev, dev);
- register_ioport_read(0x92, 1, 1, port92_read, s);
- register_ioport_write(0x92, 1, 1, port92_write, s);
- isa_init_ioport(dev, 0x92);
+ memory_region_init_io(&s->io, &port92_ops, s, "port92", 1);
+ isa_register_ioport(dev, &s->io, 0x92);
+
s->outport = 0;
return 0;
}