1 #ifndef ACPI_DEV_INTERFACE_H
2 #define ACPI_DEV_INTERFACE_H
4 #include "qapi/qapi-types-misc.h"
5 #include "qom/object.h"
7 #include "hw/qdev-core.h"
9 /* These values are part of guest ABI, and can not be changed */
11 ACPI_PCI_HOTPLUG_STATUS = 2,
12 ACPI_CPU_HOTPLUG_STATUS = 4,
13 ACPI_MEMORY_HOTPLUG_STATUS = 8,
14 ACPI_NVDIMM_HOTPLUG_STATUS = 16,
15 ACPI_VMGENID_CHANGE_STATUS = 32,
16 ACPI_POWER_DOWN_STATUS = 64,
17 } AcpiEventStatusBits;
19 #define TYPE_ACPI_DEVICE_IF "acpi-device-interface"
21 typedef struct AcpiDeviceIfClass AcpiDeviceIfClass;
22 DECLARE_CLASS_CHECKERS(AcpiDeviceIfClass, ACPI_DEVICE_IF,
24 #define ACPI_DEVICE_IF(obj) \
25 INTERFACE_CHECK(AcpiDeviceIf, (obj), \
28 typedef struct AcpiDeviceIf AcpiDeviceIf;
30 void acpi_send_event(DeviceState *dev, AcpiEventStatusBits event);
35 * ospm_status: returns status of ACPI device objects, reported
36 * via _OST method if device supports it.
37 * send_event: inject a specified event into guest
38 * madt_cpu: fills @entry with Interrupt Controller Structure
39 * for CPU indexed by @uid in @apic_ids array,
40 * returned structure types are:
41 * 0 - Local APIC, 9 - Local x2APIC, 0xB - GICC
43 * Interface is designed for providing unified interface
44 * to generic ACPI functionality that could be used without
45 * knowledge about internals of actual device that implements
48 struct AcpiDeviceIfClass {
50 InterfaceClass parent_class;
53 void (*ospm_status)(AcpiDeviceIf *adev, ACPIOSTInfoList ***list);
54 void (*send_event)(AcpiDeviceIf *adev, AcpiEventStatusBits ev);
55 void (*madt_cpu)(AcpiDeviceIf *adev, int uid,
56 const CPUArchIdList *apic_ids, GArray *entry);