From nobody Sat Oct 25 08:57:50 2025 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 1520285066663746.6337681456414; Mon, 5 Mar 2018 13:24:26 -0800 (PST) Received: from localhost ([::1]:51610 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1esxar-0008HI-LZ for importer@patchew.org; Mon, 05 Mar 2018 16:24:25 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49181) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1esxWG-0004BF-4s for qemu-devel@nongnu.org; Mon, 05 Mar 2018 16:19:41 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1esxWE-0001TC-ID for qemu-devel@nongnu.org; Mon, 05 Mar 2018 16:19:40 -0500 Received: from mail-wr0-x243.google.com ([2a00:1450:400c:c0c::243]:34030) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1esxWE-0001Sc-8L for qemu-devel@nongnu.org; Mon, 05 Mar 2018 16:19:38 -0500 Received: by mail-wr0-x243.google.com with SMTP id o8so7291944wra.1 for ; Mon, 05 Mar 2018 13:19:38 -0800 (PST) Received: from x1.local (ABayonne-654-1-79-224.w86-222.abo.wanadoo.fr. [86.222.222.224]) by smtp.gmail.com with ESMTPSA id g96sm12904808wrd.73.2018.03.05.13.19.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 05 Mar 2018 13:19:36 -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 :mime-version:content-transfer-encoding; bh=q3Cp+tUtLDDMJZl0HxrMwPLs9V+5DPEGV6PjYxTJXXo=; b=TWkWa4KqRUtPfVTpha6d0ehXTSI8721mSiSjjTKb9jdU9lPxT+Pe+PPDP61LM7cmZ9 ERceYESvKfhaETwOGS53vzJOMWywWixw661K56aE3BkTNLg//ZJntAIfK3A4NOEYRXk8 AuCsE45juJTQSwH21E/riHGkg5r/uNGf+m8FDBDdRtpze7ZcfTprsypNJ5vLQr3kIsme y4YZoXpk/oA92ZqtNliKwMiE1b3Qug1gdyo5VY20iQXhr/DOORho4CZpH0ohn2TzG57k w+N+EmfB+QzsBluwYcXVn0tqPEj8Nr5VeVLa63uDuyw1HJ0j5q1QPAEZkTpAAkADIcHE 9LOA== 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=q3Cp+tUtLDDMJZl0HxrMwPLs9V+5DPEGV6PjYxTJXXo=; b=V7XaAjRFjZJxAkzDDaheuhLZPHXSfL2ydeYTUsx3EEj8o6rMHwW/pYY9r6UfiJ3fLy lGwvkTq2asBC0sq/pVZhLjZw6XIzfya3n8CCIEu+RXSCiGKZATSgPsX+qTLuzWzyRKyK DnopFgrpgqEpjxAOK/tHD38wSkhrvfMSkC/U8rQboIOdCuCAZ4nzgzyDkN1+AX0puGwj OL5H9ISCxvBnJxXXZWt57ImsHsmbzqsXX1KPO80KmKZ8xs7dw+rrmg8UjovmEFYu8w9k 0pJyvl2y/3+Z3BzssRbpP0wcf7pxHQO9zrOAOF95iGhEzG9LtCULmHFDEBB6cRrd9lnu PInA== X-Gm-Message-State: APf1xPDKrdvw9s/+nThoJTrTeQtwcBBBj8I4mAD+zrk8/wfBc4kJX/tw O5VVPo+VtnZp66APkggsQV0= X-Google-Smtp-Source: AG47ELsK/I6YNDloUmyUO0G++k5DLd65oiAkDkRYPikq1EXZyMxfrgORe0y2oZRhOcjnylMhDWkMyw== X-Received: by 10.223.160.157 with SMTP id m29mr13813657wrm.119.1520284777172; Mon, 05 Mar 2018 13:19:37 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: "Michael S . Tsirkin" , Paolo Bonzini , =?UTF-8?q?Herv=C3=A9=20Poussineau?= , Marcel Apfelbaum , Aurelien Jarno , Mark Cave-Ayland , Alexey Kardashevskiy , Thomas Huth Date: Mon, 5 Mar 2018 18:19:07 -0300 Message-Id: <20180305211928.466-2-f4bug@amsat.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180305211928.466-1-f4bug@amsat.org> References: <20180305211928.466-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: 2a00:1450:400c:c0c::243 Subject: [Qemu-devel] [RFC PATCH v2 01/22] hw/isa: Move parallel_hds_isa_init() to hw/char/parallel-isa.c 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 , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , qemu-devel@nongnu.org, Guan Xuetao , Yongbok Kim , Artyom Tarasenko , 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 Again... (after 07dc788054d7 and 9157eee1b1c0). We now extract the ISA bus specific helpers. Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- include/hw/char/parallel.h | 14 ++++++++++++++ include/hw/i386/pc.h | 8 -------- hw/char/parallel-isa.c | 36 ++++++++++++++++++++++++++++++++++++ hw/char/parallel.c | 2 +- hw/i386/pc.c | 1 + hw/isa/isa-bus.c | 26 -------------------------- hw/mips/mips_fulong2e.c | 1 + hw/mips/mips_jazz.c | 1 + hw/mips/mips_malta.c | 1 + hw/sparc64/sun4u.c | 1 + MAINTAINERS | 3 ++- hw/char/Makefile.objs | 1 + 12 files changed, 59 insertions(+), 36 deletions(-) create mode 100644 include/hw/char/parallel.h create mode 100644 hw/char/parallel-isa.c diff --git a/include/hw/char/parallel.h b/include/hw/char/parallel.h new file mode 100644 index 0000000000..d6dd62fb9f --- /dev/null +++ b/include/hw/char/parallel.h @@ -0,0 +1,14 @@ +#ifndef HW_PARALLEL_H +#define HW_PARALLEL_H + +#include "exec/memory.h" +#include "hw/isa/isa.h" +#include "chardev/char.h" + +void parallel_hds_isa_init(ISABus *bus, int n); + +bool parallel_mm_init(MemoryRegion *address_space, + hwaddr base, int it_shift, qemu_irq irq, + Chardev *chr); + +#endif diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h index bb49165fe0..f1feb18c3c 100644 --- a/include/hw/i386/pc.h +++ b/include/hw/i386/pc.h @@ -151,14 +151,6 @@ struct PCMachineClass { #define PC_MACHINE_CLASS(klass) \ OBJECT_CLASS_CHECK(PCMachineClass, (klass), TYPE_PC_MACHINE) =20 -/* parallel.c */ - -void parallel_hds_isa_init(ISABus *bus, int n); - -bool parallel_mm_init(MemoryRegion *address_space, - hwaddr base, int it_shift, qemu_irq irq, - Chardev *chr); - /* i8259.c */ =20 extern DeviceState *isa_pic; diff --git a/hw/char/parallel-isa.c b/hw/char/parallel-isa.c new file mode 100644 index 0000000000..639e179585 --- /dev/null +++ b/hw/char/parallel-isa.c @@ -0,0 +1,36 @@ +/* + * QEMU Parallel PORT (ISA bus helpers) + * + * Copyright (c) 2003 Fabrice Bellard + * + * SPDX-License-Identifier: MIT + */ +#include "qemu/osdep.h" +#include "sysemu/sysemu.h" +#include "hw/isa/isa.h" +#include "hw/char/parallel.h" + +static void parallel_init(ISABus *bus, int index, Chardev *chr) +{ + DeviceState *dev; + ISADevice *isadev; + + isadev =3D isa_create(bus, "isa-parallel"); + dev =3D DEVICE(isadev); + qdev_prop_set_uint32(dev, "index", index); + qdev_prop_set_chr(dev, "chardev", chr); + qdev_init_nofail(dev); +} + +void parallel_hds_isa_init(ISABus *bus, int n) +{ + int i; + + assert(n <=3D MAX_PARALLEL_PORTS); + + for (i =3D 0; i < n; i++) { + if (parallel_hds[i]) { + parallel_init(bus, i, parallel_hds[i]); + } + } +} diff --git a/hw/char/parallel.c b/hw/char/parallel.c index f79dc76543..1542d62201 100644 --- a/hw/char/parallel.c +++ b/hw/char/parallel.c @@ -28,7 +28,7 @@ #include "chardev/char-parallel.h" #include "chardev/char-fe.h" #include "hw/isa/isa.h" -#include "hw/i386/pc.h" +#include "hw/char/parallel.h" #include "sysemu/sysemu.h" =20 //#define DEBUG_PARALLEL diff --git a/hw/i386/pc.c b/hw/i386/pc.c index 94cfd40ef2..404bb39ffd 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -26,6 +26,7 @@ #include "hw/hw.h" #include "hw/i386/pc.h" #include "hw/char/serial.h" +#include "hw/char/parallel.h" #include "hw/i386/apic.h" #include "hw/i386/topology.h" #include "sysemu/cpus.h" diff --git a/hw/isa/isa-bus.c b/hw/isa/isa-bus.c index 0f2e426d02..63fa77effc 100644 --- a/hw/isa/isa-bus.c +++ b/hw/isa/isa-bus.c @@ -24,7 +24,6 @@ #include "hw/sysbus.h" #include "sysemu/sysemu.h" #include "hw/isa/isa.h" -#include "hw/i386/pc.h" =20 static ISABus *isabus; =20 @@ -288,28 +287,3 @@ MemoryRegion *isa_address_space_io(ISADevice *dev) } =20 type_init(isabus_register_types) - -static void parallel_init(ISABus *bus, int index, Chardev *chr) -{ - DeviceState *dev; - ISADevice *isadev; - - isadev =3D isa_create(bus, "isa-parallel"); - dev =3D DEVICE(isadev); - qdev_prop_set_uint32(dev, "index", index); - qdev_prop_set_chr(dev, "chardev", chr); - qdev_init_nofail(dev); -} - -void parallel_hds_isa_init(ISABus *bus, int n) -{ - int i; - - assert(n <=3D MAX_PARALLEL_PORTS); - - for (i =3D 0; i < n; i++) { - if (parallel_hds[i]) { - parallel_init(bus, i, parallel_hds[i]); - } - } -} diff --git a/hw/mips/mips_fulong2e.c b/hw/mips/mips_fulong2e.c index f68c625666..dc77b55755 100644 --- a/hw/mips/mips_fulong2e.c +++ b/hw/mips/mips_fulong2e.c @@ -23,6 +23,7 @@ #include "hw/hw.h" #include "hw/i386/pc.h" #include "hw/char/serial.h" +#include "hw/char/parallel.h" #include "hw/block/fdc.h" #include "net/net.h" #include "hw/boards.h" diff --git a/hw/mips/mips_jazz.c b/hw/mips/mips_jazz.c index b09871a814..b24305b7b4 100644 --- a/hw/mips/mips_jazz.c +++ b/hw/mips/mips_jazz.c @@ -28,6 +28,7 @@ #include "hw/mips/cpudevs.h" #include "hw/i386/pc.h" #include "hw/char/serial.h" +#include "hw/char/parallel.h" #include "hw/isa/isa.h" #include "hw/block/fdc.h" #include "sysemu/sysemu.h" diff --git a/hw/mips/mips_malta.c b/hw/mips/mips_malta.c index 6f0deb99e7..c74882c7e9 100644 --- a/hw/mips/mips_malta.c +++ b/hw/mips/mips_malta.c @@ -28,6 +28,7 @@ #include "hw/hw.h" #include "hw/i386/pc.h" #include "hw/char/serial.h" +#include "hw/char/parallel.h" #include "hw/block/fdc.h" #include "net/net.h" #include "hw/boards.h" diff --git a/hw/sparc64/sun4u.c b/hw/sparc64/sun4u.c index da28ab9413..ceb1ba7eaf 100644 --- a/hw/sparc64/sun4u.c +++ b/hw/sparc64/sun4u.c @@ -34,6 +34,7 @@ #include "hw/pci-host/sabre.h" #include "hw/i386/pc.h" #include "hw/char/serial.h" +#include "hw/char/parallel.h" #include "hw/timer/m48t59.h" #include "hw/block/fdc.h" #include "net/net.h" diff --git a/MAINTAINERS b/MAINTAINERS index b7c4130388..c0f1620f3a 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -913,7 +913,7 @@ M: Michael S. Tsirkin M: Paolo Bonzini S: Supported F: hw/char/debugcon.c -F: hw/char/parallel.c +F: hw/char/parallel* F: hw/char/serial* F: hw/dma/i8257* F: hw/i2c/pm_smbus.c @@ -928,6 +928,7 @@ F: hw/timer/i8254* F: hw/timer/mc146818rtc* F: hw/watchdog/wdt_ib700.c F: include/hw/display/vga.h +F: include/hw/char/parallel.h F: include/hw/i2c/pm_smbus.h F: include/hw/isa/i8257.h F: include/hw/timer/hpet.h diff --git a/hw/char/Makefile.objs b/hw/char/Makefile.objs index 1bcd37e98d..1b979100b7 100644 --- a/hw/char/Makefile.objs +++ b/hw/char/Makefile.objs @@ -1,6 +1,7 @@ common-obj-$(CONFIG_IPACK) +=3D ipoctal232.o common-obj-$(CONFIG_ESCC) +=3D escc.o common-obj-$(CONFIG_PARALLEL) +=3D parallel.o +common-obj-$(CONFIG_PARALLEL) +=3D parallel-isa.o common-obj-$(CONFIG_PL011) +=3D pl011.o common-obj-$(CONFIG_SERIAL) +=3D serial.o common-obj-$(CONFIG_SERIAL_ISA) +=3D serial-isa.o --=20 2.16.2