xref: /openbmc/qemu/hw/acpi/acpi_interface.c (revision 9c6c0aea)
1 #include "qemu/osdep.h"
2 #include "hw/acpi/acpi_dev_interface.h"
3 #include "hw/acpi/acpi_aml_interface.h"
4 #include "qemu/module.h"
5 #include "qemu/queue.h"
6 
acpi_send_event(DeviceState * dev,AcpiEventStatusBits event)7 void acpi_send_event(DeviceState *dev, AcpiEventStatusBits event)
8 {
9     AcpiDeviceIfClass *adevc = ACPI_DEVICE_IF_GET_CLASS(dev);
10     if (adevc->send_event) {
11         AcpiDeviceIf *adev = ACPI_DEVICE_IF(dev);
12         adevc->send_event(adev, event);
13     }
14 }
15 
qbus_build_aml(BusState * bus,Aml * scope)16 void qbus_build_aml(BusState *bus, Aml *scope)
17 {
18     BusChild *kid;
19 
20     QTAILQ_FOREACH(kid, &bus->children, sibling) {
21         call_dev_aml_func(DEVICE(kid->child), scope);
22     }
23 }
24 
register_types(void)25 static void register_types(void)
26 {
27     static const TypeInfo acpi_dev_if_info = {
28         .name          = TYPE_ACPI_DEVICE_IF,
29         .parent        = TYPE_INTERFACE,
30         .class_size = sizeof(AcpiDeviceIfClass),
31     };
32     static const TypeInfo acpi_dev_aml_if_info = {
33         .name          = TYPE_ACPI_DEV_AML_IF,
34         .parent        = TYPE_INTERFACE,
35         .class_size = sizeof(AcpiDevAmlIfClass),
36     };
37 
38 
39     type_register_static(&acpi_dev_if_info);
40     type_register_static(&acpi_dev_aml_if_info);
41 }
42 
43 type_init(register_types)
44