]> git.proxmox.com Git - mirror_edk2.git/blob - OvmfPkg/Include/IndustryStandard/QemuCpuHotplug.h
UefiCpuPkg: Move AsmRelocateApLoopStart from Mpfuncs.nasm to AmdSev.nasm
[mirror_edk2.git] / OvmfPkg / Include / IndustryStandard / QemuCpuHotplug.h
1 /** @file
2 Macros for accessing QEMU's CPU hotplug register block.
3
4 Copyright (C) 2019, Red Hat, Inc.
5
6 SPDX-License-Identifier: BSD-2-Clause-Patent
7
8 @par Specification Reference:
9
10 - "docs/specs/acpi_cpu_hotplug.txt" in the QEMU source tree.
11
12 The original (now "legacy") CPU hotplug interface appeared in QEMU v1.5.0.
13 The new ("modern") hotplug interface appeared in QEMU v2.7.0.
14
15 The macros in this header file map to the minimal subset of the modern
16 interface that OVMF needs.
17 **/
18
19 #ifndef QEMU_CPU_HOTPLUG_H_
20 #define QEMU_CPU_HOTPLUG_H_
21
22 #include <Base.h>
23
24 //
25 // Each register offset is:
26 // - relative to the board-dependent IO base address of the register block,
27 // - named QEMU_CPUHP_(R|W|RW)_*, according to the possible access modes of the
28 // register,
29 // - followed by distinguished bitmasks or values in the register.
30 //
31 #define QEMU_CPUHP_R_CMD_DATA2 0x0
32
33 #define QEMU_CPUHP_R_CPU_STAT 0x4
34 #define QEMU_CPUHP_STAT_ENABLED BIT0
35 #define QEMU_CPUHP_STAT_INSERT BIT1
36 #define QEMU_CPUHP_STAT_REMOVE BIT2
37 #define QEMU_CPUHP_STAT_EJECT BIT3
38 #define QEMU_CPUHP_STAT_FW_REMOVE BIT4
39
40 #define QEMU_CPUHP_RW_CMD_DATA 0x8
41
42 #define QEMU_CPUHP_W_CPU_SEL 0x0
43
44 #define QEMU_CPUHP_W_CMD 0x5
45 #define QEMU_CPUHP_CMD_GET_PENDING 0x0
46 #define QEMU_CPUHP_CMD_GET_ARCH_ID 0x3
47
48 #endif // QEMU_CPU_HOTPLUG_H_