aboutsummaryrefslogtreecommitdiff
path: root/include/hw/isa
diff options
context:
space:
mode:
authorIgor Mammedov <imammedo@redhat.com>2015-02-20 18:22:11 +0000
committerMichael S. Tsirkin <mst@redhat.com>2015-03-01 12:33:22 +0100
commit1142e45ffdc5bf76ae920a25495e13223f5d5ed2 (patch)
treeff1e161056fc115cb3dbe24ce24d67a5ebe2e12b /include/hw/isa
parent7056045332b997a8cd298e3bf231ecf690accdf4 (diff)
pc: export applesmc IO port/len
IO port and length will be used in following patch to correctly generate SMC ACPI device in SSDT. Signed-off-by: Igor Mammedov <imammedo@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'include/hw/isa')
-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 {