From: "Andreas Färber" <afaerber@suse.de>
To: qemu-devel@nongnu.org
Cc: mark.cave-ayland@ilande.co.uk, armbru@redhat.com,
hpoussin@reactos.org, qemu-ppc@nongnu.org, jsnow@redhat.com,
"Andreas Färber" <afaerber@suse.de>
Subject: [Qemu-devel] [PATCH RFC for-2.3? 1/8] parallel: Factor out header for ISAParallelState struct
Date: Sun, 29 Mar 2015 19:53:16 +0200 [thread overview]
Message-ID: <1427651603-9210-2-git-send-email-afaerber@suse.de> (raw)
In-Reply-To: <1427651603-9210-1-git-send-email-afaerber@suse.de>
To be used for embedding the device.
Add gtk-doc private/public markers for parent field.
Signed-off-by: Andreas Färber <afaerber@suse.de>
---
hw/char/parallel.c | 30 +---------------------
include/hw/char/parallel.h | 62 ++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 63 insertions(+), 29 deletions(-)
create mode 100644 include/hw/char/parallel.h
diff --git a/hw/char/parallel.c b/hw/char/parallel.c
index 4079554..fcb3764 100644
--- a/hw/char/parallel.c
+++ b/hw/char/parallel.c
@@ -24,7 +24,7 @@
*/
#include "hw/hw.h"
#include "sysemu/char.h"
-#include "hw/isa/isa.h"
+#include "hw/char/parallel.h"
#include "hw/i386/pc.h"
#include "sysemu/sysemu.h"
@@ -64,34 +64,6 @@
#define PARA_CTR_SIGNAL (PARA_CTR_SELECT|PARA_CTR_INIT|PARA_CTR_AUTOLF|PARA_CTR_STROBE)
-typedef struct ParallelState {
- MemoryRegion iomem;
- uint8_t dataw;
- uint8_t datar;
- uint8_t status;
- uint8_t control;
- qemu_irq irq;
- int irq_pending;
- CharDriverState *chr;
- int hw_driver;
- int epp_timeout;
- uint32_t last_read_offset; /* For debugging */
- /* Memory-mapped interface */
- int it_shift;
-} ParallelState;
-
-#define TYPE_ISA_PARALLEL "isa-parallel"
-#define ISA_PARALLEL(obj) \
- OBJECT_CHECK(ISAParallelState, (obj), TYPE_ISA_PARALLEL)
-
-typedef struct ISAParallelState {
- ISADevice parent_obj;
-
- uint32_t index;
- uint32_t iobase;
- uint32_t isairq;
- ParallelState state;
-} ISAParallelState;
static void parallel_update_irq(ParallelState *s)
{
diff --git a/include/hw/char/parallel.h b/include/hw/char/parallel.h
new file mode 100644
index 0000000..b20e403
--- /dev/null
+++ b/include/hw/char/parallel.h
@@ -0,0 +1,62 @@
+/*
+ * QEMU Parallel PORT emulation
+ *
+ * Copyright (c) 2003-2005 Fabrice Bellard
+ * Copyright (c) 2007 Marko Kohtala
+ * Copyright (c) 2015 SUSE Linux GmbH
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * 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 OTHER
+ * 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.
+ */
+#ifndef HW_CHAR_PARALLEL_H
+#define HW_CHAR_PARALLEL_H
+
+#include "hw/isa/isa.h"
+
+typedef struct ParallelState {
+ MemoryRegion iomem;
+ uint8_t dataw;
+ uint8_t datar;
+ uint8_t status;
+ uint8_t control;
+ qemu_irq irq;
+ int irq_pending;
+ CharDriverState *chr;
+ int hw_driver;
+ int epp_timeout;
+ uint32_t last_read_offset; /* For debugging */
+ /* Memory-mapped interface */
+ int it_shift;
+} ParallelState;
+
+#define TYPE_ISA_PARALLEL "isa-parallel"
+#define ISA_PARALLEL(obj) \
+ OBJECT_CHECK(ISAParallelState, (obj), TYPE_ISA_PARALLEL)
+
+typedef struct ISAParallelState {
+ /*< private >*/
+ ISADevice parent_obj;
+ /*< public >*/
+
+ uint32_t index;
+ uint32_t iobase;
+ uint32_t isairq;
+ ParallelState state;
+} ISAParallelState;
+
+#endif
--
2.1.4
next prev parent reply other threads:[~2015-03-29 17:53 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-29 17:53 [Qemu-devel] [PATCH RFC for-2.3? 0/8] prep: Fix pc87312 for -device usage Andreas Färber
2015-03-29 17:53 ` Andreas Färber [this message]
2015-03-29 17:53 ` [Qemu-devel] [PATCH RFC for-2.3? 2/8] pc87312: Create isa-parallel in-place and add alias par0-chardev property Andreas Färber
2015-03-30 14:12 ` Markus Armbruster
2015-03-30 14:36 ` Andreas Färber
2015-03-29 17:53 ` [Qemu-devel] [PATCH RFC for-2.3? 3/8] serial: Move ISASerialState to header Andreas Färber
2015-03-29 17:53 ` [Qemu-devel] [PATCH RFC for-2.3? 4/8] pc87312: Create UARTs in-place and add alias properties Andreas Färber
2015-03-29 17:53 ` [Qemu-devel] [PATCH RFC for-2.3? 5/8] fdb: Move FDCtrlISABus to header Andreas Färber
2015-03-31 1:38 ` John Snow
2015-05-19 13:02 ` Andreas Färber
2015-05-19 15:40 ` John Snow
2015-03-29 17:53 ` [Qemu-devel] [PATCH RFC for-2.3? 6/8] pc87312: Create FDC in-place Andreas Färber
2015-03-29 17:53 ` [Qemu-devel] [PATCH RFC for-2.3? 7/8] ide: Move ISAIDEState to header Andreas Färber
2015-03-29 17:53 ` [Qemu-devel] [PATCH RFC for-2.3? 8/8] pc87312: Create IDE in-place Andreas Färber
2015-03-30 14:25 ` [Qemu-devel] [PATCH RFC for-2.3? 0/8] prep: Fix pc87312 for -device usage Markus Armbruster
2015-03-30 16:12 ` Paolo Bonzini
2015-03-30 16:18 ` Andreas Färber
2015-03-30 18:09 ` Markus Armbruster
2015-03-30 16:42 ` Markus Armbruster
2015-03-30 17:49 ` Andreas Färber
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=1427651603-9210-2-git-send-email-afaerber@suse.de \
--to=afaerber@suse.de \
--cc=armbru@redhat.com \
--cc=hpoussin@reactos.org \
--cc=jsnow@redhat.com \
--cc=mark.cave-ayland@ilande.co.uk \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@nongnu.org \
/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).