From nobody Tue Feb 10 04:15:24 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.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 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1548410967129614.0356461080022; Fri, 25 Jan 2019 02:09:27 -0800 (PST) Received: from localhost ([127.0.0.1]:41263 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gmyQO-0000Bi-0t for importer@patchew.org; Fri, 25 Jan 2019 05:09:24 -0500 Received: from eggs.gnu.org ([209.51.188.92]:57725) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gmyON-0007Ha-Jl for qemu-devel@nongnu.org; Fri, 25 Jan 2019 05:07:21 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gmyOK-0001Sj-RL for qemu-devel@nongnu.org; Fri, 25 Jan 2019 05:07:19 -0500 Received: from mail-wr1-x443.google.com ([2a00:1450:4864:20::443]:45949) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gmyOK-0001Rw-LQ for qemu-devel@nongnu.org; Fri, 25 Jan 2019 05:07:16 -0500 Received: by mail-wr1-x443.google.com with SMTP id t6so9580637wrr.12 for ; Fri, 25 Jan 2019 02:07:16 -0800 (PST) Received: from 640k.lan ([93.56.166.5]) by smtp.gmail.com with ESMTPSA id p4sm88048455wrs.74.2019.01.25.02.07.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 25 Jan 2019 02:07:14 -0800 (PST) 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; bh=te0Qn1sKyuDZsGiMx7vmH1Bk/nEeESZg2oUjRNlDJQ0=; b=gXpAyUiOVHWoJ2SWnR/9PgdBOOAMOGqWgTzqSTxlhM1ADt5Ah9uyapGfdtD08Sx47W JXjkZRodtDKZvpSzpJ+zcFP7d1BsIHJDmN1yoVPxOMaMGMmjCsRbZybAjJkWEOQxC3Mw vzfPxWEOMYhyhlrz97gSe9RW7cxxTzJUi+/rBn0+KN310HxGZwh3JcceQTwea8nobIbE BHVIS4+MLw3UJVv/GAsi+hX8TAL52RKv78ucPoGL+zvA9uRXCQwAtzh1eYcJzP4cDUxT 24N0VxankFTMuwraB3mQpl6ex/osPg+u+qJzfZcdG3x0jKM5KXLSGap4ISq8FSl3R6y9 hHlQ== 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; bh=te0Qn1sKyuDZsGiMx7vmH1Bk/nEeESZg2oUjRNlDJQ0=; b=M0/NLITMlwBXy6kaKKww1yXXZT3264Iehw7H2MOQwdO5YUI0m4MHPXHkoROdNViqVW c1r15bwYq6vHyBmCLd1qYZ5QT4tME340l487s2ybTeO6IRSzC2g3+zo+h/2ri/LR7xHo OCPkhPfrMZi9LeLccIwImtIa6AGWWMPzygmOHM+ps7j9xA8M5tkt815yH0zzOH7bqupr F4US+SrqZbmuJCk/UkV7s8Xgk/My8yindQahK/87uy/aLOi4ov4x96eBvIaFKq3lENQX r5NLp1WNGUKXVUu2k9Yrbtan7+f7rS7Eh0AkLuhjYg8xihMfcHThTM13FWxC9buSycgM y+Yg== X-Gm-Message-State: AJcUukfae7/U1kbwWJ2bDFvNLecisDXJ160O8to3DECzWcfbq0Dtc8/R g0ct3n2eqXt+VNaFAiZ0sWLcFp/k X-Google-Smtp-Source: ALg8bN6/qb1tu4abuplBPY3Sv/M5cV6LJhUm+lWgLq0SDwDg2LSsLw+x07VbBEz27xMnnv5cgBeevw== X-Received: by 2002:a5d:480d:: with SMTP id l13mr11419697wrq.175.1548410835320; Fri, 25 Jan 2019 02:07:15 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Fri, 25 Jan 2019 11:06:21 +0100 Message-Id: <1548410831-19553-3-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1548410831-19553-1-git-send-email-pbonzini@redhat.com> References: <1548410831-19553-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::443 Subject: [Qemu-devel] [PATCH 02/52] ide: split ioport registration to a separate file 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: yang.zhong@intel.com, thuth@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" This is not needed on ARM, and brings in ISA bus code which is otherwise not necessary. Signed-off-by: Paolo Bonzini Reviewed-by: Thomas Huth --- hw/ide/Makefile.objs | 6 ++--- hw/ide/core.c | 25 -------------------- hw/ide/ioport.c | 67 ++++++++++++++++++++++++++++++++++++++++++++++++= ++++ 3 files changed, 70 insertions(+), 28 deletions(-) create mode 100644 hw/ide/ioport.c diff --git a/hw/ide/Makefile.objs b/hw/ide/Makefile.objs index fc328ff..3f3edd10 100644 --- a/hw/ide/Makefile.objs +++ b/hw/ide/Makefile.objs @@ -1,12 +1,12 @@ common-obj-$(CONFIG_IDE_CORE) +=3D core.o atapi.o common-obj-$(CONFIG_IDE_QDEV) +=3D qdev.o -common-obj-$(CONFIG_IDE_PCI) +=3D pci.o -common-obj-$(CONFIG_IDE_ISA) +=3D isa.o +common-obj-$(CONFIG_IDE_PCI) +=3D pci.o ioport.o +common-obj-$(CONFIG_IDE_ISA) +=3D isa.o ioport.o common-obj-$(CONFIG_IDE_PIIX) +=3D piix.o common-obj-$(CONFIG_IDE_CMD646) +=3D cmd646.o common-obj-$(CONFIG_IDE_MACIO) +=3D macio.o common-obj-$(CONFIG_IDE_MMIO) +=3D mmio.o -common-obj-$(CONFIG_IDE_VIA) +=3D via.o +common-obj-$(CONFIG_IDE_VIA) +=3D via.o ioport.o common-obj-$(CONFIG_MICRODRIVE) +=3D microdrive.o common-obj-$(CONFIG_AHCI) +=3D ahci.o common-obj-$(CONFIG_AHCI) +=3D ich.o diff --git a/hw/ide/core.c b/hw/ide/core.c index c3d779d..8483200 100644 --- a/hw/ide/core.c +++ b/hw/ide/core.c @@ -2686,31 +2686,6 @@ void ide_exit(IDEState *s) qemu_vfree(s->io_buffer); } =20 -static const MemoryRegionPortio ide_portio_list[] =3D { - { 0, 8, 1, .read =3D ide_ioport_read, .write =3D ide_ioport_write }, - { 0, 1, 2, .read =3D ide_data_readw, .write =3D ide_data_writew }, - { 0, 1, 4, .read =3D ide_data_readl, .write =3D ide_data_writel }, - PORTIO_END_OF_LIST(), -}; - -static const MemoryRegionPortio ide_portio2_list[] =3D { - { 0, 1, 1, .read =3D ide_status_read, .write =3D ide_cmd_write }, - PORTIO_END_OF_LIST(), -}; - -void ide_init_ioport(IDEBus *bus, ISADevice *dev, int iobase, int iobase2) -{ - /* ??? Assume only ISA and PCI configurations, and that the PCI-ISA - bridge has been setup properly to always register with ISA. */ - isa_register_portio_list(dev, &bus->portio_list, - iobase, ide_portio_list, bus, "ide"); - - if (iobase2) { - isa_register_portio_list(dev, &bus->portio2_list, - iobase2, ide_portio2_list, bus, "ide"); - } -} - static bool is_identify_set(void *opaque, int version_id) { IDEState *s =3D opaque; diff --git a/hw/ide/ioport.c b/hw/ide/ioport.c new file mode 100644 index 0000000..b8f1b3f --- /dev/null +++ b/hw/ide/ioport.c @@ -0,0 +1,67 @@ +/* + * QEMU IDE disk and CD/DVD-ROM Emulator + * + * Copyright (c) 2003 Fabrice Bellard + * Copyright (c) 2006 Openedhand Ltd. + * + * Permission is hereby granted, free of charge, to any person obtaining a= copy + * of this software and associated documentation files (the "Software"), t= o deal + * in the Software without restriction, including without limitation the r= ights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or se= ll + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included= in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS= OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OT= HER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING= FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS = IN + * THE SOFTWARE. + */ + +#include "qemu/osdep.h" +#include "hw/hw.h" +#include "hw/isa/isa.h" +#include "qemu/error-report.h" +#include "qemu/timer.h" +#include "sysemu/sysemu.h" +#include "sysemu/blockdev.h" +#include "sysemu/dma.h" +#include "hw/block/block.h" +#include "sysemu/block-backend.h" +#include "qapi/error.h" +#include "qemu/cutils.h" +#include "sysemu/replay.h" + +#include "hw/ide/internal.h" +#include "trace.h" + +static const MemoryRegionPortio ide_portio_list[] =3D { + { 0, 8, 1, .read =3D ide_ioport_read, .write =3D ide_ioport_write }, + { 0, 1, 2, .read =3D ide_data_readw, .write =3D ide_data_writew }, + { 0, 1, 4, .read =3D ide_data_readl, .write =3D ide_data_writel }, + PORTIO_END_OF_LIST(), +}; + +static const MemoryRegionPortio ide_portio2_list[] =3D { + { 0, 1, 1, .read =3D ide_status_read, .write =3D ide_cmd_write }, + PORTIO_END_OF_LIST(), +}; + +void ide_init_ioport(IDEBus *bus, ISADevice *dev, int iobase, int iobase2) +{ + /* ??? Assume only ISA and PCI configurations, and that the PCI-ISA + bridge has been setup properly to always register with ISA. */ + isa_register_portio_list(dev, &bus->portio_list, + iobase, ide_portio_list, bus, "ide"); + + if (iobase2) { + isa_register_portio_list(dev, &bus->portio2_list, + iobase2, ide_portio2_list, bus, "ide"); + } +} + --=20 1.8.3.1