From patchwork Sat Jun 22 06:06:54 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kiszka X-Patchwork-Id: 253347 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 139822C03FE for ; Sat, 22 Jun 2013 16:11:15 +1000 (EST) Received: from localhost ([::1]:43551 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UqH2W-0004Zg-Ou for incoming@patchwork.ozlabs.org; Sat, 22 Jun 2013 02:11:12 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44266) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UqGzj-0000RH-Mh for qemu-devel@nongnu.org; Sat, 22 Jun 2013 02:08:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UqGzi-00053T-Ga for qemu-devel@nongnu.org; Sat, 22 Jun 2013 02:08:19 -0400 Received: from mout.web.de ([212.227.15.3]:61387) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UqGzi-00052k-4g for qemu-devel@nongnu.org; Sat, 22 Jun 2013 02:08:18 -0400 Received: from localhost.localdomain ([95.157.58.223]) by smtp.web.de (mrweb101) with ESMTPSA (Nemesis) id 0MEVYz-1V5KsV3ZW5-00Fi5m; Sat, 22 Jun 2013 08:07:16 +0200 From: Jan Kiszka To: qemu-devel Date: Sat, 22 Jun 2013 08:06:54 +0200 Message-Id: <84dcbc17863ee349dee21fca3428238ca4e61061.1371881222.git.jan.kiszka@web.de> X-Mailer: git-send-email 1.7.3.4 In-Reply-To: References: In-Reply-To: References: X-Provags-ID: V03:K0:Lmx1eAxMwFucjDnz3wTjP5iai8tDAte9GCTQoZOXW6QscCrIfxQ q+L6i2Ew5rPXlbzKm+4+XX40SkWLz+l8IZFsGl6UbzcDfQl4NRZ6cbEmGN72aUwrEk/8BAX 130UyT8Ppj75RziRptusI0q3gkdueCxPEBpj1KzQ3rnXLZwr3AHauc+Ib2gAiZAFNJAwbA2 RDXNGJezdQxrmCcjOGnHQ== X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] X-Received-From: 212.227.15.3 Cc: Liu Ping Fan , Jan Kiszka , malc , Paolo Bonzini , =?UTF-8?q?Andreas=20F=C3=A4rber?= , =?UTF-8?q?Herv=C3=A9=20Poussineau?= Subject: [Qemu-devel] [PATCH v3 01/14] adlib: replace register_ioport* 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 From: Jan Kiszka Convert over to memory regions to obsolete register_ioport*. CC: malc Signed-off-by: Jan Kiszka --- hw/audio/adlib.c | 20 ++++++++++++-------- 1 files changed, 12 insertions(+), 8 deletions(-) diff --git a/hw/audio/adlib.c b/hw/audio/adlib.c index 6a7d377..8b9b81e 100644 --- a/hw/audio/adlib.c +++ b/hw/audio/adlib.c @@ -283,9 +283,17 @@ static void Adlib_fini (AdlibState *s) AUD_remove_card (&s->card); } +static MemoryRegionPortio adlib_portio_list[] = { + { 0x388, 4, 1, .read = adlib_read, .write = adlib_write, }, + { 0, 4, 1, .read = adlib_read, .write = adlib_write, }, + { 0, 2, 1, .read = adlib_read, .write = adlib_write, }, + PORTIO_END_OF_LIST(), +}; + static void adlib_realizefn (DeviceState *dev, Error **errp) { AdlibState *s = ADLIB(dev); + PortioList *port_list = g_new(PortioList, 1); struct audsettings as; if (glob_adlib) { @@ -339,14 +347,10 @@ static void adlib_realizefn (DeviceState *dev, Error **errp) s->samples = AUD_get_buffer_size_out (s->voice) >> SHIFT; s->mixbuf = g_malloc0 (s->samples << SHIFT); - register_ioport_read (0x388, 4, 1, adlib_read, s); - register_ioport_write (0x388, 4, 1, adlib_write, s); - - register_ioport_read (s->port, 4, 1, adlib_read, s); - register_ioport_write (s->port, 4, 1, adlib_write, s); - - register_ioport_read (s->port + 8, 2, 1, adlib_read, s); - register_ioport_write (s->port + 8, 2, 1, adlib_write, s); + adlib_portio_list[1].offset = s->port; + adlib_portio_list[2].offset = s->port + 8; + portio_list_init (port_list, adlib_portio_list, s, "adlib"); + portio_list_add (port_list, isa_address_space_io(&s->parent_obj), 0); } static Property adlib_properties[] = {