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