]> git.proxmox.com Git - mirror_qemu.git/blame - include/hw/acpi/cpu.h
pc: use new CPU hotplug interface since 2.7 machine type
[mirror_qemu.git] / include / hw / acpi / cpu.h
CommitLineData
5e1b5d93
IM
1/*
2 * QEMU ACPI hotplug utilities
3 *
4 * Copyright (C) 2016 Red Hat Inc
5 *
6 * Authors:
7 * Igor Mammedov <imammedo@redhat.com>
8 *
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.
11 */
12#ifndef ACPI_CPU_H
13#define ACPI_CPU_H
14
15#include "hw/qdev-core.h"
16#include "hw/acpi/acpi.h"
17#include "hw/acpi/aml-build.h"
18#include "hw/hotplug.h"
19
20typedef struct AcpiCpuStatus {
21 struct CPUState *cpu;
22 uint64_t arch_id;
d2238cb6 23 bool is_inserting;
8872c25a 24 bool is_removing;
76623d00
IM
25 uint32_t ost_event;
26 uint32_t ost_status;
5e1b5d93
IM
27} AcpiCpuStatus;
28
29typedef struct CPUHotplugState {
30 MemoryRegion ctrl_reg;
31 uint32_t selector;
d2238cb6 32 uint8_t command;
5e1b5d93
IM
33 uint32_t dev_count;
34 AcpiCpuStatus *devs;
35} CPUHotplugState;
36
37void acpi_cpu_plug_cb(HotplugHandler *hotplug_dev,
38 CPUHotplugState *cpu_st, DeviceState *dev, Error **errp);
39
8872c25a
IM
40void acpi_cpu_unplug_request_cb(HotplugHandler *hotplug_dev,
41 CPUHotplugState *cpu_st,
42 DeviceState *dev, Error **errp);
43
44void acpi_cpu_unplug_cb(CPUHotplugState *cpu_st,
45 DeviceState *dev, Error **errp);
46
5e1b5d93
IM
47void cpu_hotplug_hw_init(MemoryRegion *as, Object *owner,
48 CPUHotplugState *state, hwaddr base_addr);
49
50typedef struct CPUHotplugFeatures {
51 bool apci_1_compatible;
679dd1a9 52 bool has_legacy_cphp;
5e1b5d93
IM
53} CPUHotplugFeatures;
54
55void build_cpus_aml(Aml *table, MachineState *machine, CPUHotplugFeatures opts,
56 hwaddr io_base,
d2238cb6
IM
57 const char *res_root,
58 const char *event_handler_method);
5e1b5d93 59
76623d00
IM
60void acpi_cpu_ospm_status(CPUHotplugState *cpu_st, ACPIOSTInfoList ***list);
61
5e1b5d93
IM
62extern const VMStateDescription vmstate_cpu_hotplug;
63#define VMSTATE_CPU_HOTPLUG(cpuhp, state) \
64 VMSTATE_STRUCT(cpuhp, state, 1, \
65 vmstate_cpu_hotplug, CPUHotplugState)
66
67#endif