xref: /openbmc/qemu/include/hw/misc/pvpanic.h (revision a68694cd)
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  */
14 
15 #ifndef HW_MISC_PVPANIC_H
16 #define HW_MISC_PVPANIC_H
17 
18 #include "qom/object.h"
19 
20 #define TYPE_PVPANIC "pvpanic"
21 
22 #define PVPANIC_IOPORT_PROP "ioport"
23 
24 static inline uint16_t pvpanic_port(void)
25 {
26     Object *o = object_resolve_path_type("", TYPE_PVPANIC, NULL);
27     if (!o) {
28         return 0;
29     }
30     return object_property_get_uint(o, PVPANIC_IOPORT_PROP, NULL);
31 }
32 
33 #endif
34