From nobody Tue Feb 10 02:30:30 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 (209.51.188.17 [209.51.188.17]) by mx.zohomail.com with SMTPS id 1549307579213874.0238521821519; Mon, 4 Feb 2019 11:12:59 -0800 (PST) Received: from localhost ([127.0.0.1]:47786 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gqjfp-0001IH-3f for importer@patchew.org; Mon, 04 Feb 2019 14:12:53 -0500 Received: from eggs.gnu.org ([209.51.188.92]:59796) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gqj7M-0005Xd-Gh for qemu-devel@nongnu.org; Mon, 04 Feb 2019 13:37:17 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gqj7K-0003qM-Jo for qemu-devel@nongnu.org; Mon, 04 Feb 2019 13:37:16 -0500 Received: from mail-wr1-x42b.google.com ([2a00:1450:4864:20::42b]:34875) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gqj7G-0003mz-OO for qemu-devel@nongnu.org; Mon, 04 Feb 2019 13:37:12 -0500 Received: by mail-wr1-x42b.google.com with SMTP id z18so203975wrh.2 for ; Mon, 04 Feb 2019 10:37:08 -0800 (PST) Received: from 640k.lan ([93.56.166.5]) by smtp.gmail.com with ESMTPSA id s132sm8836236wmf.28.2019.02.04.10.37.05 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 04 Feb 2019 10:37:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:subject:date:message-id:in-reply-to:references; bh=f1X7XFI/XSHALiPtUQC3oMcosPCum0quwFXIamNZMX0=; b=aFq4FyV9uxBFv9RiDKXH8w7Nhf3NGDsbqMI7iJV+qJVEQ6Y9cC45Wyz11SXeyUCHzx 9iwnSTIEq2RQV5cVwHa4LqBajsDHKyAzzn6Wlen+31qgFnQb4u9vh5Bo1hKaG6tLpNKc uXe7k6v9noosENUgDKXURVJuoWnDOCHu9yyvjIO4aEvnZiJwR0oM8pxl/H/GOof1wh61 RQVBZ05jXP+FZTjSBJtIJmN0ZJv+mVemx8tx2l7uLCDvknC1NJlmwqBqdriGEJpVm+Al B9mzO8FhFgFddA7GRfhytfyNc7jEHkeKdQcxClOxj4mjRENy8WwjJQLzQITL3YjzNBmy AitQ== 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:subject:date:message-id :in-reply-to:references; bh=f1X7XFI/XSHALiPtUQC3oMcosPCum0quwFXIamNZMX0=; b=gq7m8e48/1HuUDdBrSEiciGKR65w6IaDXhnnDvbhJtJ7+8hfE5DNiK3jS6/EVz9D4B wn2bYPQMZOaxTAab6eqo8Afmu9jXKDrnM4GcEUyI47Wt7trYG4E3VKLsmOia9g0ujIqN FnH2PU2ko9L4cQrdC2tIwdB35yTgPXNfHeLvkmBLonEoZl5bmfT1OWov5LE6ubQl+bPn FFTBK7f6EIyIa0iS1BoSXkqQmkJCcSzCq+xDYrzrYeRkf1EKHQePriecb0jc4ewJO8Xq rgN74Eibp0X6JNQUJbBmMCaJG9kbQPb6MCQa6XjtEVhCTSLZgs7L3l8/5dJqD1mC1pzn E1Ow== X-Gm-Message-State: AHQUAuYg7kRZlxaVZ4T8y7BjIbIEol4siq888jV1rewgQgyGEjuHyLRx kJGBQlpMNYZ0mxem7D8D3natppOV X-Google-Smtp-Source: AHgI3IYGHO+iyB45K6JDSNKSHeuWb2XIhk/3qoLCmVC3gVS9hsm2QngycM1G4nibJ+aaK1S71QUr+g== X-Received: by 2002:a5d:570c:: with SMTP id a12mr540818wrv.161.1549305427264; Mon, 04 Feb 2019 10:37:07 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Mon, 4 Feb 2019 19:35:49 +0100 Message-Id: <1549305379-51117-48-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1549305379-51117-1-git-send-email-pbonzini@redhat.com> References: <1549305379-51117-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::42b Subject: [Qemu-devel] [PULL 47/77] 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: , 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 Message-Id: <20190202072456.6468-3-yang.zhong@intel.com> Signed-off-by: Paolo Bonzini --- hw/ide/Makefile.objs | 4 ++-- hw/ide/core.c | 25 -------------------- hw/ide/ioport.c | 66 ++++++++++++++++++++++++++++++++++++++++++++++++= ++++ 3 files changed, 68 insertions(+), 27 deletions(-) create mode 100644 hw/ide/ioport.c diff --git a/hw/ide/Makefile.objs b/hw/ide/Makefile.objs index fc328ff..a142add 100644 --- a/hw/ide/Makefile.objs +++ b/hw/ide/Makefile.objs @@ -1,8 +1,8 @@ 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_PIIX) +=3D piix.o +common-obj-$(CONFIG_IDE_ISA) +=3D isa.o ioport.o +common-obj-$(CONFIG_IDE_PIIX) +=3D piix.o ioport.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 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..a0b3c1f --- /dev/null +++ b/hw/ide/ioport.c @@ -0,0 +1,66 @@ +/* + * 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