From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:37200) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qw16y-0005EW-Jn for qemu-devel@nongnu.org; Tue, 23 Aug 2011 20:14:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Qw16x-00047b-BJ for qemu-devel@nongnu.org; Tue, 23 Aug 2011 20:14:28 -0400 Received: from mail-vw0-f45.google.com ([209.85.212.45]:40396) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qw16w-00045z-W5 for qemu-devel@nongnu.org; Tue, 23 Aug 2011 20:14:27 -0400 Received: by mail-vw0-f45.google.com with SMTP id 17so649441vws.4 for ; Tue, 23 Aug 2011 17:14:26 -0700 (PDT) Sender: Richard Henderson From: Richard Henderson Date: Tue, 23 Aug 2011 17:13:45 -0700 Message-Id: <1314144835-29098-7-git-send-email-rth@twiddle.net> In-Reply-To: <1314144835-29098-1-git-send-email-rth@twiddle.net> References: <1314144835-29098-1-git-send-email-rth@twiddle.net> Subject: [Qemu-devel] [PATCH 06/16] gus: Convert to isa_register_portio_list. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: avi@redhat.com Signed-off-by: Richard Henderson --- hw/gus.c | 39 +++++++++++++++++++-------------------- 1 files changed, 19 insertions(+), 20 deletions(-) diff --git a/hw/gus.c b/hw/gus.c index 37e543a..1532686 100644 --- a/hw/gus.c +++ b/hw/gus.c @@ -232,6 +232,22 @@ static const VMStateDescription vmstate_gus = { } }; +static const MemoryRegionPortio gus_portio_list1[] = { + {0x000, 1, 1, .write = gus_writeb }, + {0x000, 1, 2, .write = gus_writew }, + {0x006, 10, 1, .read = gus_readb, .write = gus_writeb }, + {0x006, 10, 2, .read = gus_readw, .write = gus_writew }, + {0x100, 8, 1, .read = gus_readb, .write = gus_writeb }, + {0x100, 8, 2, .read = gus_readw, .write = gus_writew }, + PORTIO_END_OF_LIST(), +}; + +static const MemoryRegionPortio gus_portio_list2[] = { + {0, 1, 1, .read = gus_readb }, + {0, 1, 2, .read = gus_readw }, + PORTIO_END_OF_LIST(), +}; + static int gus_initfn (ISADevice *dev) { GUSState *s = DO_UPCAST(GUSState, dev, dev); @@ -262,26 +278,9 @@ static int gus_initfn (ISADevice *dev) s->samples = AUD_get_buffer_size_out (s->voice) >> s->shift; s->mixbuf = g_malloc0 (s->samples << s->shift); - register_ioport_write (s->port, 1, 1, gus_writeb, s); - register_ioport_write (s->port, 1, 2, gus_writew, s); - isa_init_ioport_range(dev, s->port, 2); - - register_ioport_read ((s->port + 0x100) & 0xf00, 1, 1, gus_readb, s); - register_ioport_read ((s->port + 0x100) & 0xf00, 1, 2, gus_readw, s); - isa_init_ioport_range(dev, (s->port + 0x100) & 0xf00, 2); - - register_ioport_write (s->port + 6, 10, 1, gus_writeb, s); - register_ioport_write (s->port + 6, 10, 2, gus_writew, s); - register_ioport_read (s->port + 6, 10, 1, gus_readb, s); - register_ioport_read (s->port + 6, 10, 2, gus_readw, s); - isa_init_ioport_range(dev, s->port + 6, 10); - - - register_ioport_write (s->port + 0x100, 8, 1, gus_writeb, s); - register_ioport_write (s->port + 0x100, 8, 2, gus_writew, s); - register_ioport_read (s->port + 0x100, 8, 1, gus_readb, s); - register_ioport_read (s->port + 0x100, 8, 2, gus_readw, s); - isa_init_ioport_range(dev, s->port + 0x100, 8); + isa_register_portio_list(dev, s->port, gus_portio_list1, s, "gus"); + isa_register_portio_list(dev, (s->port + 0x100) & 0xf00, + gus_portio_list2, s, "gus"); DMA_register_channel (s->emu.gusdma, GUS_read_DMA, s); s->emu.himemaddr = s->himem; -- 1.7.4.4