From patchwork Sat Nov 24 17:00:15 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peng Hao X-Patchwork-Id: 10696473 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E70DD5A4 for ; Sat, 24 Nov 2018 08:44:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D84F82AEA7 for ; Sat, 24 Nov 2018 08:44:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CC2E82AED0; Sat, 24 Nov 2018 08:44:46 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.0 required=2.0 tests=BAYES_00,DATE_IN_FUTURE_06_12, MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 634122AEA7 for ; Sat, 24 Nov 2018 08:44:46 +0000 (UTC) Received: from localhost ([::1]:55730 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gQTYT-0006M4-Ak for patchwork-qemu-devel@patchwork.kernel.org; Sat, 24 Nov 2018 03:44:45 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52520) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gQTU9-0002ZA-5d for qemu-devel@nongnu.org; Sat, 24 Nov 2018 03:40:21 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gQTSe-0000PA-1l for qemu-devel@nongnu.org; Sat, 24 Nov 2018 03:38:44 -0500 Received: from mxhk.zte.com.cn ([63.217.80.70]:17068) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gQTSZ-0000B4-5L; Sat, 24 Nov 2018 03:38:39 -0500 Received: from mse01.zte.com.cn (unknown [10.30.3.20]) by Forcepoint Email with ESMTPS id 174ACB70F3C75C59699A; Sat, 24 Nov 2018 16:38:37 +0800 (CST) Received: from notes_smtp.zte.com.cn ([10.30.1.239]) by mse01.zte.com.cn with ESMTP id wAO8cTHm035015; Sat, 24 Nov 2018 16:38:29 +0800 (GMT-8) (envelope-from peng.hao2@zte.com.cn) Received: from localhost.localdomain.localdomain ([10.74.120.59]) by szsmtp06.zte.com.cn (Lotus Domino Release 8.5.3FP6) with ESMTP id 2018112416391610-12702401 ; Sat, 24 Nov 2018 16:39:16 +0800 From: Peng Hao To: peter.maydell@linaro.org, drjones@redhat.com, philmd@redhat.com Date: Sun, 25 Nov 2018 01:00:15 +0800 Message-Id: <1543078821-16636-5-git-send-email-peng.hao2@zte.com.cn> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1543078821-16636-1-git-send-email-peng.hao2@zte.com.cn> References: <1543078821-16636-1-git-send-email-peng.hao2@zte.com.cn> X-MIMETrack: Itemize by SMTP Server on SZSMTP06/server/zte_ltd(Release 8.5.3FP6|November 21, 2013) at 2018-11-24 16:39:16, Serialize by Router on notes_smtp/zte_ltd(Release 9.0.1FP7|August 17, 2016) at 2018-11-24 16:38:10, Serialize complete at 2018-11-24 16:38:10 X-MAIL: mse01.zte.com.cn wAO8cTHm035015 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 63.217.80.70 Subject: [Qemu-devel] [PATCH V8 04/10] hw/misc/pvpanic: moving structure definition to header file 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: Peng Hao , qemu-arm@nongnu.org, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP Move structure definition to header file uniformly Signed-off-by: Peng Hao --- hw/misc/pvpanic.c | 16 ---------------- include/hw/misc/pvpanic.h | 15 +++++++++++++++ 2 files changed, 15 insertions(+), 16 deletions(-) diff --git a/hw/misc/pvpanic.c b/hw/misc/pvpanic.c index 2bcbfc5..aaa8b0c 100644 --- a/hw/misc/pvpanic.c +++ b/hw/misc/pvpanic.c @@ -27,9 +27,6 @@ /* The pv event value */ #define PVPANIC_PANICKED (1 << PVPANIC_F_PANICKED) -#define PVPANIC_ISA_DEVICE(obj) \ - OBJECT_CHECK(PVPanicISAState, (obj), TYPE_PVPANIC) - static void handle_event(int event) { static bool logged; @@ -45,19 +42,6 @@ static void handle_event(int event) } } -#include "hw/isa/isa.h" - -/* PVPanicISAState for ISA device and - * use ioport. - */ -typedef struct PVPanicISAState { - ISADevice parent_obj; - /*< private>*/ - uint16_t ioport; - /**/ - MemoryRegion mr; -} PVPanicISAState; - /* return supported events on read */ static uint64_t pvpanic_read(void *opaque, hwaddr addr, unsigned size) { diff --git a/include/hw/misc/pvpanic.h b/include/hw/misc/pvpanic.h index 66dbdfe..066c707 100644 --- a/include/hw/misc/pvpanic.h +++ b/include/hw/misc/pvpanic.h @@ -13,12 +13,24 @@ */ #ifndef HW_MISC_PVPANIC_H #define HW_MISC_PVPANIC_H +#include "hw/isa/isa.h" #define TYPE_PVPANIC "pvpanic" #define TYPE_PVPANIC_MMIO "pvpanic-mmio" #define PVPANIC_IOPORT_PROP "ioport" +/* PVPanicISAState for ISA device and + * use ioport. + */ +typedef struct PVPanicISAState { + ISADevice parent_obj; + /*< private>*/ + uint16_t ioport; + /**/ + MemoryRegion mr; +} PVPanicISAState; + /* PVPanicMMIOState for sysbus device and * use mmio. */ @@ -30,6 +42,9 @@ typedef struct PVPanicMMIOState { MemoryRegion mr; } PVPanicMMIOState; +#define PVPANIC_ISA_DEVICE(obj) \ + OBJECT_CHECK(PVPanicISAState, (obj), TYPE_PVPANIC) + #define PVPANIC_MMIO_DEVICE(obj) \ OBJECT_CHECK(PVPanicMMIOState, (obj), TYPE_PVPANIC_MMIO)