diff options
author | Michael S. Tsirkin <mst@redhat.com> | 2013-07-24 18:56:10 +0300 |
---|---|---|
committer | Michael S. Tsirkin <mst@redhat.com> | 2013-10-14 17:48:52 +0300 |
commit | 6f1426ab0fad715bccbad60e976ebf420442006c (patch) | |
tree | ad6fdb207a2d4994561592ac61263111b6a4dc6d /hw/acpi/ich9.c | |
parent | 277e9340e6a1b0a0e8e988d2f0ac82b18b695c0b (diff) | |
download | hqemu-6f1426ab0fad715bccbad60e976ebf420442006c.zip hqemu-6f1426ab0fad715bccbad60e976ebf420442006c.tar.gz |
ich9: APIs for pc guest info
This adds APIs that will be used to fill in
acpi tables, implemented using QOM,
to various ich9 components.
Some information is still missing in QOM,
so we fall back on lookups by type instead.
Reviewed-by: Gerd Hoffmann <kraxel@redhat.com>
Tested-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
Tested-by: Igor Mammedov <imammedo@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'hw/acpi/ich9.c')
-rw-r--r-- | hw/acpi/ich9.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/hw/acpi/ich9.c b/hw/acpi/ich9.c index 3fb443d..7e0429e 100644 --- a/hw/acpi/ich9.c +++ b/hw/acpi/ich9.c @@ -24,6 +24,7 @@ * GNU GPL, version 2 or (at your option) any later version. */ #include "hw/hw.h" +#include "qapi/visitor.h" #include "hw/i386/pc.h" #include "hw/pci/pci.h" #include "qemu/timer.h" @@ -228,3 +229,26 @@ void ich9_pm_init(PCIDevice *lpc_pci, ICH9LPCPMRegs *pm, pm->powerdown_notifier.notify = pm_powerdown_req; qemu_register_powerdown_notifier(&pm->powerdown_notifier); } + +static void ich9_pm_get_gpe0_blk(Object *obj, Visitor *v, + void *opaque, const char *name, + Error **errp) +{ + ICH9LPCPMRegs *pm = opaque; + uint32_t value = pm->pm_io_base + ICH9_PMIO_GPE0_STS; + + visit_type_uint32(v, &value, name, errp); +} + +void ich9_pm_add_properties(Object *obj, ICH9LPCPMRegs *pm, Error **errp) +{ + static const uint32_t gpe0_len = ICH9_PMIO_GPE0_LEN; + + object_property_add_uint32_ptr(obj, ACPI_PM_PROP_PM_IO_BASE, + &pm->pm_io_base, errp); + object_property_add(obj, ACPI_PM_PROP_GPE0_BLK, "uint32", + ich9_pm_get_gpe0_blk, + NULL, NULL, pm, NULL); + object_property_add_uint32_ptr(obj, ACPI_PM_PROP_GPE0_BLK_LEN, + &gpe0_len, errp); +} |