From patchwork Tue Aug 16 16:45:35 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 110201 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [140.186.70.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id A0399B6F80 for ; Wed, 17 Aug 2011 03:09:19 +1000 (EST) Received: from localhost ([::1]:44079 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QtMov-0006NE-Ei for incoming@patchwork.ozlabs.org; Tue, 16 Aug 2011 12:48:53 -0400 Received: from eggs.gnu.org ([140.186.70.92]:49933) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QtMoA-00044X-99 for qemu-devel@nongnu.org; Tue, 16 Aug 2011 12:48:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QtMo8-00026U-7J for qemu-devel@nongnu.org; Tue, 16 Aug 2011 12:48:06 -0400 Received: from mail-qy0-f180.google.com ([209.85.216.180]:56604) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QtMo8-00026E-52 for qemu-devel@nongnu.org; Tue, 16 Aug 2011 12:48:04 -0400 Received: by qyk31 with SMTP id 31so65816qyk.4 for ; Tue, 16 Aug 2011 09:48:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=sender:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references; bh=Pe8Ohc6rYub1m1JWxhiaJyNj034Tj8knZNa/zMbukGI=; b=C0Gt3cCfPCEmNm0gXekEKY0Cqbe8GPNR/F5PiVE8SJKEx+MbE97zvPqJ+qoZD7npju TIHyg/N7FzYzvftkT84QIPOwzGy6RgzPFH00Vd00ODSFLBaKdhH9mdPoKpPBzMw8GyzD QqMfjNJJguWDf9K6kWfqE9xIwhWr21sENofI0= Received: by 10.52.110.8 with SMTP id hw8mr5162802vdb.66.1313513283395; Tue, 16 Aug 2011 09:48:03 -0700 (PDT) Received: from localhost.localdomain (c-71-227-161-214.hsd1.wa.comcast.net [71.227.161.214]) by mx.google.com with ESMTPS id gw3sm246636vdb.44.2011.08.16.09.48.02 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 16 Aug 2011 09:48:03 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Tue, 16 Aug 2011 09:45:35 -0700 Message-Id: <1313513145-5348-5-git-send-email-rth@twiddle.net> X-Mailer: git-send-email 1.7.6 In-Reply-To: <1313513145-5348-1-git-send-email-rth@twiddle.net> References: <1313513145-5348-1-git-send-email-rth@twiddle.net> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 209.85.216.180 Cc: avi@redhat.com Subject: [Qemu-devel] [PATCH 04/14] gus: Convert to isa_register_old_portio_list. X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Signed-off-by: Richard Henderson Cc: malc --- hw/gus.c | 43 +++++++++++++++++++++++-------------------- 1 files changed, 23 insertions(+), 20 deletions(-) diff --git a/hw/gus.c b/hw/gus.c index ff9e7c7..9531d5f 100644 --- a/hw/gus.c +++ b/hw/gus.c @@ -232,6 +232,26 @@ static const VMStateDescription vmstate_gus = { } }; +static const MemoryRegionPortio gus_portio_list1[] = { + {0x000, 1, 1, .write = gus_writeb }, + {0x000, 1, 2, .write = gus_writew }, + PORTIO_END_OF_LIST(), + {0x006, 10, 1, .read = gus_readb, .write = gus_writeb }, + {0x006, 10, 2, .read = gus_readw, .write = gus_writew }, + PORTIO_END_OF_LIST(), + {0x100, 8, 1, .read = gus_readb, .write = gus_writeb }, + {0x100, 8, 2, .read = gus_readw, .write = gus_writew }, + PORTIO_END_OF_LIST(), + 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(), + PORTIO_END_OF_LIST(), +}; + static int gus_initfn (ISADevice *dev) { GUSState *s = DO_UPCAST(GUSState, dev, dev); @@ -262,26 +282,9 @@ static int gus_initfn (ISADevice *dev) s->samples = AUD_get_buffer_size_out (s->voice) >> s->shift; s->mixbuf = qemu_mallocz (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_old_portio_list(dev, s->port, gus_portio_list1, s, "gus"); + isa_register_old_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;