@@ -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;
- /*<public>*/
- MemoryRegion mr;
-} PVPanicISAState;
-
/* return supported events on read */
static uint64_t pvpanic_read(void *opaque, hwaddr addr, unsigned size)
{
@@ -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;
+ /*<public>*/
+ 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)
Move structure definition to header file uniformly Signed-off-by: Peng Hao <peng.hao2@zte.com.cn> --- hw/misc/pvpanic.c | 16 ---------------- include/hw/misc/pvpanic.h | 15 +++++++++++++++ 2 files changed, 15 insertions(+), 16 deletions(-)