xemu/hw/acpi/acpi_interface.c
Igor Mammedov eaf23bf794 acpi: extend ACPI interface to provide send_event hook
send_event() hook will allow to send ACPI event in
a target specific way (GPE or GPIO based impl.)
it will also simplify proxy wrappers in piix4pm/ich9
that access ACPI regs and SCI which are part of
piix4pm/lcp_ich9 devices and call acpi_foo() API directly.

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Marcel Apfelbaum <marcel@redhat.com>
2016-06-07 15:36:54 +03:00

26 lines
648 B
C

#include "qemu/osdep.h"
#include "hw/acpi/acpi_dev_interface.h"
#include "qemu/module.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);
}
}
static void register_types(void)
{
static const TypeInfo acpi_dev_if_info = {
.name = TYPE_ACPI_DEVICE_IF,
.parent = TYPE_INTERFACE,
.class_size = sizeof(AcpiDeviceIfClass),
};
type_register_static(&acpi_dev_if_info);
}
type_init(register_types)