mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 00:03:54 -06:00
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>
This commit is contained in:
parent
6d42eefad8
commit
eaf23bf794
6 changed files with 39 additions and 9 deletions
|
@ -4,6 +4,13 @@
|
|||
#include "qom/object.h"
|
||||
#include "qapi-types.h"
|
||||
|
||||
/* These values are part of guest ABI, and can not be changed */
|
||||
typedef enum {
|
||||
ACPI_PCI_HOTPLUG_STATUS = 2,
|
||||
ACPI_CPU_HOTPLUG_STATUS = 4,
|
||||
ACPI_MEMORY_HOTPLUG_STATUS = 8,
|
||||
} AcpiEventStatusBits;
|
||||
|
||||
#define TYPE_ACPI_DEVICE_IF "acpi-device-interface"
|
||||
|
||||
#define ACPI_DEVICE_IF_CLASS(klass) \
|
||||
|
@ -22,11 +29,14 @@ typedef struct AcpiDeviceIf {
|
|||
Object Parent;
|
||||
} AcpiDeviceIf;
|
||||
|
||||
void acpi_send_event(DeviceState *dev, AcpiEventStatusBits event);
|
||||
|
||||
/**
|
||||
* AcpiDeviceIfClass:
|
||||
*
|
||||
* ospm_status: returns status of ACPI device objects, reported
|
||||
* via _OST method if device supports it.
|
||||
* send_event: inject a specified event into guest
|
||||
*
|
||||
* Interface is designed for providing unified interface
|
||||
* to generic ACPI functionality that could be used without
|
||||
|
@ -39,5 +49,6 @@ typedef struct AcpiDeviceIfClass {
|
|||
|
||||
/* <public> */
|
||||
void (*ospm_status)(AcpiDeviceIf *adev, ACPIOSTInfoList ***list);
|
||||
void (*send_event)(AcpiDeviceIf *adev, AcpiEventStatusBits ev);
|
||||
} AcpiDeviceIfClass;
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue