[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL v2 57/82] acpi: add get_dev_aml_func() helper
From: |
Michael S. Tsirkin |
Subject: |
[PULL v2 57/82] acpi: add get_dev_aml_func() helper |
Date: |
Wed, 2 Nov 2022 12:11:01 -0400 |
From: Igor Mammedov <imammedo@redhat.com>
It will be used in followup commits to figure out if
device has it's own, device specific AML block.
Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Message-Id: <20221017102146.2254096-7-imammedo@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Ani Sinha <ani@anisinha.ca>
---
include/hw/acpi/acpi_aml_interface.h | 13 +++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)
diff --git a/include/hw/acpi/acpi_aml_interface.h
b/include/hw/acpi/acpi_aml_interface.h
index ab76f0e55d..436da069d6 100644
--- a/include/hw/acpi/acpi_aml_interface.h
+++ b/include/hw/acpi/acpi_aml_interface.h
@@ -29,11 +29,20 @@ struct AcpiDevAmlIfClass {
dev_aml_fn build_dev_aml;
};
-static inline void call_dev_aml_func(DeviceState *dev, Aml *scope)
+static inline dev_aml_fn get_dev_aml_func(DeviceState *dev)
{
if (object_dynamic_cast(OBJECT(dev), TYPE_ACPI_DEV_AML_IF)) {
AcpiDevAmlIfClass *klass = ACPI_DEV_AML_IF_GET_CLASS(dev);
- klass->build_dev_aml(ACPI_DEV_AML_IF(dev), scope);
+ return klass->build_dev_aml;
+ }
+ return NULL;
+}
+
+static inline void call_dev_aml_func(DeviceState *dev, Aml *scope)
+{
+ dev_aml_fn fn = get_dev_aml_func(dev);
+ if (fn) {
+ fn(ACPI_DEV_AML_IF(dev), scope);
}
}
--
MST
- [PULL v2 50/82] virtio-rng-pci: Allow setting nvectors, so we can use MSI-X, (continued)
- [PULL v2 50/82] virtio-rng-pci: Allow setting nvectors, so we can use MSI-X, Michael S. Tsirkin, 2022/11/02
- [PULL v2 48/82] vhost: vhost-kernel: enable vq reset feature, Michael S. Tsirkin, 2022/11/02
- [PULL v2 51/82] vhost-user: Fix out of order vring host notification handling, Michael S. Tsirkin, 2022/11/02
- [PULL v2 49/82] virtio-net: enable vq reset feature, Michael S. Tsirkin, 2022/11/02
- [PULL v2 53/82] tests: acpi: whitelist DSDT before generating PCI-ISA bridge AML automatically, Michael S. Tsirkin, 2022/11/02
- [PULL v2 52/82] acpi: pc: vga: use AcpiDevAmlIf interface to build VGA device descriptors, Michael S. Tsirkin, 2022/11/02
- [PULL v2 56/82] tests: acpi: whitelist DSDT before generating ICH9_SMB AML automatically, Michael S. Tsirkin, 2022/11/02
- [PULL v2 55/82] tests: acpi: update expected DSDT after ISA bridge is moved directly under PCI host bridge, Michael S. Tsirkin, 2022/11/02
- [PULL v2 54/82] acpi: pc/q35: drop ad-hoc PCI-ISA bridge AML routines and let bus ennumeration generate AML, Michael S. Tsirkin, 2022/11/02
- [PULL v2 60/82] tests: acpi: pc/q35 whitelist DSDT before \_GPE cleanup, Michael S. Tsirkin, 2022/11/02
- [PULL v2 57/82] acpi: add get_dev_aml_func() helper,
Michael S. Tsirkin <=
- [PULL v2 58/82] acpi: enumerate SMB bridge automatically along with other PCI devices, Michael S. Tsirkin, 2022/11/02
- [PULL v2 59/82] tests: acpi: update expected blobs, Michael S. Tsirkin, 2022/11/02
- [PULL v2 64/82] MAINTAINERS: Add qapi/virtio.json to section "virtio", Michael S. Tsirkin, 2022/11/02
- [PULL v2 63/82] hw/acpi/erst.c: Fix memory handling issues, Michael S. Tsirkin, 2022/11/02
- [PULL v2 61/82] acpi: pc/35: sanitize _GPE declaration order, Michael S. Tsirkin, 2022/11/02
- [PULL v2 65/82] msix: Assert that specified vector is in range, Michael S. Tsirkin, 2022/11/02
- [PULL v2 66/82] hw/i386/pc.c: CXL Fixed Memory Window should not reserve e820 in bios, Michael S. Tsirkin, 2022/11/02
- [PULL v2 62/82] tests: acpi: update expected blobs, Michael S. Tsirkin, 2022/11/02
- [PULL v2 67/82] hw/i386/acpi-build: Remove unused struct, Michael S. Tsirkin, 2022/11/02
- [PULL v2 68/82] hw/i386/acpi-build: Resolve redundant attribute, Michael S. Tsirkin, 2022/11/02