From nobody Tue Oct 28 12:16:35 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 15153798592041009.9547078683552; Sun, 7 Jan 2018 18:50:59 -0800 (PST) Received: from localhost ([::1]:59353 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eYNWc-0001cl-Cm for importer@patchew.org; Sun, 07 Jan 2018 21:50:58 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51215) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eYNS8-0006YA-JV for qemu-devel@nongnu.org; Sun, 07 Jan 2018 21:46:21 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eYNS5-0002GN-GT for qemu-devel@nongnu.org; Sun, 07 Jan 2018 21:46:20 -0500 Received: from mail-qt0-x241.google.com ([2607:f8b0:400d:c0d::241]:34501) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eYNS5-0002FZ-Ay for qemu-devel@nongnu.org; Sun, 07 Jan 2018 21:46:17 -0500 Received: by mail-qt0-x241.google.com with SMTP id 33so12078096qtv.1 for ; Sun, 07 Jan 2018 18:46:17 -0800 (PST) Received: from x1.local ([138.117.48.219]) by smtp.gmail.com with ESMTPSA id d10sm7156245qkg.16.2018.01.07.18.46.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 07 Jan 2018 18:46:16 -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=uEgVdjSGc95ojJ4vYAvP/LbuDkYLJZrulBhcByNi/7g=; b=f6npLLEIKiLkzMVnFE+aDNXhJPhvPAbDUbFkOvPfrRXPllbWz4kGf/3wEZIykF93HU wjel5734c4H1LMSUHwbh1Sn318d7GN7WPVYojh8vbQorpyjkutXxweszkAshMZrbnTml ym8+XfbrcAu+q7xjLLdgkAPL3OIPVFz4badMMdcn7Dh1ctZ60tesANR+PPRSJ82AEDuR 9w3pfvcX7tdYESsNwdjdFfaixQsk7iZ9o1dQFkNjTtIW6dKxsxFi1l2gauSQ9VCUnTTA a7vzof/I4cakiEWUaL2JOWoOzXwlSF7pTN6pnXVXbTlFnGarYQNAYxCaOq6t8SZU35gO p4lQ== 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=uEgVdjSGc95ojJ4vYAvP/LbuDkYLJZrulBhcByNi/7g=; b=Y4yYh+Kp5PncKrTJTzXgA196Or7zACj4TKo2gIVi7LFMj8qEbmcXleMB+XpknEOb8j ap/3svQzj8FS0ZCLg6w61m0tyEnUTDV+xbEprd9QWEL6l/KAHZIh4hYrvFDfisRWjbQZ cwXTTqBoGp1wvyEBGY/2gXD7nmxkr8pepDqcfiBhiusj5RDO8yHx+MWUCaGxai5dGIDu O0ktiLqo2H+V3obHN0Gf3XrQsZq98pc/qBAWxP8odpJaXSRy87woEExB7t8m2gNA5mt2 amy8A343wii76Yk8BVRFqb9nJtNdZbm0aExfL+sJJfzcurvw0G8k/M7rA25jodZyIU6y X+dA== X-Gm-Message-State: AKwxytdof0OU8yoE900CTZyhUInCI3VyeQARrgRDHy/OdTd+4JqoX10w M/EEkYOWx6tB68GxSl8cINM= X-Google-Smtp-Source: ACJfBotaFG1o7xGC7kbxwM+8MtLActx5RAqEFFoB8sYigAmbB94vgJhx7BY27mNz2FNNAPJP51J6ng== X-Received: by 10.200.40.115 with SMTP id 48mr15451896qtr.335.1515379576711; Sun, 07 Jan 2018 18:46:16 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: Paolo Bonzini , "Michael S. Tsirkin" , =?UTF-8?q?Herv=C3=A9=20Poussineau?= , Aurelien Jarno , Eduardo Habkost , Marcel Apfelbaum Date: Sun, 7 Jan 2018 23:45:32 -0300 Message-Id: <20180108024558.17983-4-f4bug@amsat.org> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20180108024558.17983-1-f4bug@amsat.org> References: <20180108024558.17983-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 03/29] hw/isa: extract parallel-isa specific code 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: Mark Cave-Ayland , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , qemu-devel@nongnu.org, Igor Mammedov , 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 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 | 29 +++++++++++++++++++++++++++++ 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, 52 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 780fa049d7..87a377011b 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..906a55a07d --- /dev/null +++ b/hw/char/parallel-isa.c @@ -0,0 +1,29 @@ +#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 3fcf318a95..6d3b2a8d1c 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -25,6 +25,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 348e0eab9d..0f732b5b58 100644 --- a/hw/isa/isa-bus.c +++ b/hw/isa/isa-bus.c @@ -23,7 +23,6 @@ #include "hw/sysbus.h" #include "sysemu/sysemu.h" #include "hw/isa/isa.h" -#include "hw/i386/pc.h" =20 static ISABus *isabus; =20 @@ -287,28 +286,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 725e25a134..d3c3a6ab61 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 0d2c0683ba..afb33beffd 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 37f19428d6..95d22288f4 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 1672f256e7..8bbc210fc8 100644 --- a/hw/sparc64/sun4u.c +++ b/hw/sparc64/sun4u.c @@ -31,6 +31,7 @@ #include "hw/pci-host/apb.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 73a5555735..f11c0386e9 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -867,7 +867,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 @@ -882,6 +882,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.15.1