qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Igor Mammedov <imammedo@redhat.com>
To: qemu-devel@nongnu.org
Cc: mst@redhat.com, ani@anisinha.ca
Subject: [PATCH 06/11] acpi: add get_dev_aml_func() helper
Date: Mon, 17 Oct 2022 12:21:41 +0200	[thread overview]
Message-ID: <20221017102146.2254096-7-imammedo@redhat.com> (raw)
In-Reply-To: <20221017102146.2254096-1-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>
---
 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);
     }
 }
 
-- 
2.31.1



  parent reply	other threads:[~2022-10-17 10:28 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-17 10:21 [PATCH 00/11] x86: clean up ACPI PCI code part 2 Igor Mammedov
2022-10-17 10:21 ` [PATCH 01/11] acpi: pc: vga: use AcpiDevAmlIf interface to build VGA device descriptors Igor Mammedov
2022-10-17 11:02   ` Ani Sinha
2022-10-17 10:21 ` [PATCH 02/11] tests: acpi: whitelist DSDT before generating PCI-ISA bridge AML automatically Igor Mammedov
2022-10-17 10:21 ` [PATCH 03/11] acpi: pc/q35: drop ad-hoc PCI-ISA bridge AML routines and let bus ennumeration generate AML Igor Mammedov
2022-10-17 10:21 ` [PATCH 04/11] tests: acpi: update expected DSDT after ISA bridge is moved directly under PCI host bridge Igor Mammedov
2022-10-17 10:21 ` [PATCH 05/11] tests: acpi: whitelist DSDT before generating ICH9_SMB AML automatically Igor Mammedov
2022-10-17 10:21 ` Igor Mammedov [this message]
2022-10-17 11:12   ` [PATCH 06/11] acpi: add get_dev_aml_func() helper Ani Sinha
2022-10-17 10:21 ` [PATCH 07/11] acpi: enumerate SMB bridge automatically along with other PCI devices Igor Mammedov
2022-10-17 10:21 ` [PATCH 08/11] tests: acpi: update expected blobs Igor Mammedov
2022-10-17 12:43   ` Ani Sinha
2022-10-20 12:39     ` Igor Mammedov
2022-10-17 10:21 ` [PATCH 09/11] tests: acpi: pc/q35 whitelist DSDT before \_GPE cleanup Igor Mammedov
2022-10-17 10:21 ` [PATCH 10/11] acpi: pc/35: sanitize _GPE declaration order Igor Mammedov
2022-10-17 10:21 ` [PATCH 11/11] tests: acpi: update expected blobs Igor Mammedov
2022-10-27 12:06 ` [PATCH 00/11] x86: clean up ACPI PCI code part 2 Igor Mammedov
2022-10-27 14:18   ` Michael S. Tsirkin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20221017102146.2254096-7-imammedo@redhat.com \
    --to=imammedo@redhat.com \
    --cc=ani@anisinha.ca \
    --cc=mst@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).