tests/qapi-schema: Tidy up pylint warnings and advice
[qemu/armbru.git] / include / hw / acpi / cpu.h
blobbc901660fb6fd6f585c553636c1fcb183d2c1276
1 /*
2 * QEMU ACPI hotplug utilities
4 * Copyright (C) 2016 Red Hat Inc
6 * Authors:
7 * Igor Mammedov <imammedo@redhat.com>
9 * This work is licensed under the terms of the GNU GPL, version 2 or later.
10 * See the COPYING file in the top-level directory.
12 #ifndef ACPI_CPU_H
13 #define ACPI_CPU_H
15 #include "hw/qdev-core.h"
16 #include "hw/acpi/acpi.h"
17 #include "hw/acpi/aml-build.h"
18 #include "hw/boards.h"
19 #include "hw/hotplug.h"
21 typedef struct AcpiCpuStatus {
22 struct CPUState *cpu;
23 uint64_t arch_id;
24 bool is_inserting;
25 bool is_removing;
26 bool fw_remove;
27 uint32_t ost_event;
28 uint32_t ost_status;
29 } AcpiCpuStatus;
31 typedef struct CPUHotplugState {
32 MemoryRegion ctrl_reg;
33 uint32_t selector;
34 uint8_t command;
35 uint32_t dev_count;
36 AcpiCpuStatus *devs;
37 } CPUHotplugState;
39 void acpi_cpu_plug_cb(HotplugHandler *hotplug_dev,
40 CPUHotplugState *cpu_st, DeviceState *dev, Error **errp);
42 void acpi_cpu_unplug_request_cb(HotplugHandler *hotplug_dev,
43 CPUHotplugState *cpu_st,
44 DeviceState *dev, Error **errp);
46 void acpi_cpu_unplug_cb(CPUHotplugState *cpu_st,
47 DeviceState *dev, Error **errp);
49 void cpu_hotplug_hw_init(MemoryRegion *as, Object *owner,
50 CPUHotplugState *state, hwaddr base_addr);
52 typedef struct CPUHotplugFeatures {
53 bool acpi_1_compatible;
54 bool has_legacy_cphp;
55 bool fw_unplugs_cpu;
56 const char *smi_path;
57 } CPUHotplugFeatures;
59 typedef void (*build_madt_cpu_fn)(int uid, const CPUArchIdList *apic_ids,
60 GArray *entry, bool force_enabled);
62 void build_cpus_aml(Aml *table, MachineState *machine, CPUHotplugFeatures opts,
63 build_madt_cpu_fn build_madt_cpu, hwaddr io_base,
64 const char *res_root,
65 const char *event_handler_method);
67 void acpi_cpu_ospm_status(CPUHotplugState *cpu_st, ACPIOSTInfoList ***list);
69 extern const VMStateDescription vmstate_cpu_hotplug;
70 #define VMSTATE_CPU_HOTPLUG(cpuhp, state) \
71 VMSTATE_STRUCT(cpuhp, state, 1, \
72 vmstate_cpu_hotplug, CPUHotplugState)
74 #endif