]> Git Repo - qemu.git/blame - include/hw/acpi/cpu.h
works with less than base ISA qemu-system-riscv32 -M virt -bios none -kernel output...
[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 <[email protected]>
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;
1e6107d9 25 bool fw_remove;
76623d00
IM
26 uint32_t ost_event;
27 uint32_t ost_status;
5e1b5d93
IM
28} AcpiCpuStatus;
29
30typedef struct CPUHotplugState {
31 MemoryRegion ctrl_reg;
32 uint32_t selector;
d2238cb6 33 uint8_t command;
5e1b5d93
IM
34 uint32_t dev_count;
35 AcpiCpuStatus *devs;
36} CPUHotplugState;
37
38void acpi_cpu_plug_cb(HotplugHandler *hotplug_dev,
39 CPUHotplugState *cpu_st, DeviceState *dev, Error **errp);
40
8872c25a
IM
41void acpi_cpu_unplug_request_cb(HotplugHandler *hotplug_dev,
42 CPUHotplugState *cpu_st,
43 DeviceState *dev, Error **errp);
44
45void acpi_cpu_unplug_cb(CPUHotplugState *cpu_st,
46 DeviceState *dev, Error **errp);
47
5e1b5d93
IM
48void cpu_hotplug_hw_init(MemoryRegion *as, Object *owner,
49 CPUHotplugState *state, hwaddr base_addr);
50
51typedef struct CPUHotplugFeatures {
89cb0c04 52 bool acpi_1_compatible;
679dd1a9 53 bool has_legacy_cphp;
69dea9d6 54 bool fw_unplugs_cpu;
998ba950 55 const char *smi_path;
5e1b5d93
IM
56} CPUHotplugFeatures;
57
58void build_cpus_aml(Aml *table, MachineState *machine, CPUHotplugFeatures opts,
59 hwaddr io_base,
d2238cb6
IM
60 const char *res_root,
61 const char *event_handler_method);
5e1b5d93 62
76623d00
IM
63void acpi_cpu_ospm_status(CPUHotplugState *cpu_st, ACPIOSTInfoList ***list);
64
5e1b5d93
IM
65extern const VMStateDescription vmstate_cpu_hotplug;
66#define VMSTATE_CPU_HOTPLUG(cpuhp, state) \
67 VMSTATE_STRUCT(cpuhp, state, 1, \
68 vmstate_cpu_hotplug, CPUHotplugState)
69
70#endif
This page took 0.362988 seconds and 5 git commands to generate.