From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:37824) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RDHLG-0005sE-Cf for qemu-devel@nongnu.org; Mon, 10 Oct 2011 11:00:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RDHL4-00029t-9H for qemu-devel@nongnu.org; Mon, 10 Oct 2011 11:00:34 -0400 Received: from mx1.redhat.com ([209.132.183.28]:12749) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RDHL3-000292-Mw for qemu-devel@nongnu.org; Mon, 10 Oct 2011 11:00:21 -0400 From: Avi Kivity Date: Mon, 10 Oct 2011 16:59:50 +0200 Message-Id: <1318258793-10576-22-git-send-email-avi@redhat.com> In-Reply-To: <1318258793-10576-1-git-send-email-avi@redhat.com> References: <1318258793-10576-1-git-send-email-avi@redhat.com> Subject: [Qemu-devel] [PATCH 21/24] pc: Convert port92 to isa_register_ioport List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori , qemu-devel@nongnu.org From: Richard Henderson Signed-off-by: Richard Henderson Signed-off-by: Avi Kivity --- hw/pc.c | 16 +++++++++++++--- 1 files changed, 13 insertions(+), 3 deletions(-) diff --git a/hw/pc.c b/hw/pc.c index 203627d..ded4758 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; } -- 1.7.6.3