]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
hw/acpi: Move acpi_send_event() function out of acpi_interface.c
authorPhilippe Mathieu-Daudé <philmd@linaro.org>
Tue, 24 Feb 2026 12:22:52 +0000 (13:22 +0100)
committerPhilippe Mathieu-Daudé <philmd@linaro.org>
Sun, 8 Mar 2026 22:08:41 +0000 (23:08 +0100)
acpi_interface.c should only register QOM interfaces. Move
the acpi_send_event() function to core.c with the other
event handlers, and its declaration in 'hw/acpi/acpi.h'.

Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
Message-Id: <20260225035739.42848-3-philmd@linaro.org>

hw/acpi/acpi_interface.c
hw/acpi/core.c
include/hw/acpi/acpi.h
include/hw/acpi/acpi_dev_interface.h

index 8637ff18fca2a00c1cb98738364a29df1cceb70c..e58e8aaee239b2debc05379f42de8330ed823998 100644 (file)
@@ -4,15 +4,6 @@
 #include "qemu/module.h"
 #include "qemu/queue.h"
 
-void acpi_send_event(DeviceState *dev, AcpiEventStatusBits event)
-{
-    AcpiDeviceIfClass *adevc = ACPI_DEVICE_IF_GET_CLASS(dev);
-    if (adevc->send_event) {
-        AcpiDeviceIf *adev = ACPI_DEVICE_IF(dev);
-        adevc->send_event(adev, event);
-    }
-}
-
 void qbus_build_aml(BusState *bus, Aml *scope)
 {
     BusChild *kid;
index 6b65e587f2a527c47963b234ec3982542578f4fe..a6a62a742d11833b1001738e2d4e776fc4e594a0 100644 (file)
@@ -22,6 +22,7 @@
 #include "qemu/osdep.h"
 #include "hw/core/irq.h"
 #include "hw/acpi/acpi.h"
+#include "hw/acpi/acpi_dev_interface.h"
 #include "hw/nvram/fw_cfg.h"
 #include "qemu/config-file.h"
 #include "qapi/error.h"
@@ -753,3 +754,12 @@ void acpi_update_sci(ACPIREGS *regs, qemu_irq irq)
                        (regs->pm1.evt.en & ACPI_BITMASK_TIMER_ENABLE) &&
                        !(pm1a_sts & ACPI_BITMASK_TIMER_STATUS));
 }
+
+void acpi_send_event(DeviceState *dev, AcpiEventStatusBits event)
+{
+    AcpiDeviceIfClass *adevc = ACPI_DEVICE_IF_GET_CLASS(dev);
+    if (adevc->send_event) {
+        AcpiDeviceIf *adev = ACPI_DEVICE_IF(dev);
+        adevc->send_event(adev, event);
+    }
+}
index b036116dfb87dd82a77b2557abe88c0db9457857..dc3672db5213598aee32de2e66f08f6216757fe4 100644 (file)
@@ -182,6 +182,7 @@ void acpi_gpe_reset(ACPIREGS *ar);
 void acpi_gpe_ioport_writeb(ACPIREGS *ar, uint32_t addr, uint32_t val);
 uint32_t acpi_gpe_ioport_readb(ACPIREGS *ar, uint32_t addr);
 
+void acpi_send_event(DeviceState *dev, AcpiEventStatusBits event);
 void acpi_send_gpe_event(ACPIREGS *ar, qemu_irq irq,
                          AcpiEventStatusBits status);
 
index 5927e40eaff06dc8aa9b3f3a1f312d3f691b7b0c..65debb90a8d40a2e2c5b9338a59a168c35f67709 100644 (file)
@@ -27,8 +27,6 @@ DECLARE_CLASS_CHECKERS(AcpiDeviceIfClass, ACPI_DEVICE_IF,
 
 typedef struct AcpiDeviceIf AcpiDeviceIf;
 
-void acpi_send_event(DeviceState *dev, AcpiEventStatusBits event);
-
 /**
  * AcpiDeviceIfClass:
  *