]>
Commit | Line | Data |
---|---|---|
521b3673 IM |
1 | #ifndef ACPI_DEV_INTERFACE_H |
2 | #define ACPI_DEV_INTERFACE_H | |
3 | ||
4 | #include "qom/object.h" | |
ac35f13b | 5 | #include "hw/boards.h" |
521b3673 | 6 | |
eaf23bf7 IM |
7 | /* These values are part of guest ABI, and can not be changed */ |
8 | typedef enum { | |
9 | ACPI_PCI_HOTPLUG_STATUS = 2, | |
10 | ACPI_CPU_HOTPLUG_STATUS = 4, | |
11 | ACPI_MEMORY_HOTPLUG_STATUS = 8, | |
b097cc52 | 12 | ACPI_NVDIMM_HOTPLUG_STATUS = 16, |
d03637bc | 13 | ACPI_VMGENID_CHANGE_STATUS = 32, |
eaf23bf7 IM |
14 | } AcpiEventStatusBits; |
15 | ||
521b3673 IM |
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 | ||
aa1b35b9 | 28 | typedef struct AcpiDeviceIf AcpiDeviceIf; |
521b3673 | 29 | |
eaf23bf7 IM |
30 | void acpi_send_event(DeviceState *dev, AcpiEventStatusBits event); |
31 | ||
521b3673 IM |
32 | /** |
33 | * AcpiDeviceIfClass: | |
34 | * | |
35 | * ospm_status: returns status of ACPI device objects, reported | |
36 | * via _OST method if device supports it. | |
eaf23bf7 | 37 | * send_event: inject a specified event into guest |
ac35f13b IM |
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 | |
521b3673 IM |
42 | * |
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 | |
46 | * ACPI interface. | |
47 | */ | |
48 | typedef struct AcpiDeviceIfClass { | |
49 | /* <private> */ | |
50 | InterfaceClass parent_class; | |
51 | ||
52 | /* <public> */ | |
53 | void (*ospm_status)(AcpiDeviceIf *adev, ACPIOSTInfoList ***list); | |
eaf23bf7 | 54 | void (*send_event)(AcpiDeviceIf *adev, AcpiEventStatusBits ev); |
ac35f13b | 55 | void (*madt_cpu)(AcpiDeviceIf *adev, int uid, |
80e5db30 | 56 | const CPUArchIdList *apic_ids, GArray *entry); |
521b3673 IM |
57 | } AcpiDeviceIfClass; |
58 | #endif |