]> git.proxmox.com Git - mirror_edk2.git/blob - OvmfPkg/CpuHotplugSmm/QemuCpuhp.h
UefiCpuPkg: Move AsmRelocateApLoopStart from Mpfuncs.nasm to AmdSev.nasm
[mirror_edk2.git] / OvmfPkg / CpuHotplugSmm / QemuCpuhp.h
1 /** @file
2 Simple wrapper functions and utility functions that access QEMU's modern CPU
3 hotplug register block.
4
5 These functions manipulate some of the registers described in
6 "docs/specs/acpi_cpu_hotplug.txt" in the QEMU source. IO Ports are accessed
7 via EFI_MM_CPU_IO_PROTOCOL. If a protocol call fails, these functions don't
8 return.
9
10 Copyright (c) 2020, Red Hat, Inc.
11
12 SPDX-License-Identifier: BSD-2-Clause-Patent
13 **/
14
15 #ifndef QEMU_CPUHP_H_
16 #define QEMU_CPUHP_H_
17
18 #include <Protocol/MmCpuIo.h> // EFI_MM_CPU_IO_PROTOCOL
19 #include <Uefi/UefiBaseType.h> // EFI_STATUS
20
21 #include "ApicId.h" // APIC_ID
22
23 UINT32
24 QemuCpuhpReadCommandData2 (
25 IN CONST EFI_MM_CPU_IO_PROTOCOL *MmCpuIo
26 );
27
28 UINT8
29 QemuCpuhpReadCpuStatus (
30 IN CONST EFI_MM_CPU_IO_PROTOCOL *MmCpuIo
31 );
32
33 UINT32
34 QemuCpuhpReadCommandData (
35 IN CONST EFI_MM_CPU_IO_PROTOCOL *MmCpuIo
36 );
37
38 VOID
39 QemuCpuhpWriteCpuSelector (
40 IN CONST EFI_MM_CPU_IO_PROTOCOL *MmCpuIo,
41 IN UINT32 Selector
42 );
43
44 VOID
45 QemuCpuhpWriteCpuStatus (
46 IN CONST EFI_MM_CPU_IO_PROTOCOL *MmCpuIo,
47 IN UINT8 CpuStatus
48 );
49
50 VOID
51 QemuCpuhpWriteCommand (
52 IN CONST EFI_MM_CPU_IO_PROTOCOL *MmCpuIo,
53 IN UINT8 Command
54 );
55
56 EFI_STATUS
57 QemuCpuhpCollectApicIds (
58 IN CONST EFI_MM_CPU_IO_PROTOCOL *MmCpuIo,
59 IN UINT32 PossibleCpuCount,
60 IN UINT32 ApicIdCount,
61 OUT APIC_ID *PluggedApicIds,
62 OUT UINT32 *PluggedCount,
63 OUT APIC_ID *ToUnplugApicIds,
64 OUT UINT32 *ToUnplugSelectors,
65 OUT UINT32 *ToUnplugCount
66 );
67
68 #endif // QEMU_CPUHP_H_