]>
Commit | Line | Data |
---|---|---|
0d5d8a3a PMD |
1 | /* |
2 | * QEMU simulated pvpanic device. | |
3 | * | |
4 | * Copyright Fujitsu, Corp. 2013 | |
5 | * | |
6 | * Authors: | |
7 | * Wen Congyang <wency@cn.fujitsu.com> | |
8 | * Hu Tao <hutao@cn.fujitsu.com> | |
9 | * | |
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. | |
12 | * | |
13 | */ | |
ec150c7e | 14 | |
0d5d8a3a PMD |
15 | #ifndef HW_MISC_PVPANIC_H |
16 | #define HW_MISC_PVPANIC_H | |
17 | ||
ec150c7e MA |
18 | #include "qom/object.h" |
19 | ||
677726ef | 20 | #define TYPE_PVPANIC_ISA_DEVICE "pvpanic" |
d097b3dc | 21 | #define TYPE_PVPANIC_PCI_DEVICE "pvpanic-pci" |
0d5d8a3a | 22 | |
c0b5be52 JQ |
23 | #define PVPANIC_IOPORT_PROP "ioport" |
24 | ||
677726ef MC |
25 | /* |
26 | * PVPanicState for any device type | |
27 | */ | |
28 | typedef struct PVPanicState PVPanicState; | |
29 | struct PVPanicState { | |
30 | MemoryRegion mr; | |
31 | uint8_t events; | |
32 | }; | |
33 | ||
34 | void pvpanic_setup_io(PVPanicState *s, DeviceState *dev, unsigned size); | |
35 | ||
c0b5be52 JQ |
36 | static inline uint16_t pvpanic_port(void) |
37 | { | |
677726ef | 38 | Object *o = object_resolve_path_type("", TYPE_PVPANIC_ISA_DEVICE, NULL); |
c0b5be52 JQ |
39 | if (!o) { |
40 | return 0; | |
41 | } | |
42 | return object_property_get_uint(o, PVPANIC_IOPORT_PROP, NULL); | |
43 | } | |
0d5d8a3a PMD |
44 | |
45 | #endif |