1 #ifndef ACPI_DEV_INTERFACE_H 2 #define ACPI_DEV_INTERFACE_H 3 4 #include "qom/object.h" 5 #include "qapi-types.h" 6 #include "hw/boards.h" 7 8 /* These values are part of guest ABI, and can not be changed */ 9 typedef enum { 10 ACPI_PCI_HOTPLUG_STATUS = 2, 11 ACPI_CPU_HOTPLUG_STATUS = 4, 12 ACPI_MEMORY_HOTPLUG_STATUS = 8, 13 ACPI_NVDIMM_HOTPLUG_STATUS = 16, 14 } AcpiEventStatusBits; 15 16 #define TYPE_ACPI_DEVICE_IF "acpi-device-interface" 17 18 #define ACPI_DEVICE_IF_CLASS(klass) \ 19 OBJECT_CLASS_CHECK(AcpiDeviceIfClass, (klass), \ 20 TYPE_ACPI_DEVICE_IF) 21 #define ACPI_DEVICE_IF_GET_CLASS(obj) \ 22 OBJECT_GET_CLASS(AcpiDeviceIfClass, (obj), \ 23 TYPE_ACPI_DEVICE_IF) 24 #define ACPI_DEVICE_IF(obj) \ 25 INTERFACE_CHECK(AcpiDeviceIf, (obj), \ 26 TYPE_ACPI_DEVICE_IF) 27 28 29 typedef struct AcpiDeviceIf { 30 /* <private> */ 31 Object Parent; 32 } AcpiDeviceIf; 33 34 void acpi_send_event(DeviceState *dev, AcpiEventStatusBits event); 35 36 /** 37 * AcpiDeviceIfClass: 38 * 39 * ospm_status: returns status of ACPI device objects, reported 40 * via _OST method if device supports it. 41 * send_event: inject a specified event into guest 42 * madt_cpu: fills @entry with Interrupt Controller Structure 43 * for CPU indexed by @uid in @apic_ids array, 44 * returned structure types are: 45 * 0 - Local APIC, 9 - Local x2APIC, 0xB - GICC 46 * 47 * Interface is designed for providing unified interface 48 * to generic ACPI functionality that could be used without 49 * knowledge about internals of actual device that implements 50 * ACPI interface. 51 */ 52 typedef struct AcpiDeviceIfClass { 53 /* <private> */ 54 InterfaceClass parent_class; 55 56 /* <public> */ 57 void (*ospm_status)(AcpiDeviceIf *adev, ACPIOSTInfoList ***list); 58 void (*send_event)(AcpiDeviceIf *adev, AcpiEventStatusBits ev); 59 void (*madt_cpu)(AcpiDeviceIf *adev, int uid, 60 const CPUArchIdList *apic_ids, GArray *entry); 61 } AcpiDeviceIfClass; 62 #endif 63