aboutsummaryrefslogtreecommitdiff
path: root/include/hw/misc/pvpanic.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/hw/misc/pvpanic.h')
-rw-r--r--include/hw/misc/pvpanic.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/include/hw/misc/pvpanic.h b/include/hw/misc/pvpanic.h
index 36a54e270c..1ee071a703 100644
--- a/include/hw/misc/pvpanic.h
+++ b/include/hw/misc/pvpanic.h
@@ -16,6 +16,15 @@
#define TYPE_PVPANIC "pvpanic"
-uint16_t pvpanic_port(void);
+#define PVPANIC_IOPORT_PROP "ioport"
+
+static inline uint16_t pvpanic_port(void)
+{
+ Object *o = object_resolve_path_type("", TYPE_PVPANIC, NULL);
+ if (!o) {
+ return 0;
+ }
+ return object_property_get_uint(o, PVPANIC_IOPORT_PROP, NULL);
+}
#endif