From: "Philippe Mathieu-Daudé" <philmd@linaro.org>
To: qemu-devel@nongnu.org
Cc: qemu-block@nongnu.org, "Bernhard Beschow" <shentey@gmail.com>,
"Mark Cave-Ayland" <mark.cave-ayland@ilande.co.uk>,
"Philippe Mathieu-Daudé" <philmd@linaro.org>
Subject: [PULL 14/17] hw/char/parallel-isa: Export struct ISAParallelState
Date: Tue, 13 Jun 2023 11:38:19 +0200 [thread overview]
Message-ID: <20230613093822.63750-15-philmd@linaro.org> (raw)
In-Reply-To: <20230613093822.63750-1-philmd@linaro.org>
From: Bernhard Beschow <shentey@gmail.com>
Allows the struct to be embedded directly into device models without additional
allocation.
Suggested-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Signed-off-by: Bernhard Beschow <shentey@gmail.com>
Reviewed-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-Id: <20230612081238.1742-3-shentey@gmail.com>
[PMD: Update MAINTAINERS entry and use SPDX license identifier]
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
MAINTAINERS | 2 +-
include/hw/char/parallel-isa.h | 30 ++++++++++++++++++++++++++++++
include/hw/char/parallel.h | 2 --
hw/char/parallel-isa.c | 1 +
hw/char/parallel.c | 12 +-----------
hw/i386/pc_piix.c | 2 +-
hw/i386/pc_q35.c | 2 +-
hw/isa/isa-superio.c | 1 +
hw/sparc64/sun4u.c | 2 +-
9 files changed, 37 insertions(+), 17 deletions(-)
create mode 100644 include/hw/char/parallel-isa.h
diff --git a/MAINTAINERS b/MAINTAINERS
index 4a80a38511..88b5a7ee0a 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -1740,7 +1740,7 @@ F: hw/rtc/mc146818rtc*
F: hw/watchdog/wdt_ib700.c
F: hw/watchdog/wdt_i6300esb.c
F: include/hw/display/vga.h
-F: include/hw/char/parallel.h
+F: include/hw/char/parallel*.h
F: include/hw/dma/i8257.h
F: include/hw/i2c/pm_smbus.h
F: include/hw/input/i8042.h
diff --git a/include/hw/char/parallel-isa.h b/include/hw/char/parallel-isa.h
new file mode 100644
index 0000000000..d24ccecf05
--- /dev/null
+++ b/include/hw/char/parallel-isa.h
@@ -0,0 +1,30 @@
+/*
+ * QEMU ISA Parallel PORT emulation
+ *
+ * Copyright (c) 2003-2005 Fabrice Bellard
+ * Copyright (c) 2007 Marko Kohtala
+ *
+ * SPDX-License-Identifier: MIT
+ */
+
+#ifndef HW_PARALLEL_ISA_H
+#define HW_PARALLEL_ISA_H
+
+#include "parallel.h"
+
+#include "hw/isa/isa.h"
+#include "qom/object.h"
+
+#define TYPE_ISA_PARALLEL "isa-parallel"
+OBJECT_DECLARE_SIMPLE_TYPE(ISAParallelState, ISA_PARALLEL)
+
+struct ISAParallelState {
+ ISADevice parent_obj;
+
+ uint32_t index;
+ uint32_t iobase;
+ uint32_t isairq;
+ ParallelState state;
+};
+
+#endif /* HW_PARALLEL_ISA_H */
diff --git a/include/hw/char/parallel.h b/include/hw/char/parallel.h
index 9f76edca81..7b5a309a03 100644
--- a/include/hw/char/parallel.h
+++ b/include/hw/char/parallel.h
@@ -25,8 +25,6 @@ typedef struct ParallelState {
PortioList portio_list;
} ParallelState;
-#define TYPE_ISA_PARALLEL "isa-parallel"
-
void parallel_hds_isa_init(ISABus *bus, int n);
bool parallel_mm_init(MemoryRegion *address_space,
diff --git a/hw/char/parallel-isa.c b/hw/char/parallel-isa.c
index 547ae69304..ab0f879998 100644
--- a/hw/char/parallel-isa.c
+++ b/hw/char/parallel-isa.c
@@ -13,6 +13,7 @@
#include "sysemu/sysemu.h"
#include "hw/isa/isa.h"
#include "hw/qdev-properties.h"
+#include "hw/char/parallel-isa.h"
#include "hw/char/parallel.h"
#include "qapi/error.h"
diff --git a/hw/char/parallel.c b/hw/char/parallel.c
index e75fc5019d..147c900f0d 100644
--- a/hw/char/parallel.c
+++ b/hw/char/parallel.c
@@ -31,6 +31,7 @@
#include "hw/qdev-properties.h"
#include "hw/qdev-properties-system.h"
#include "migration/vmstate.h"
+#include "hw/char/parallel-isa.h"
#include "hw/char/parallel.h"
#include "sysemu/reset.h"
#include "sysemu/sysemu.h"
@@ -73,17 +74,6 @@
#define PARA_CTR_SIGNAL (PARA_CTR_SELECT|PARA_CTR_INIT|PARA_CTR_AUTOLF|PARA_CTR_STROBE)
-OBJECT_DECLARE_SIMPLE_TYPE(ISAParallelState, ISA_PARALLEL)
-
-struct ISAParallelState {
- ISADevice parent_obj;
-
- uint32_t index;
- uint32_t iobase;
- uint32_t isairq;
- ParallelState state;
-};
-
static void parallel_update_irq(ParallelState *s)
{
if (s->irq_pending)
diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c
index 42af03dbb4..44146e6ff5 100644
--- a/hw/i386/pc_piix.c
+++ b/hw/i386/pc_piix.c
@@ -26,7 +26,7 @@
#include CONFIG_DEVICES
#include "qemu/units.h"
-#include "hw/char/parallel.h"
+#include "hw/char/parallel-isa.h"
#include "hw/dma/i8257.h"
#include "hw/loader.h"
#include "hw/i386/x86.h"
diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c
index 6155427e48..a9a59ed42b 100644
--- a/hw/i386/pc_q35.c
+++ b/hw/i386/pc_q35.c
@@ -30,7 +30,7 @@
#include "qemu/osdep.h"
#include "qemu/units.h"
-#include "hw/char/parallel.h"
+#include "hw/char/parallel-isa.h"
#include "hw/loader.h"
#include "hw/i2c/smbus_eeprom.h"
#include "hw/rtc/mc146818rtc.h"
diff --git a/hw/isa/isa-superio.c b/hw/isa/isa-superio.c
index 9292ec3bcf..7dbfc374da 100644
--- a/hw/isa/isa-superio.c
+++ b/hw/isa/isa-superio.c
@@ -21,6 +21,7 @@
#include "hw/isa/superio.h"
#include "hw/qdev-properties.h"
#include "hw/input/i8042.h"
+#include "hw/char/parallel-isa.h"
#include "hw/char/serial.h"
#include "trace.h"
diff --git a/hw/sparc64/sun4u.c b/hw/sparc64/sun4u.c
index e2858a0331..29e9b6cc26 100644
--- a/hw/sparc64/sun4u.c
+++ b/hw/sparc64/sun4u.c
@@ -35,7 +35,7 @@
#include "hw/qdev-properties.h"
#include "hw/pci-host/sabre.h"
#include "hw/char/serial.h"
-#include "hw/char/parallel.h"
+#include "hw/char/parallel-isa.h"
#include "hw/rtc/m48t59.h"
#include "migration/vmstate.h"
#include "hw/input/i8042.h"
--
2.38.1
next prev parent reply other threads:[~2023-06-13 11:40 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-13 9:38 [PULL 00/17] Misc patches for 2023-06-13 Philippe Mathieu-Daudé
2023-06-13 9:38 ` [PULL 01/17] linux-user, bsd-user: Preserve incoming order of environment variables in the target Philippe Mathieu-Daudé
2023-06-13 9:38 ` [PULL 02/17] cocoa: Fix warnings about invalid prototype declarations Philippe Mathieu-Daudé
2023-06-13 9:38 ` [PULL 03/17] util/cacheflush: Use declarations from <OSCacheControl.h> on Darwin Philippe Mathieu-Daudé
2023-06-13 9:38 ` [PULL 04/17] util/cacheflush: Avoid possible redundant dcache flush " Philippe Mathieu-Daudé
2023-06-13 9:38 ` [PULL 05/17] accel/hvf: Report HV_DENIED error Philippe Mathieu-Daudé
2023-06-13 9:38 ` [PULL 06/17] target/hppa/meson: Only build int_helper.o with system emulation Philippe Mathieu-Daudé
2023-06-13 9:38 ` [PULL 07/17] target/i386/helper: Remove do_cpu_sipi() stub for user-mode emulation Philippe Mathieu-Daudé
2023-06-13 9:38 ` [PULL 08/17] target/i386/helper: Shuffle do_cpu_init() Philippe Mathieu-Daudé
2023-06-13 9:38 ` [PULL 09/17] target/i386: Rename helper template headers as '.h.inc' Philippe Mathieu-Daudé
2023-06-13 9:38 ` [PULL 10/17] hw/i2c: Enable an id for the pca954x devices Philippe Mathieu-Daudé
2023-06-13 9:38 ` [PULL 11/17] hw/ide/ahci: Remove stray backslash Philippe Mathieu-Daudé
2023-06-13 9:38 ` [PULL 12/17] hw/scsi/megasas: Silent GCC duplicated-cond warning Philippe Mathieu-Daudé
2023-06-13 9:38 ` [PULL 13/17] hw/char/parallel: Export struct ParallelState Philippe Mathieu-Daudé
2023-06-13 9:38 ` Philippe Mathieu-Daudé [this message]
2023-06-13 9:38 ` [PULL 15/17] exec/ram_addr: Return number of dirty pages in cpu_physical_memory_set_dirty_lebitmap() Philippe Mathieu-Daudé
2023-06-13 9:38 ` [PULL 16/17] hw/vfio: Add number of dirty pages to vfio_get_dirty_bitmap tracepoint Philippe Mathieu-Daudé
2023-06-13 9:38 ` [PULL 17/17] exec/memory: Introduce RAM_NAMED_FILE flag Philippe Mathieu-Daudé
2023-06-14 4:39 ` [PULL 00/17] Misc patches for 2023-06-13 Richard Henderson
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=20230613093822.63750-15-philmd@linaro.org \
--to=philmd@linaro.org \
--cc=mark.cave-ayland@ilande.co.uk \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=shentey@gmail.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).