2014-06-16 19:12:26 +02:00
|
|
|
#ifndef ACPI_DEV_INTERFACE_H
|
|
|
|
#define ACPI_DEV_INTERFACE_H
|
|
|
|
|
2020-09-13 21:53:47 +02:00
|
|
|
#include "qapi/qapi-types-acpi.h"
|
2014-06-16 19:12:26 +02:00
|
|
|
#include "qom/object.h"
|
2016-04-20 11:28:57 +02:00
|
|
|
#include "hw/boards.h"
|
2019-08-12 07:23:51 +02:00
|
|
|
#include "hw/qdev-core.h"
|
2014-06-16 19:12:26 +02:00
|
|
|
|
2016-05-31 11:57:57 +02:00
|
|
|
/* 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,
|
2016-10-28 18:35:40 +02:00
|
|
|
ACPI_NVDIMM_HOTPLUG_STATUS = 16,
|
2017-02-17 00:15:36 +01:00
|
|
|
ACPI_VMGENID_CHANGE_STATUS = 32,
|
2019-09-18 15:06:30 +02:00
|
|
|
ACPI_POWER_DOWN_STATUS = 64,
|
2016-05-31 11:57:57 +02:00
|
|
|
} AcpiEventStatusBits;
|
|
|
|
|
2014-06-16 19:12:26 +02:00
|
|
|
#define TYPE_ACPI_DEVICE_IF "acpi-device-interface"
|
|
|
|
|
2020-09-03 22:43:22 +02:00
|
|
|
typedef struct AcpiDeviceIfClass AcpiDeviceIfClass;
|
2020-08-31 23:07:33 +02:00
|
|
|
DECLARE_CLASS_CHECKERS(AcpiDeviceIfClass, ACPI_DEVICE_IF,
|
|
|
|
TYPE_ACPI_DEVICE_IF)
|
2014-06-16 19:12:26 +02:00
|
|
|
#define ACPI_DEVICE_IF(obj) \
|
|
|
|
INTERFACE_CHECK(AcpiDeviceIf, (obj), \
|
|
|
|
TYPE_ACPI_DEVICE_IF)
|
|
|
|
|
2018-12-04 15:20:06 +01:00
|
|
|
typedef struct AcpiDeviceIf AcpiDeviceIf;
|
2014-06-16 19:12:26 +02:00
|
|
|
|
2016-05-31 11:57:57 +02:00
|
|
|
void acpi_send_event(DeviceState *dev, AcpiEventStatusBits event);
|
|
|
|
|
2014-06-16 19:12:26 +02:00
|
|
|
/**
|
|
|
|
* AcpiDeviceIfClass:
|
|
|
|
*
|
|
|
|
* ospm_status: returns status of ACPI device objects, reported
|
|
|
|
* via _OST method if device supports it.
|
2016-05-31 11:57:57 +02:00
|
|
|
* send_event: inject a specified event into guest
|
2016-04-20 11:28:57 +02:00
|
|
|
* madt_cpu: fills @entry with Interrupt Controller Structure
|
|
|
|
* for CPU indexed by @uid in @apic_ids array,
|
|
|
|
* returned structure types are:
|
|
|
|
* 0 - Local APIC, 9 - Local x2APIC, 0xB - GICC
|
2014-06-16 19:12:26 +02:00
|
|
|
*
|
|
|
|
* Interface is designed for providing unified interface
|
|
|
|
* to generic ACPI functionality that could be used without
|
|
|
|
* knowledge about internals of actual device that implements
|
|
|
|
* ACPI interface.
|
|
|
|
*/
|
2020-09-03 22:43:22 +02:00
|
|
|
struct AcpiDeviceIfClass {
|
2014-06-16 19:12:26 +02:00
|
|
|
/* <private> */
|
|
|
|
InterfaceClass parent_class;
|
|
|
|
|
|
|
|
/* <public> */
|
|
|
|
void (*ospm_status)(AcpiDeviceIf *adev, ACPIOSTInfoList ***list);
|
2016-05-31 11:57:57 +02:00
|
|
|
void (*send_event)(AcpiDeviceIf *adev, AcpiEventStatusBits ev);
|
2016-04-20 11:28:57 +02:00
|
|
|
void (*madt_cpu)(AcpiDeviceIf *adev, int uid,
|
2021-09-24 14:27:50 +02:00
|
|
|
const CPUArchIdList *apic_ids, GArray *entry,
|
|
|
|
bool force_enabled);
|
2020-09-03 22:43:22 +02:00
|
|
|
};
|
2014-06-16 19:12:26 +02:00
|
|
|
#endif
|