qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <f4bug@amsat.org>
To: "Paolo Bonzini" <pbonzini@redhat.com>,
	"Michael S. Tsirkin" <mst@redhat.com>,
	"Hervé Poussineau" <hpoussin@reactos.org>,
	"Aurelien Jarno" <aurelien@aurel32.net>,
	"Eduardo Habkost" <ehabkost@redhat.com>,
	"Marcel Apfelbaum" <marcel@redhat.com>
Cc: "Philippe Mathieu-Daudé" <f4bug@amsat.org>,
	qemu-devel@nongnu.org, "Igor Mammedov" <imammedo@redhat.com>,
	"Richard Henderson" <rth@twiddle.net>,
	"Yongbok Kim" <yongbok.kim@mips.com>,
	"Mark Cave-Ayland" <mark.cave-ayland@ilande.co.uk>,
	"Artyom Tarasenko" <atar4qemu@gmail.com>
Subject: [Qemu-devel] [PATCH 03/29] hw/isa: extract parallel-isa specific code
Date: Sun,  7 Jan 2018 23:45:32 -0300	[thread overview]
Message-ID: <20180108024558.17983-4-f4bug@amsat.org> (raw)
In-Reply-To: <20180108024558.17983-1-f4bug@amsat.org>

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
 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)
 
-/* 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 */
 
 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 = isa_create(bus, "isa-parallel");
+    dev = 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 <= MAX_PARALLEL_PORTS);
+
+    for (i = 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"
 
 //#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"
 
 static ISABus *isabus;
 
@@ -287,28 +286,3 @@ MemoryRegion *isa_address_space_io(ISADevice *dev)
 }
 
 type_init(isabus_register_types)
-
-static void parallel_init(ISABus *bus, int index, Chardev *chr)
-{
-    DeviceState *dev;
-    ISADevice *isadev;
-
-    isadev = isa_create(bus, "isa-parallel");
-    dev = 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 <= MAX_PARALLEL_PORTS);
-
-    for (i = 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 <mst@redhat.com>
 M: Paolo Bonzini <pbonzini@redhat.com>
 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) += ipoctal232.o
 common-obj-$(CONFIG_ESCC) += escc.o
 common-obj-$(CONFIG_PARALLEL) += parallel.o
+common-obj-$(CONFIG_PARALLEL) += parallel-isa.o
 common-obj-$(CONFIG_PL011) += pl011.o
 common-obj-$(CONFIG_SERIAL) += serial.o
 common-obj-$(CONFIG_SERIAL_ISA) += serial-isa.o
-- 
2.15.1

  parent reply	other threads:[~2018-01-08  2:46 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-08  2:45 [Qemu-devel] [RFC PATCH 00/29] remove i386/pc dependency: generic SuperIO, PIIX cleanup Philippe Mathieu-Daudé
2018-01-08  2:45 ` [Qemu-devel] [PATCH 01/29] hw/acpi: add mem/nvdimm.h dependency Philippe Mathieu-Daudé
2018-01-08  2:45 ` [Qemu-devel] [PATCH 02/29] pci/pci_host: move generic definitions out of i386/pc.h Philippe Mathieu-Daudé
2018-01-08  2:45 ` Philippe Mathieu-Daudé [this message]
2018-01-08  2:45 ` [Qemu-devel] [PATCH 04/29] hw/dma/i8257: rename DMA_init() to i8257_dma_init() Philippe Mathieu-Daudé
2018-01-08  2:45 ` [Qemu-devel] [PATCH 05/29] hw/input/i8042: extract declarations from i386/pc.h into input/i8042.h Philippe Mathieu-Daudé
2018-01-08  2:54   ` David Gibson
2018-01-08  2:45 ` [Qemu-devel] [PATCH 06/29] hw/isa: add a generic isa_superio_init() Philippe Mathieu-Daudé
2018-01-14 18:22   ` Philippe Mathieu-Daudé
2018-01-08  2:45 ` [Qemu-devel] [PATCH 07/29] hw/i386/pc: use isa_superio_init() Philippe Mathieu-Daudé
2018-01-08  2:45 ` [Qemu-devel] [PATCH 08/29] hw/mips/fulong2e: " Philippe Mathieu-Daudé
2018-01-08  2:45 ` [Qemu-devel] [PATCH 09/29] hw/mips/malta: code movement Philippe Mathieu-Daudé
2018-01-08  2:45 ` [Qemu-devel] [PATCH 10/29] hw/mips/malta: add fdc37m81x_init() which uses isa_superio_init() Philippe Mathieu-Daudé
2018-01-08  2:45 ` [Qemu-devel] [PATCH 11/29] mc146818rtc: always register rtc to rtc list Philippe Mathieu-Daudé
2018-01-08  2:45 ` [Qemu-devel] [PATCH 12/29] piix4: rename some variables in realize function Philippe Mathieu-Daudé
2018-01-08  2:45 ` [Qemu-devel] [PATCH 13/29] piix4: convert reset function to QOM Philippe Mathieu-Daudé
2018-01-08  2:45 ` [Qemu-devel] [PATCH 14/29] piix4: add Reset Control Register Philippe Mathieu-Daudé
2018-01-08  2:45 ` [Qemu-devel] [PATCH 15/29] piix4: add a i8259 interrupt controller as specified in datasheet Philippe Mathieu-Daudé
2018-01-08  2:45 ` [Qemu-devel] [RFC PATCH 16/29] Revert "irq: introduce qemu_irq_proxy()" Philippe Mathieu-Daudé
2018-01-08  2:45 ` [Qemu-devel] [PATCH 17/29] piix: move piix4 declaration into new southbridge/i82371_piix.h Philippe Mathieu-Daudé
2018-01-08  2:45 ` [Qemu-devel] [PATCH 18/29] piix4: add a i8257 dma controller as specified in datasheet Philippe Mathieu-Daudé
2018-01-08  2:45 ` [Qemu-devel] [PATCH 19/29] piix4: add a i8254 pit " Philippe Mathieu-Daudé
2018-01-08  2:45 ` [Qemu-devel] [PATCH 20/29] piix4: add a speaker " Philippe Mathieu-Daudé
2018-01-08  2:45 ` [Qemu-devel] [PATCH 21/29] piix: move southbridge related declarations/definitions to i82371_piix.h Philippe Mathieu-Daudé
2018-01-08  2:45 ` [Qemu-devel] [PATCH 22/29] piix3: extract piix3_init() from i440fx_init() Philippe Mathieu-Daudé
2018-01-08  2:45 ` [Qemu-devel] [PATCH 23/29] hw/i386: extract i440fx related declarations/definitions to i440fx.h Philippe Mathieu-Daudé
2018-01-08  2:45 ` [Qemu-devel] [PATCH 24/29] hw/i386: extract i440fx code from piix.c into i440fx.c Philippe Mathieu-Daudé
2018-01-08  2:45 ` [Qemu-devel] [PATCH 25/29] hw/i386: move piix from hw/pci-host to hw/southbridge Philippe Mathieu-Daudé
2018-01-08  2:45 ` [Qemu-devel] [PATCH 26/29] configs/mips-softmmu: use common CONFIG_PCI_PIIX instead of CONFIG_PIIX4 Philippe Mathieu-Daudé
2018-01-08  2:45 ` [Qemu-devel] [PATCH 27/29] piix3: convert reset function to QOM Philippe Mathieu-Daudé
2018-01-08  2:45 ` [Qemu-devel] [PATCH 28/29] piix: merge common code from isa/piix4.c with southbridge piix3 Philippe Mathieu-Daudé
2018-01-08  2:45 ` [Qemu-devel] [NOTFORMERGE PATCH 29/29] piix4: add isa_superio_init Philippe Mathieu-Daudé

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180108024558.17983-4-f4bug@amsat.org \
    --to=f4bug@amsat.org \
    --cc=atar4qemu@gmail.com \
    --cc=aurelien@aurel32.net \
    --cc=ehabkost@redhat.com \
    --cc=hpoussin@reactos.org \
    --cc=imammedo@redhat.com \
    --cc=marcel@redhat.com \
    --cc=mark.cave-ayland@ilande.co.uk \
    --cc=mst@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=rth@twiddle.net \
    --cc=yongbok.kim@mips.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).