hw/arm/xlnx-zynqmp: Remove obsolete 'has_rpu' property
[qemu/ar7.git] / include / hw / misc / pvpanic.h
blobca3c5bb5330b53e7eb160dad6541bbd17956afad
1 /*
2 * QEMU simulated pvpanic device.
4 * Copyright Fujitsu, Corp. 2013
6 * Authors:
7 * Wen Congyang <wency@cn.fujitsu.com>
8 * Hu Tao <hutao@cn.fujitsu.com>
10 * This work is licensed under the terms of the GNU GPL, version 2 or later.
11 * See the COPYING file in the top-level directory.
15 #ifndef HW_MISC_PVPANIC_H
16 #define HW_MISC_PVPANIC_H
18 #include "qom/object.h"
20 #define TYPE_PVPANIC_ISA_DEVICE "pvpanic"
21 #define TYPE_PVPANIC_PCI_DEVICE "pvpanic-pci"
23 #define PVPANIC_IOPORT_PROP "ioport"
25 /* The bit of supported pv event, TODO: include uapi header and remove this */
26 #define PVPANIC_F_PANICKED 0
27 #define PVPANIC_F_CRASHLOADED 1
29 /* The pv event value */
30 #define PVPANIC_PANICKED (1 << PVPANIC_F_PANICKED)
31 #define PVPANIC_CRASHLOADED (1 << PVPANIC_F_CRASHLOADED)
34 * PVPanicState for any device type
36 typedef struct PVPanicState PVPanicState;
37 struct PVPanicState {
38 MemoryRegion mr;
39 uint8_t events;
42 void pvpanic_setup_io(PVPanicState *s, DeviceState *dev, unsigned size);
44 static inline uint16_t pvpanic_port(void)
46 Object *o = object_resolve_path_type("", TYPE_PVPANIC_ISA_DEVICE, NULL);
47 if (!o) {
48 return 0;
50 return object_property_get_uint(o, PVPANIC_IOPORT_PROP, NULL);
53 #endif