2
0

acpi_dev_interface.h 1.7 KB

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