From nobody Sun May 5 08:09:25 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1522078853853530.0619916331035; Mon, 26 Mar 2018 08:40:53 -0700 (PDT) Received: from localhost ([::1]:57449 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f0UEu-000866-CI for importer@patchew.org; Mon, 26 Mar 2018 11:40:52 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34469) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f0U9B-00038r-Kz for qemu-devel@nongnu.org; Mon, 26 Mar 2018 11:34:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f0U9A-0000Ei-EN for qemu-devel@nongnu.org; Mon, 26 Mar 2018 11:34:57 -0400 Received: from mail-qt0-x241.google.com ([2607:f8b0:400d:c0d::241]:33130) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1f0U9A-0000Ea-9n; Mon, 26 Mar 2018 11:34:56 -0400 Received: by mail-qt0-x241.google.com with SMTP id i8so20000900qtj.0; Mon, 26 Mar 2018 08:34:56 -0700 (PDT) Received: from x1.local ([138.117.48.212]) by smtp.gmail.com with ESMTPSA id i188sm2017502qkc.16.2018.03.26.08.34.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 26 Mar 2018 08:34:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=DEvy8UUq9rGI1F20fmnafnS1ThSwk/OpJshVsVRZHNA=; b=JCFUecikge4B/80KR16vaBCclPBcsCopPcW7WycHC7R8eFpcJ56sb3c+Q/xWCGesC5 sIMXpCVs72X4nCiZxlydzEwaXsrInRqhYyx2S9iaSnAXnDkRfhHFx0kcmrCSDmbZGHwL QSvAsq0ACHRQb5L44IhXXkz7gw/rtbruVsWsRHQjPB0ItyaRcDZR5zgfe8ITJ4m0KNGi IHnnnEeGjrRWfJ1EAnjIP9BS+IF3GHtiurc3IWjMV61G1jsJixEzaxhmsVY7teZ/dmWb qwzMYJNLXQXsWNVVxlL7J0uA9EKMrPpkiSb851W+CwZ0yifDvrip6WhVSmhdvwply+Ky /jhg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=DEvy8UUq9rGI1F20fmnafnS1ThSwk/OpJshVsVRZHNA=; b=P930iLNVGjy7EDqW2sqS5wYw3umkYx/ykHriRvD6MxKxAxSVLXWd4j0O6t8bYRZ01U lAYt7pf8dkNPy6AZPLHYhswdi6qD/LDnVhyyHRUO5M53cftILve28c8RKi8Bfxwv1UbR QiI0SOCzJMLedQ8hFhOIUgjKOv7eu4YvCjiwQI82m/zuxiSXOo0WbI//f0k8E6m8R/rz sjSyKgEXt7x8mfeXOg2pcjzmZkgb0lSuLioqtF9+dIebAtzj59cZ9BiU7IWUxy9gQi9Q FaU62OmDBkFWZZA8Bz6wa9vNJvIkmRKFQhiB7kdDPnFYxmzWI7pENcNQztr5NpJnkmLt ZwzQ== X-Gm-Message-State: AElRT7HTqHpknUpJ5XV55ZXP48rZr7ltpKlmSAfwFCnkOhYduEKcPvFJ HXcJ3JqGoiSJJ+B4dzK3Izo= X-Google-Smtp-Source: AG47ELvJu116I/g2g3fwjMRT8vtR0J1yvCQkNCsg+NqbrGVhs0LNjS3ICDDbdtXtbjiyfPRfHnJiRQ== X-Received: by 10.200.46.51 with SMTP id r48mr57901372qta.8.1522078495711; Mon, 26 Mar 2018 08:34:55 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: Eduardo Otubo , Thomas Huth , Paolo Bonzini Date: Mon, 26 Mar 2018 12:34:37 -0300 Message-Id: <20180326153441.32641-2-f4bug@amsat.org> X-Mailer: git-send-email 2.16.3 In-Reply-To: <20180326153441.32641-1-f4bug@amsat.org> References: <20180326153441.32641-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c0d::241 Subject: [Qemu-devel] [PATCH for-2.12 1/5] hw/dma/i82374: Avoid double creation of the 82374 controller X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "open list:PReP" , Eduardo Habkost , qemu-devel@nongnu.org, Michael Tokarev , Alexander Graf , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Nageswara Sastry , =?UTF-8?q?Herv=C3=A9=20Poussineau?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 QEMU fails when used with the following command line: ./ppc64-softmmu/qemu-system-ppc64 -S -machine 40p -device i82374 qemu-system-ppc64: hw/isa/isa-bus.c:110: isa_bus_dma: Assertion `!bus->= dma[0] && !bus->dma[1]' failed. The 40p machine type already creates the device i82374. If specified in the command line, it will try to create it again, hence generating the error. T= he function isa_bus_dma() isn't supposed to be called twice for the same bus. Check the bus doesn't already have a DMA controller registered before creat= ing the device. Fixes: https://bugs.launchpad.net/qemu/+bug/1721224 Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Eduardo Otubo Reviewed-by: Thomas Huth Tested-by: Thomas Huth --- hw/dma/i82374.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/hw/dma/i82374.c b/hw/dma/i82374.c index 83c87d92e0..892f655a7e 100644 --- a/hw/dma/i82374.c +++ b/hw/dma/i82374.c @@ -23,6 +23,7 @@ */ =20 #include "qemu/osdep.h" +#include "qapi/error.h" #include "hw/isa/isa.h" #include "hw/dma/i8257.h" =20 @@ -118,13 +119,19 @@ static const MemoryRegionPortio i82374_portio_list[] = =3D { static void i82374_realize(DeviceState *dev, Error **errp) { I82374State *s =3D I82374(dev); + ISABus *isa_bus =3D isa_bus_from_device(ISA_DEVICE(dev)); + + if (isa_get_dma(isa_bus, 0)) { + error_setg(errp, "DMA already initialized on ISA bus"); + return; + } + i8257_dma_init(isa_bus, true); =20 portio_list_init(&s->port_list, OBJECT(s), i82374_portio_list, s, "i82374"); portio_list_add(&s->port_list, isa_address_space_io(&s->parent_obj), s->iobase); =20 - i8257_dma_init(isa_bus_from_device(ISA_DEVICE(dev)), true); memset(s->commands, 0, sizeof(s->commands)); } =20 --=20 2.16.3 From nobody Sun May 5 08:09:25 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1522079730276495.9034201142699; Mon, 26 Mar 2018 08:55:30 -0700 (PDT) Received: from localhost ([::1]:57556 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f0UT3-0004W8-EU for importer@patchew.org; Mon, 26 Mar 2018 11:55:29 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34506) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f0U9E-0003CJ-UX for qemu-devel@nongnu.org; Mon, 26 Mar 2018 11:35:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f0U9E-0000GX-5v for qemu-devel@nongnu.org; Mon, 26 Mar 2018 11:35:00 -0400 Received: from mail-qk0-x244.google.com ([2607:f8b0:400d:c09::244]:39515) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1f0U9E-0000GH-0y for qemu-devel@nongnu.org; Mon, 26 Mar 2018 11:35:00 -0400 Received: by mail-qk0-x244.google.com with SMTP id j73so20514459qke.6 for ; Mon, 26 Mar 2018 08:34:59 -0700 (PDT) Received: from x1.local ([138.117.48.212]) by smtp.gmail.com with ESMTPSA id i188sm2017502qkc.16.2018.03.26.08.34.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 26 Mar 2018 08:34:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=rgo2P27rff/WyNy4lziBbVemdiPbIB0X80dkAmGHaq0=; b=XTQeirro8s71FFnegUWFA4mxY0sZFk39CMMzEXMDaL1Xtv0LtaX/xSCwsNMQlVGpuG E8yWk1jLTbKuH4al3dqKblNAsmP8dN0GvdQ/njA/UU3Bx+cS6c50H0v+0kjy/xR736ud HQao9bL+ENkMApjh1udy4c0TTk6nYo73bBk4ycOpqb7xpx//aurFtujMLDHZMUXrxOM5 6A7QimtXAdfgpKDTYZ1B5BkbnuzNhBcyXSlnOuPDQXg6w0RVu4yP04TRoX6HmHFjKH/G RHaESkXBjYHacvvE3H1uhcghOQt1XVLesYNNkhip3RfiNPA9g5w3FgyScA9wqCZ/gymA htGg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=rgo2P27rff/WyNy4lziBbVemdiPbIB0X80dkAmGHaq0=; b=AUD8/xpKpWBiDnUPUGUj/QDAQeytwtQficokGy226i3lGCdNNpprtXESyRiENaqYEn /t8pVdNdh2KvL2IdhFKTrnjSM/f7CraWK3bFD5kXploBxfMAL2wUbJ9ne2IKN61KVShD D6Cdt37egiwHA4vWGrxt/LlvXfYx3fMTGJUwjYytmNhQk45iqlMhQH7dJbC81ZzdmpWZ UYA4I41YoCCMlmOQARMloOMgYjldEexyyYt5nozLB3TjbbmX4Wpvsp1RSBjBVU3PHEKz U+db1O2Xv24rjWsw+Yba1tromfx4dmkhggUfYEVVP53y86Ctb4167WZCykM/bAkQ31RL FSwA== X-Gm-Message-State: AElRT7EcnYr3ETQp0ypvZccQGLk2qRKx8NL4136O+oo/Z8lPQGyjHqL8 9tjHSssZlEOKVHQQGJ9CGNc= X-Google-Smtp-Source: AG47ELu0laB/LdJaoKVtbxxHAxh41sAXrQFD7BAQYsAaL9FSvMCJ15ZH930jP00Hnp/O63LHtfoP9g== X-Received: by 10.55.20.22 with SMTP id e22mr55484657qkh.12.1522078499504; Mon, 26 Mar 2018 08:34:59 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: Eduardo Otubo , Thomas Huth , Paolo Bonzini Date: Mon, 26 Mar 2018 12:34:38 -0300 Message-Id: <20180326153441.32641-3-f4bug@amsat.org> X-Mailer: git-send-email 2.16.3 In-Reply-To: <20180326153441.32641-1-f4bug@amsat.org> References: <20180326153441.32641-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c09::244 Subject: [Qemu-devel] [PATCH for-2.13 2/5] hw/dma/i8257: Define I8257_CHANNEL_COUNT X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Eduardo Habkost , "Michael S. Tsirkin" , qemu-devel@nongnu.org, Michael Tokarev , Alexander Graf , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Nageswara Sastry , =?UTF-8?q?Herv=C3=A9=20Poussineau?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 The 8257 has 4 DMA channels, reflect that to denote than when 8 channels are used, this is not a single 8257 (but probably two cascaded). Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Eduardo Otubo --- include/hw/dma/i8257.h | 4 +++- hw/dma/i8257.c | 6 +++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/include/hw/dma/i8257.h b/include/hw/dma/i8257.h index 2cab50bb6c..3053f18797 100644 --- a/include/hw/dma/i8257.h +++ b/include/hw/dma/i8257.h @@ -7,6 +7,8 @@ =20 #define TYPE_I8257 "i8257" =20 +#define I8257_CHANNEL_COUNT 4 + typedef struct I8257Regs { int now[2]; uint16_t base[2]; @@ -33,7 +35,7 @@ typedef struct I8257State { uint8_t command; uint8_t mask; uint8_t flip_flop; - I8257Regs regs[4]; + I8257Regs regs[I8257_CHANNEL_COUNT]; MemoryRegion channel_io; MemoryRegion cont_io; =20 diff --git a/hw/dma/i8257.c b/hw/dma/i8257.c index 52675e97c9..df030f934c 100644 --- a/hw/dma/i8257.c +++ b/hw/dma/i8257.c @@ -361,7 +361,7 @@ static void i8257_dma_run(void *opaque) d->running =3D 1; } =20 - for (ichan =3D 0; ichan < 4; ichan++) { + for (ichan =3D 0; ichan < I8257_CHANNEL_COUNT; ichan++) { int mask; =20 mask =3D 1 << ichan; @@ -536,8 +536,8 @@ static const VMStateDescription vmstate_i8257 =3D { VMSTATE_UINT8(mask, I8257State), VMSTATE_UINT8(flip_flop, I8257State), VMSTATE_INT32(dshift, I8257State), - VMSTATE_STRUCT_ARRAY(regs, I8257State, 4, 1, vmstate_i8257_regs, - I8257Regs), + VMSTATE_STRUCT_ARRAY(regs, I8257State, I8257_CHANNEL_COUNT, 1, + vmstate_i8257_regs, I8257Regs), VMSTATE_END_OF_LIST() } }; --=20 2.16.3 From nobody Sun May 5 08:09:25 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1522079817093139.32119796008124; Mon, 26 Mar 2018 08:56:57 -0700 (PDT) Received: from localhost ([::1]:57563 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f0UUS-0005LM-At for importer@patchew.org; Mon, 26 Mar 2018 11:56:56 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34571) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f0U9N-0003KC-Pq for qemu-devel@nongnu.org; Mon, 26 Mar 2018 11:35:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f0U9I-0000K1-U4 for qemu-devel@nongnu.org; Mon, 26 Mar 2018 11:35:09 -0400 Received: from mail-qk0-x242.google.com ([2607:f8b0:400d:c09::242]:44639) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1f0U9I-0000Jh-PG for qemu-devel@nongnu.org; Mon, 26 Mar 2018 11:35:04 -0400 Received: by mail-qk0-x242.google.com with SMTP id o5so2139170qki.11 for ; Mon, 26 Mar 2018 08:35:04 -0700 (PDT) Received: from x1.local ([138.117.48.212]) by smtp.gmail.com with ESMTPSA id i188sm2017502qkc.16.2018.03.26.08.34.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 26 Mar 2018 08:35:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=/I9DjvczGNJrsaySlHmyPom9B/PbAp8L99gfWqBAeOc=; b=MPRyOqD6UxT6Vhj2GVQk0r57UJdP/rWA8M9l9pnb2f+fG+HgDKGQSxtytYccCgbf2C HMFj3IY5ihGRbC1/eS9OBkTNxdH2Ckph7mM8+++QHySWLEemgrqtg+ih6+8k6R9djpwg J2K1me8SLdIxQklZL96XWOrqjXR8IVnBxVI/e9N5fUGYxuFF9fTOG65BFod8X1H/f7GT gV5ZoGC1KReS6FDf7guVnc4YHiEx68APVUz9v9rhruHJBJAoILV42oZX83mLOd8B5Z9E aHeCuN0SoLm+tAruwvFs76cmcjUeGo0tcTr4NCYrT0dTQBdZmkWqgflPafSwdfCgMmyE PWXA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=/I9DjvczGNJrsaySlHmyPom9B/PbAp8L99gfWqBAeOc=; b=t38ywo96I/yDOp6NSugQCORev7J3hSzrSCoLk5atmI8J26B0qBU6lxFyUc4Jp4CS3l oCyT60m6Ptn8aYi/hH8VA/oBvK1oq726eWgje+6fx16Q5I3OffG58RX2AhVkPB63rGPd 7M01xJ3PBq3idiiKTo2GZ1P3SdHAPUW9uynWsNgCAXoe2Qfb0zDQ1zLScVE5NnypVdL8 MQIx+J/wbCUMJGYX+nEoQUaajp0kSMUY58wQtXSwZdDNAVZHlrlCGat5/sxTuC2YDikU 104R22YdGoz4VYCciu2vEhzEqGTPNQJlXZiN3fUIZqZO5D3A0UKlKRgYDvrZdk5zb5Q7 7DDQ== X-Gm-Message-State: AElRT7GVm8PHxdlMefcBrASxXgr3dDXrW8jo5WM+Swnj5w+msbj7TvD8 BmBSxSlfuwYgtw6JUfe6wpQ= X-Google-Smtp-Source: AG47ELtg8/qLTWmaC3eV6/+IxaogMZFMcYjd2FHD24lqzCynVHUHsXnYqHCCJy/9zVA/NMSa8/fVNA== X-Received: by 10.55.155.142 with SMTP id d136mr54084457qke.274.1522078504149; Mon, 26 Mar 2018 08:35:04 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: Eduardo Otubo , Thomas Huth , Paolo Bonzini Date: Mon, 26 Mar 2018 12:34:39 -0300 Message-Id: <20180326153441.32641-4-f4bug@amsat.org> X-Mailer: git-send-email 2.16.3 In-Reply-To: <20180326153441.32641-1-f4bug@amsat.org> References: <20180326153441.32641-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c09::242 Subject: [Qemu-devel] [PATCH for-2.13 3/5] hw/dma/i8257: Split i8257_dma_init() by master/slave X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Eduardo Habkost , "Michael S. Tsirkin" , qemu-devel@nongnu.org, Michael Tokarev , Alexander Graf , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Nageswara Sastry , =?UTF-8?q?Herv=C3=A9=20Poussineau?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 This emphasises than two controller are created (in master/slave configurat= ion). Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Eduardo Otubo --- hw/dma/i8257.c | 32 +++++++++++++++++++++++++------- 1 file changed, 25 insertions(+), 7 deletions(-) diff --git a/hw/dma/i8257.c b/hw/dma/i8257.c index df030f934c..72f8893b9e 100644 --- a/hw/dma/i8257.c +++ b/hw/dma/i8257.c @@ -622,26 +622,44 @@ static void i8257_register_types(void) =20 type_init(i8257_register_types) =20 -void i8257_dma_init(ISABus *bus, bool high_page_enable) +static ISADevice *i8257_dma_init_master(ISABus *bus, bool high_page_enable) { - ISADevice *isa1, *isa2; + ISADevice *isa; DeviceState *d; =20 - isa1 =3D isa_create(bus, TYPE_I8257); - d =3D DEVICE(isa1); + isa =3D isa_create(bus, TYPE_I8257); + d =3D DEVICE(isa); qdev_prop_set_int32(d, "base", 0x00); qdev_prop_set_int32(d, "page-base", 0x80); qdev_prop_set_int32(d, "pageh-base", high_page_enable ? 0x480 : -1); qdev_prop_set_int32(d, "dshift", 0); qdev_init_nofail(d); =20 - isa2 =3D isa_create(bus, TYPE_I8257); - d =3D DEVICE(isa2); + return isa; +} + +static ISADevice *i8257_dma_init_slave(ISABus *bus, bool high_page_enable) +{ + ISADevice *isa; + DeviceState *d; + + isa =3D isa_create(bus, TYPE_I8257); + d =3D DEVICE(isa); qdev_prop_set_int32(d, "base", 0xc0); qdev_prop_set_int32(d, "page-base", 0x88); qdev_prop_set_int32(d, "pageh-base", high_page_enable ? 0x488 : -1); qdev_prop_set_int32(d, "dshift", 1); qdev_init_nofail(d); =20 - isa_bus_dma(bus, ISADMA(isa1), ISADMA(isa2)); + return isa; +} + +void i8257_dma_init(ISABus *bus, bool high_page_enable) +{ + ISADevice *master, *slave; + + master =3D i8257_dma_init_master(bus, high_page_enable); + slave =3D i8257_dma_init_slave(bus, high_page_enable); + + isa_bus_dma(bus, ISADMA(master), ISADMA(slave)); } --=20 2.16.3 From nobody Sun May 5 08:09:25 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1522080328576543.3896147559816; Mon, 26 Mar 2018 09:05:28 -0700 (PDT) Received: from localhost ([::1]:57697 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f0Uch-0004VK-Do for importer@patchew.org; Mon, 26 Mar 2018 12:05:27 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44398) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f0UZg-00024t-2w for qemu-devel@nongnu.org; Mon, 26 Mar 2018 12:02:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f0UZc-0000J1-4Q for qemu-devel@nongnu.org; Mon, 26 Mar 2018 12:02:20 -0400 Received: from mail-qk0-x241.google.com ([2607:f8b0:400d:c09::241]:33680) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1f0UZc-0000Iu-0j; Mon, 26 Mar 2018 12:02:16 -0400 Received: by mail-qk0-x241.google.com with SMTP id d206so8284923qkb.0; Mon, 26 Mar 2018 09:02:15 -0700 (PDT) Received: from x1.local ([138.117.48.212]) by smtp.gmail.com with ESMTPSA id 53sm12033771qto.94.2018.03.26.09.02.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 26 Mar 2018 09:02:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=QSA4+kYd0lapdxGj8ETOaAgE5e5p+IyRWF+oYRUWlQE=; b=fy41hmJQxMQMu3B6FY0TihYoM69U0GlwrQSpFQpgRnKr4izqtteGWZzlLJbmOMRxfO ZYXDtSgqzWLU1fYeSBcKuA/4s4tK28nyI1kIgzvsSbqPkJVbK4oV6GFycUR7xJrjJcwT oG6py/eIFEJbfgBy31DndQep/ACX0HFK/hEjdK4O3QkF+fWA+YRItXdw4zdz0qAzx0uT SoiR3A3ZGKNQi2uq5OWVAopkHZTAlsLp3fp5gu3N9F6SYnDQziYZzDcD5EGuZetJS+mU ORtWvuOYSKA9zfY4LuLM1Sbp7+xunuXs6/HCFsyNvJQSMxIvP9LY34oWev7Gpb0GgVfF qNYA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=QSA4+kYd0lapdxGj8ETOaAgE5e5p+IyRWF+oYRUWlQE=; b=dWh1ZY1xLa5bwvxsaNXebaYs8qxQ+5LTzjCFlqShhAbS227EVUHITaIGWUpfWAbf5F QtfxaYIjrsumfvrndmd+MjOFw240kXhhBDDI/eBWu+7uDCvF4KxdTAvPoQAjP2t0fTHF BxlF+qEWoPrEdeU6miubL9a9HgM+L8Zrr9Odu90m9ygEK7wD9H+VA1Sse1cAEk6Q8mdU qgJ6oH1Zew3wzNhUpr1M4NbtoXK9cRWEjk6/LOyZ+Apb77MGMOUamuTBv4Kx1p8M7DFS ETrhFpjVXjWdhcrtN/RrZtBrPHdnPlZ2/nDuUpo0b1v8O2fn2qXICk+2k0zouuKAtlNx 58HA== X-Gm-Message-State: AElRT7Eu4dnGFS8uhncCxeKmVBYa6kgDkkRYU7FY7vLRWTPkjRu5AmY2 o1IQ4YCZGolWDRxqx8R6CO8= X-Google-Smtp-Source: AG47ELudKvKiz6SeI1KwchOJkBvxN9V2IkR7iSVeC6+KtGTQfoZO0ydBFAhnk7ZYigvSl8uG4x0UhA== X-Received: by 10.55.103.148 with SMTP id b142mr57018908qkc.45.1522080135374; Mon, 26 Mar 2018 09:02:15 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: Eduardo Otubo , Thomas Huth , Paolo Bonzini Date: Mon, 26 Mar 2018 13:02:05 -0300 Message-Id: <20180326160205.1518-1-f4bug@amsat.org> X-Mailer: git-send-email 2.16.3 In-Reply-To: <20180326153441.32641-1-f4bug@amsat.org> References: <20180326153441.32641-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c09::241 Subject: [Qemu-devel] [PATCH for-2.13 4/5] hw/dma/i8257: Rename i8257_dma_init() -> i8257_dma_init_cascaded() X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "open list:PReP" , Eduardo Habkost , "Michael S. Tsirkin" , qemu-devel@nongnu.org, Michael Tokarev , Alexander Graf , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Nageswara Sastry , =?UTF-8?q?Herv=C3=A9=20Poussineau?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 To keep the patch diff simple, an inline function is used (then removed in the next commit). Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Eduardo Otubo --- include/hw/dma/i8257.h | 6 +++++- hw/dma/i82374.c | 2 +- hw/dma/i8257.c | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/include/hw/dma/i8257.h b/include/hw/dma/i8257.h index 3053f18797..986319e4e3 100644 --- a/include/hw/dma/i8257.h +++ b/include/hw/dma/i8257.h @@ -46,6 +46,10 @@ typedef struct I8257State { PortioList portio_pageh; } I8257State; =20 -void i8257_dma_init(ISABus *bus, bool high_page_enable); +void i8257_dma_init_cascaded(ISABus *bus, bool high_page_enable); +static inline void i8257_dma_init(ISABus *bus, bool high_page_enable) +{ + i8257_dma_init_cascaded(bus, high_page_enable); +} =20 #endif diff --git a/hw/dma/i82374.c b/hw/dma/i82374.c index 892f655a7e..b95edd7b98 100644 --- a/hw/dma/i82374.c +++ b/hw/dma/i82374.c @@ -125,7 +125,7 @@ static void i82374_realize(DeviceState *dev, Error **er= rp) error_setg(errp, "DMA already initialized on ISA bus"); return; } - i8257_dma_init(isa_bus, true); + i8257_dma_init_cascaded(isa_bus, true); =20 portio_list_init(&s->port_list, OBJECT(s), i82374_portio_list, s, "i82374"); diff --git a/hw/dma/i8257.c b/hw/dma/i8257.c index 72f8893b9e..c930c4c531 100644 --- a/hw/dma/i8257.c +++ b/hw/dma/i8257.c @@ -654,7 +654,7 @@ static ISADevice *i8257_dma_init_slave(ISABus *bus, boo= l high_page_enable) return isa; } =20 -void i8257_dma_init(ISABus *bus, bool high_page_enable) +void i8257_dma_init_cascaded(ISABus *bus, bool high_page_enable) { ISADevice *master, *slave; =20 --=20 2.16.3 From nobody Sun May 5 08:09:25 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1522079938339997.1003382254695; Mon, 26 Mar 2018 08:58:58 -0700 (PDT) Received: from localhost ([::1]:57572 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f0UWP-0006yg-CA for importer@patchew.org; Mon, 26 Mar 2018 11:58:57 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34644) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f0U9T-0003RI-Pq for qemu-devel@nongnu.org; Mon, 26 Mar 2018 11:35:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f0U9S-0000T3-Jl for qemu-devel@nongnu.org; Mon, 26 Mar 2018 11:35:15 -0400 Received: from mail-qt0-x242.google.com ([2607:f8b0:400d:c0d::242]:39605) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1f0U9S-0000Sh-Fy for qemu-devel@nongnu.org; Mon, 26 Mar 2018 11:35:14 -0400 Received: by mail-qt0-x242.google.com with SMTP id v11so19969719qtj.6 for ; Mon, 26 Mar 2018 08:35:14 -0700 (PDT) Received: from x1.local ([138.117.48.212]) by smtp.gmail.com with ESMTPSA id i188sm2017502qkc.16.2018.03.26.08.35.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 26 Mar 2018 08:35:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=meGqfvJxx8hZLrt7hqRMcMJspaFRQYd4v2T543CMHBM=; b=jjVudNA3xWSc1mMISdmYmg8jWuJ+byvkBrTdiQJfGney79obQI4VDRsQunol3cBvSW mQJGQTVZ1HA7xjfCgfm6/oUOLvr9mOleyBseEizb0yhh9PemaPQexVPU4+jjVQ5d9OUH S8hyQ23LzJEvvMiyLbp7YYEt2ZpTHE0jgR8wvnpKxAaWQdJ/sTwDph2B8R9Wj0fbnKCe 6Jq1vtkTK1b4dg4YAuG6zMqNKyQNTXBscFIk++cBBCprMXqTBqNYtBeR+dQOyGK7iNsP 6CtY9XABlNPp0zWXRvZjbEbaGdy1dmzQZg7IALi6Rze+QpFtay7roTf2XskPas+osUPx +ETA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=meGqfvJxx8hZLrt7hqRMcMJspaFRQYd4v2T543CMHBM=; b=QTHpTny1kA5Xr+9eK54EeJl6a3Y9EqH81ggZyBnesIuWe2PWKcgK5xSAJ4X3TnH5vb Q7W174NhXNYQSHrrr7hwX7BuxmnapqGGUEux8Etjojka5tALgIoEqwMk+zk/jHBLMy+M CJdz91tuczgJMSIl7/AFiCOPw1C2mLB051+FQrM6b1m8ZH+F+iXRB/qULCmx7GTjj5IU PfVxm36tubOf93ooYI7UjvevEKDElnRhDME1rl/Z443k2wreyIYehFwWFF8nXwtGgHIV t4/a4HuYwPHj1MoTl+qQI71dMeQZUC5aDGRFqVBvyWh7Dx9OYyK7N7B80Izt3RaAI6o7 cixw== X-Gm-Message-State: AElRT7Fbr6uj+lAjrbrjVu/Piiixd08HEx5G33bJkhshMPOyMxsTgnMb yLiRp4yWMvnqbGiaalTEspM= X-Google-Smtp-Source: AIpwx4//urJAgVrf37C8BYqiIWfLoTM6pss5a23rewtMriLuC3K659Bf/TS9THEass1TrLKy+D/JcQ== X-Received: by 10.200.61.65 with SMTP id u1mr27364066qtf.168.1522078513936; Mon, 26 Mar 2018 08:35:13 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: Eduardo Otubo , Thomas Huth , Paolo Bonzini Date: Mon, 26 Mar 2018 12:34:41 -0300 Message-Id: <20180326153441.32641-6-f4bug@amsat.org> X-Mailer: git-send-email 2.16.3 In-Reply-To: <20180326153441.32641-1-f4bug@amsat.org> References: <20180326153441.32641-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c0d::242 Subject: [Qemu-devel] [PATCH for-2.13 5/5] hw/dma/i8257: Rename i8257_dma_init(false) -> i8257_dma_init_pc_at() X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Eduardo Habkost , "Michael S. Tsirkin" , qemu-devel@nongnu.org, Michael Tokarev , Alexander Graf , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Nageswara Sastry , Marcel Apfelbaum , =?UTF-8?q?Herv=C3=A9=20Poussineau?= , Yongbok Kim , Aurelien Jarno , Richard Henderson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Reflect that the PC/AT implementation is used. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Eduardo Otubo Reviewed-by: Marcel Apfelbaum --- include/hw/dma/i8257.h | 17 +++++++++++++++-- hw/i386/pc.c | 2 +- hw/mips/mips_fulong2e.c | 2 +- hw/mips/mips_jazz.c | 2 +- hw/mips/mips_malta.c | 2 +- 5 files changed, 19 insertions(+), 6 deletions(-) diff --git a/include/hw/dma/i8257.h b/include/hw/dma/i8257.h index 986319e4e3..15db8b4d29 100644 --- a/include/hw/dma/i8257.h +++ b/include/hw/dma/i8257.h @@ -47,9 +47,22 @@ typedef struct I8257State { } I8257State; =20 void i8257_dma_init_cascaded(ISABus *bus, bool high_page_enable); -static inline void i8257_dma_init(ISABus *bus, bool high_page_enable) + +/** + * i8257_dma_init_pc_at: Install 8 DMA channels on the ISA bus. + * + * This is the PC/AT DMA implementation: + * + * Two i8257 controllers are created. + * The primary controller register channels [0..3] on the bus, + * the secondary controller (slave) is cascaded on the primary (master), + * registering channels [4..7]. + * + * @bus: the #ISABus against which these are created. + */ +static inline void i8257_dma_init_pc_at(ISABus *bus) { - i8257_dma_init_cascaded(bus, high_page_enable); + i8257_dma_init_cascaded(bus, false); } =20 #endif diff --git a/hw/i386/pc.c b/hw/i386/pc.c index d36bac8c89..baba079d7f 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -1624,7 +1624,7 @@ void pc_basic_device_init(ISABus *isa_bus, qemu_irq *= gsi, pcspk_init(isa_bus, pit); } =20 - i8257_dma_init(isa_bus, 0); + i8257_dma_init_pc_at(isa_bus); =20 /* Super I/O */ pc_superio_init(isa_bus, create_fdctrl, no_vmport); diff --git a/hw/mips/mips_fulong2e.c b/hw/mips/mips_fulong2e.c index 02fb2fdcc4..8168e6cf16 100644 --- a/hw/mips/mips_fulong2e.c +++ b/hw/mips/mips_fulong2e.c @@ -243,7 +243,7 @@ static void vt82c686b_southbridge_init(PCIBus *pci_bus,= int slot, qemu_irq intc, isa_bus_irqs(isa_bus, i8259); /* init other devices */ i8254_pit_init(isa_bus, 0x40, 0, NULL); - i8257_dma_init(isa_bus, 0); + i8257_dma_init_pc_at(isa_bus); /* Super I/O */ isa_create_simple(isa_bus, TYPE_VT82C686B_SUPERIO); =20 diff --git a/hw/mips/mips_jazz.c b/hw/mips/mips_jazz.c index 7223085547..2577e8383d 100644 --- a/hw/mips/mips_jazz.c +++ b/hw/mips/mips_jazz.c @@ -222,7 +222,7 @@ static void mips_jazz_init(MachineState *machine, /* ISA devices */ i8259 =3D i8259_init(isa_bus, env->irq[4]); isa_bus_irqs(isa_bus, i8259); - i8257_dma_init(isa_bus, 0); + i8257_dma_init_pc_at(isa_bus); pit =3D i8254_pit_init(isa_bus, 0x40, 0, NULL); pcspk_init(isa_bus, pit); =20 diff --git a/hw/mips/mips_malta.c b/hw/mips/mips_malta.c index f6513a4fd5..9d0409bc36 100644 --- a/hw/mips/mips_malta.c +++ b/hw/mips/mips_malta.c @@ -1198,7 +1198,7 @@ void mips_malta_init(MachineState *machine) smbus =3D piix4_pm_init(pci_bus, piix4_devfn + 3, 0x1100, isa_get_irq(NULL, 9), NULL, 0, NULL); pit =3D i8254_pit_init(isa_bus, 0x40, 0, NULL); - i8257_dma_init(isa_bus, 0); + i8257_dma_init_pc_at(isa_bus); mc146818_rtc_init(isa_bus, 2000, NULL); =20 /* generate SPD EEPROM data */ --=20 2.16.3 From nobody Sun May 5 08:09:25 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1522079307330316.20361911841485; Mon, 26 Mar 2018 08:48:27 -0700 (PDT) Received: from localhost ([::1]:57502 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f0UME-0006ZU-8r for importer@patchew.org; Mon, 26 Mar 2018 11:48:26 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34573) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f0U9O-0003KW-2K for qemu-devel@nongnu.org; Mon, 26 Mar 2018 11:35:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f0U9N-0000M0-85 for qemu-devel@nongnu.org; Mon, 26 Mar 2018 11:35:10 -0400 Received: from mail-qt0-x241.google.com ([2607:f8b0:400d:c0d::241]:45528) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1f0U9N-0000Lj-3O; Mon, 26 Mar 2018 11:35:09 -0400 Received: by mail-qt0-x241.google.com with SMTP id f8so19980338qtg.12; Mon, 26 Mar 2018 08:35:08 -0700 (PDT) Received: from x1.local ([138.117.48.212]) by smtp.gmail.com with ESMTPSA id i188sm2017502qkc.16.2018.03.26.08.35.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 26 Mar 2018 08:35:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=QSA4+kYd0lapdxGj8ETOaAgE5e5p+IyRWF+oYRUWlQE=; b=pejH/+ReMBYb9ZoCZHxWrK/gGpq+IltnVYy8sedACaa4kldiZyiLFaRndkhQfoPZic 510fsJJMhm/kQBq8u/LW+R1G2PI0vyxTNpYavUE9ZCp6hpVPKvzY0Zw2w/DPjaHO2Nxl RIZHPSGgdfzkwn0EFHxCq+D8oXF9/013VgMR+CWTWnHJHsftuL+l1OV7Vbw0JMdvxn9o R5Px/sqqpHgBiIfHF1DoDBMcoDmdjsemnr/705WuwCaUuk5SNi50orbyT+MfGRk5l255 tPyo/KIe/J6+DBj6wJ7S6hLsjjO+5EAv70C/QMI1x29Bw8p/etQmlDMz91zksrKa5Hgw oi2Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=QSA4+kYd0lapdxGj8ETOaAgE5e5p+IyRWF+oYRUWlQE=; b=l+crPBILPk19S2I/P6dqnKnjLK31a8/Z7zyiNw42MlAsGFxXwM5hzD/Q3FGR6VLCSd xlMq4vhsY/wPuoD9JKAHiR93ZwfSMBocRQpCmRXLHaL8nidUFMdHLmYH12H1ySRt4ImP b4jd/3uAPPi+OnYYC1HGf5GpeJ3ismj3kzaujEVvqQSiD6b/jFMsX2luxS9Gc7GjjY1v FIWFexa9PsUIBZOarmQ3I5+4lMGMpMt1PG2aKuB+Os3Mh6UzwsIN17awZRA1RZanAyXE d7QtDsXMH1QvMIVn1j6kf0cNVzdwydQXej6fRPctMtlwiRQ5YlMtjINV2cRmyNs5NuWW Ppiw== X-Gm-Message-State: AElRT7E9jXfjswhyAqSQnmv+xOe0+8Nt7iNIRlYtQioXvVLR3pf9F/xG u5Xp0kBBBOjzCuCHJjvX3VrVKqld X-Google-Smtp-Source: AIpwx4/BMD9XGudd2TI9hxbOK29HCaTwimvbmMyFiMGlCWB6IvNt7fz5oITa61eeZX4NWWnaJLcpgg== X-Received: by 10.200.68.7 with SMTP id j7mr14704372qtn.132.1522078508597; Mon, 26 Mar 2018 08:35:08 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: Eduardo Otubo , Thomas Huth , Paolo Bonzini Date: Mon, 26 Mar 2018 12:34:40 -0300 Message-Id: <20180326153441.32641-5-f4bug@amsat.org> X-Mailer: git-send-email 2.16.3 In-Reply-To: <20180326153441.32641-1-f4bug@amsat.org> References: <20180326153441.32641-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c0d::241 Subject: [Qemu-devel] [PATCH for-2.13 /5] hw/dma/i8257: Rename i8257_dma_init() -> i8257_dma_init_cascaded() X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "open list:PReP" , Eduardo Habkost , "Michael S. Tsirkin" , qemu-devel@nongnu.org, Michael Tokarev , Alexander Graf , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Nageswara Sastry , =?UTF-8?q?Herv=C3=A9=20Poussineau?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 To keep the patch diff simple, an inline function is used (then removed in the next commit). Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Eduardo Otubo --- include/hw/dma/i8257.h | 6 +++++- hw/dma/i82374.c | 2 +- hw/dma/i8257.c | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/include/hw/dma/i8257.h b/include/hw/dma/i8257.h index 3053f18797..986319e4e3 100644 --- a/include/hw/dma/i8257.h +++ b/include/hw/dma/i8257.h @@ -46,6 +46,10 @@ typedef struct I8257State { PortioList portio_pageh; } I8257State; =20 -void i8257_dma_init(ISABus *bus, bool high_page_enable); +void i8257_dma_init_cascaded(ISABus *bus, bool high_page_enable); +static inline void i8257_dma_init(ISABus *bus, bool high_page_enable) +{ + i8257_dma_init_cascaded(bus, high_page_enable); +} =20 #endif diff --git a/hw/dma/i82374.c b/hw/dma/i82374.c index 892f655a7e..b95edd7b98 100644 --- a/hw/dma/i82374.c +++ b/hw/dma/i82374.c @@ -125,7 +125,7 @@ static void i82374_realize(DeviceState *dev, Error **er= rp) error_setg(errp, "DMA already initialized on ISA bus"); return; } - i8257_dma_init(isa_bus, true); + i8257_dma_init_cascaded(isa_bus, true); =20 portio_list_init(&s->port_list, OBJECT(s), i82374_portio_list, s, "i82374"); diff --git a/hw/dma/i8257.c b/hw/dma/i8257.c index 72f8893b9e..c930c4c531 100644 --- a/hw/dma/i8257.c +++ b/hw/dma/i8257.c @@ -654,7 +654,7 @@ static ISADevice *i8257_dma_init_slave(ISABus *bus, boo= l high_page_enable) return isa; } =20 -void i8257_dma_init(ISABus *bus, bool high_page_enable) +void i8257_dma_init_cascaded(ISABus *bus, bool high_page_enable) { ISADevice *master, *slave; =20 --=20 2.16.3