aboutsummaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2020-04-29 15:59:53 +0200
committerMichael S. Tsirkin <mst@redhat.com>2020-05-04 10:25:02 -0400
commita53e581ee818d44bea9dcd2c543c2d08a5934fae (patch)
tree93af0d7b5711fad1978bfd40fa5f5c01c3368ed5 /hw
parent88b3648f557855f7da85b5d32f1a08c5a66c2a01 (diff)
acpi: add ISADeviceClass->build_aml()
Also add isa_aml_build() function which walks all isa devices. This allows to move aml builder code to isa devices. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Igor Mammedov <imammedo@redhat.com> Message-Id: <20200429140003.7336-6-kraxel@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'hw')
-rw-r--r--hw/i386/acpi-build.c1
-rw-r--r--hw/isa/isa-bus.c15
2 files changed, 16 insertions, 0 deletions
diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c
index 3a046b03e4..97f3c75cd9 100644
--- a/hw/i386/acpi-build.c
+++ b/hw/i386/acpi-build.c
@@ -1288,6 +1288,7 @@ static void build_isa_devices_aml(Aml *table)
error_report("No ISA bus, unable to define IPMI ACPI data");
} else {
build_acpi_ipmi_devices(scope, BUS(obj), "\\_SB.PCI0.ISA");
+ isa_build_aml(ISA_BUS(obj), scope);
}
aml_append(table, scope);
diff --git a/hw/isa/isa-bus.c b/hw/isa/isa-bus.c
index 798dd9194e..1f2189f4d5 100644
--- a/hw/isa/isa-bus.c
+++ b/hw/isa/isa-bus.c
@@ -207,6 +207,21 @@ ISADevice *isa_vga_init(ISABus *bus)
}
}
+void isa_build_aml(ISABus *bus, Aml *scope)
+{
+ BusChild *kid;
+ ISADevice *dev;
+ ISADeviceClass *dc;
+
+ QTAILQ_FOREACH(kid, &bus->parent_obj.children, sibling) {
+ dev = ISA_DEVICE(kid->child);
+ dc = ISA_DEVICE_GET_CLASS(dev);
+ if (dc->build_aml) {
+ dc->build_aml(dev, scope);
+ }
+ }
+}
+
static void isabus_dev_print(Monitor *mon, DeviceState *dev, int indent)
{
ISADevice *d = ISA_DEVICE(dev);