From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54073) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YcHOz-00025B-Nr for qemu-devel@nongnu.org; Sun, 29 Mar 2015 13:53:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YcHOt-0003WN-9b for qemu-devel@nongnu.org; Sun, 29 Mar 2015 13:53:37 -0400 From: =?UTF-8?q?Andreas=20F=C3=A4rber?= Date: Sun, 29 Mar 2015 19:53:16 +0200 Message-Id: <1427651603-9210-2-git-send-email-afaerber@suse.de> In-Reply-To: <1427651603-9210-1-git-send-email-afaerber@suse.de> References: <1427651603-9210-1-git-send-email-afaerber@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PATCH RFC for-2.3? 1/8] parallel: Factor out header for ISAParallelState struct List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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, =?UTF-8?q?Andreas=20F=C3=A4rber?= To be used for embedding the device. Add gtk-doc private/public markers for parent field. Signed-off-by: Andreas F=C3=A4rber --- 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" =20 @@ -64,34 +64,6 @@ =20 #define PARA_CTR_SIGNAL (PARA_CTR_SELECT|PARA_CTR_INIT|PARA_CTR_AUTOLF|P= ARA_CTR_STROBE) =20 -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; =20 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 includ= ed in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRE= SS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILI= TY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHA= LL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR = OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISI= NG FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALING= S 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 --=20 2.1.4