aboutsummaryrefslogtreecommitdiff
path: root/hw/acpi/piix4.c
diff options
context:
space:
mode:
authorIgor Mammedov <imammedo@redhat.com>2014-06-16 19:12:27 +0200
committerMichael S. Tsirkin <mst@redhat.com>2014-06-19 18:44:22 +0300
commit43f50410088847376c8b146e817a9042bd2a5f36 (patch)
treea8e170b918adc00773966b0ce966f0ee616975d9 /hw/acpi/piix4.c
parent521b3673ac16ec7fa33b1ec2cdfe75ec708f073e (diff)
acpi: implement ospm_status() method for PIIX4/ICH9_LPC devices
... using TYPE_ACPI_DEVICE_IF interface. Which provides status reporting of ACPI declared memory devices Signed-off-by: Igor Mammedov <imammedo@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Acked-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'hw/acpi/piix4.c')
-rw-r--r--hw/acpi/piix4.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/hw/acpi/piix4.c b/hw/acpi/piix4.c
index 01b3b4cb64..b72b34e5c9 100644
--- a/hw/acpi/piix4.c
+++ b/hw/acpi/piix4.c
@@ -35,6 +35,7 @@
#include "hw/hotplug.h"
#include "hw/mem/pc-dimm.h"
#include "hw/acpi/memory_hotplug.h"
+#include "hw/acpi/acpi_dev_interface.h"
//#define DEBUG
@@ -572,6 +573,13 @@ static void piix4_acpi_system_hot_add_init(MemoryRegion *parent,
}
}
+static void piix4_ospm_status(AcpiDeviceIf *adev, ACPIOSTInfoList ***list)
+{
+ PIIX4PMState *s = PIIX4_PM(adev);
+
+ acpi_memory_ospm_status(&s->acpi_memory_hotplug, list);
+}
+
static Property piix4_pm_properties[] = {
DEFINE_PROP_UINT32("smb_io_base", PIIX4PMState, smb_io_base, 0),
DEFINE_PROP_UINT8(ACPI_PM_PROP_S3_DISABLED, PIIX4PMState, disable_s3, 0),
@@ -589,6 +597,7 @@ static void piix4_pm_class_init(ObjectClass *klass, void *data)
DeviceClass *dc = DEVICE_CLASS(klass);
PCIDeviceClass *k = PCI_DEVICE_CLASS(klass);
HotplugHandlerClass *hc = HOTPLUG_HANDLER_CLASS(klass);
+ AcpiDeviceIfClass *adevc = ACPI_DEVICE_IF_CLASS(klass);
k->init = piix4_pm_initfn;
k->config_write = pm_write_config;
@@ -607,6 +616,7 @@ static void piix4_pm_class_init(ObjectClass *klass, void *data)
dc->hotpluggable = false;
hc->plug = piix4_device_plug_cb;
hc->unplug = piix4_device_unplug_cb;
+ adevc->ospm_status = piix4_ospm_status;
}
static const TypeInfo piix4_pm_info = {
@@ -616,6 +626,7 @@ static const TypeInfo piix4_pm_info = {
.class_init = piix4_pm_class_init,
.interfaces = (InterfaceInfo[]) {
{ TYPE_HOTPLUG_HANDLER },
+ { TYPE_ACPI_DEVICE_IF },
{ }
}
};