aboutsummaryrefslogtreecommitdiff
path: root/include/hw/isa/isa.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/hw/isa/isa.h')
-rw-r--r--include/hw/isa/isa.h11
1 files changed, 9 insertions, 2 deletions
diff --git a/include/hw/isa/isa.h b/include/hw/isa/isa.h
index cf7bd343c7..f21ceaafc6 100644
--- a/include/hw/isa/isa.h
+++ b/include/hw/isa/isa.h
@@ -21,10 +21,17 @@
#define ISA_BUS(obj) OBJECT_CHECK(ISABus, (obj), TYPE_ISA_BUS)
#define TYPE_APPLE_SMC "isa-applesmc"
+#define APPLESMC_MAX_DATA_LENGTH 32
+#define APPLESMC_PROP_IO_BASE "iobase"
-static inline bool applesmc_find(void)
+static inline uint16_t applesmc_port(void)
{
- return object_resolve_path_type("", TYPE_APPLE_SMC, NULL);
+ Object *obj = object_resolve_path_type("", TYPE_APPLE_SMC, NULL);
+
+ if (obj) {
+ return object_property_get_int(obj, APPLESMC_PROP_IO_BASE, NULL);
+ }
+ return 0;
}
typedef struct ISADeviceClass {