2020-02-26 23:11:47 +01:00
|
|
|
/** @file
|
2020-02-26 23:11:49 +01:00
|
|
|
Simple wrapper functions and utility functions that access QEMU's modern CPU
|
|
|
|
hotplug register block.
|
2020-02-26 23:11:47 +01:00
|
|
|
|
2020-02-26 23:11:49 +01:00
|
|
|
These functions manipulate some of the registers described in
|
2020-02-26 23:11:47 +01:00
|
|
|
"docs/specs/acpi_cpu_hotplug.txt" in the QEMU source. IO Ports are accessed
|
|
|
|
via EFI_MM_CPU_IO_PROTOCOL. If a protocol call fails, these functions don't
|
|
|
|
return.
|
|
|
|
|
|
|
|
Copyright (c) 2020, Red Hat, Inc.
|
|
|
|
|
|
|
|
SPDX-License-Identifier: BSD-2-Clause-Patent
|
|
|
|
**/
|
|
|
|
|
|
|
|
#ifndef QEMU_CPUHP_H_
|
|
|
|
#define QEMU_CPUHP_H_
|
|
|
|
|
|
|
|
#include <Protocol/MmCpuIo.h> // EFI_MM_CPU_IO_PROTOCOL
|
2020-02-26 23:11:49 +01:00
|
|
|
#include <Uefi/UefiBaseType.h> // EFI_STATUS
|
|
|
|
|
|
|
|
#include "ApicId.h" // APIC_ID
|
2020-02-26 23:11:47 +01:00
|
|
|
|
|
|
|
UINT32
|
|
|
|
QemuCpuhpReadCommandData2 (
|
2021-12-05 23:54:09 +01:00
|
|
|
IN CONST EFI_MM_CPU_IO_PROTOCOL *MmCpuIo
|
2020-02-26 23:11:47 +01:00
|
|
|
);
|
|
|
|
|
|
|
|
UINT8
|
|
|
|
QemuCpuhpReadCpuStatus (
|
2021-12-05 23:54:09 +01:00
|
|
|
IN CONST EFI_MM_CPU_IO_PROTOCOL *MmCpuIo
|
2020-02-26 23:11:47 +01:00
|
|
|
);
|
|
|
|
|
|
|
|
UINT32
|
|
|
|
QemuCpuhpReadCommandData (
|
2021-12-05 23:54:09 +01:00
|
|
|
IN CONST EFI_MM_CPU_IO_PROTOCOL *MmCpuIo
|
2020-02-26 23:11:47 +01:00
|
|
|
);
|
|
|
|
|
|
|
|
VOID
|
|
|
|
QemuCpuhpWriteCpuSelector (
|
2021-12-05 23:54:09 +01:00
|
|
|
IN CONST EFI_MM_CPU_IO_PROTOCOL *MmCpuIo,
|
|
|
|
IN UINT32 Selector
|
2020-02-26 23:11:47 +01:00
|
|
|
);
|
|
|
|
|
2021-03-12 07:26:49 +01:00
|
|
|
VOID
|
|
|
|
QemuCpuhpWriteCpuStatus (
|
2021-12-05 23:54:09 +01:00
|
|
|
IN CONST EFI_MM_CPU_IO_PROTOCOL *MmCpuIo,
|
|
|
|
IN UINT8 CpuStatus
|
2021-03-12 07:26:49 +01:00
|
|
|
);
|
|
|
|
|
2020-02-26 23:11:47 +01:00
|
|
|
VOID
|
|
|
|
QemuCpuhpWriteCommand (
|
2021-12-05 23:54:09 +01:00
|
|
|
IN CONST EFI_MM_CPU_IO_PROTOCOL *MmCpuIo,
|
|
|
|
IN UINT8 Command
|
2020-02-26 23:11:47 +01:00
|
|
|
);
|
|
|
|
|
2020-02-26 23:11:49 +01:00
|
|
|
EFI_STATUS
|
|
|
|
QemuCpuhpCollectApicIds (
|
2021-12-05 23:54:09 +01:00
|
|
|
IN CONST EFI_MM_CPU_IO_PROTOCOL *MmCpuIo,
|
|
|
|
IN UINT32 PossibleCpuCount,
|
|
|
|
IN UINT32 ApicIdCount,
|
|
|
|
OUT APIC_ID *PluggedApicIds,
|
|
|
|
OUT UINT32 *PluggedCount,
|
|
|
|
OUT APIC_ID *ToUnplugApicIds,
|
|
|
|
OUT UINT32 *ToUnplugSelectors,
|
|
|
|
OUT UINT32 *ToUnplugCount
|
2020-02-26 23:11:49 +01:00
|
|
|
);
|
|
|
|
|
2020-02-26 23:11:47 +01:00
|
|
|
#endif // QEMU_CPUHP_H_
|