TianoCore EDK2 master
|
#include <IndustryStandard/Q35MchIch9.h>
#include <IndustryStandard/QemuCpuHotplug.h>
#include <Library/BaseLib.h>
#include <Library/DebugLib.h>
#include "QemuCpuhp.h"
Go to the source code of this file.
Functions | |
UINT32 | QemuCpuhpReadCommandData2 (IN CONST EFI_MM_CPU_IO_PROTOCOL *MmCpuIo) |
UINT8 | QemuCpuhpReadCpuStatus (IN CONST EFI_MM_CPU_IO_PROTOCOL *MmCpuIo) |
UINT32 | QemuCpuhpReadCommandData (IN CONST EFI_MM_CPU_IO_PROTOCOL *MmCpuIo) |
VOID | QemuCpuhpWriteCpuSelector (IN CONST EFI_MM_CPU_IO_PROTOCOL *MmCpuIo, IN UINT32 Selector) |
VOID | QemuCpuhpWriteCpuStatus (IN CONST EFI_MM_CPU_IO_PROTOCOL *MmCpuIo, IN UINT8 CpuStatus) |
VOID | QemuCpuhpWriteCommand (IN CONST EFI_MM_CPU_IO_PROTOCOL *MmCpuIo, IN UINT8 Command) |
EFI_STATUS | QemuCpuhpCollectApicIds (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) |
Simple wrapper functions and utility functions that access QEMU's modern CPU hotplug register block.
These functions manipulate some of the registers described in "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
Definition in file QemuCpuhp.c.
EFI_STATUS QemuCpuhpCollectApicIds | ( | 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 | ||
) |
Collect the APIC IDs of
This function only scans for events – it does not modify them – in the hotplug registers.
On error, the contents of the output parameters are undefined.
[in] | MmCpuIo | The EFI_MM_CPU_IO_PROTOCOL instance for accessing IO Ports. |
[in] | PossibleCpuCount | The number of possible CPUs in the system. Must be positive. |
[in] | ApicIdCount | The number of elements each one of the PluggedApicIds and ToUnplugApicIds arrays can accommodate. Must be positive. |
[out] | PluggedApicIds | The APIC IDs of the CPUs that have been hot-plugged. |
[out] | PluggedCount | The number of filled-in APIC IDs in PluggedApicIds. |
[out] | ToUnplugApicIds | The APIC IDs of the CPUs that are about to be hot-unplugged. |
[out] | ToUnplugSelectors | The QEMU Selectors of the CPUs that are about to be hot-unplugged. |
[out] | ToUnplugCount | The number of filled-in APIC IDs in ToUnplugApicIds. |
EFI_INVALID_PARAMETER | PossibleCpuCount is zero, or ApicIdCount is zero. |
EFI_PROTOCOL_ERROR | Invalid bitmap detected in the QEMU_CPUHP_R_CPU_STAT register. |
EFI_BUFFER_TOO_SMALL | There was an attempt to place more than ApicIdCount APIC IDs into one of the PluggedApicIds and ToUnplugApicIds arrays. |
EFI_SUCCESS | Output parameters have been set successfully. |
Definition at line 211 of file QemuCpuhp.c.
UINT32 QemuCpuhpReadCommandData | ( | IN CONST EFI_MM_CPU_IO_PROTOCOL * | MmCpuIo | ) |
Definition at line 73 of file QemuCpuhp.c.
UINT32 QemuCpuhpReadCommandData2 | ( | IN CONST EFI_MM_CPU_IO_PROTOCOL * | MmCpuIo | ) |
Definition at line 23 of file QemuCpuhp.c.
UINT8 QemuCpuhpReadCpuStatus | ( | IN CONST EFI_MM_CPU_IO_PROTOCOL * | MmCpuIo | ) |
Definition at line 48 of file QemuCpuhp.c.
VOID QemuCpuhpWriteCommand | ( | IN CONST EFI_MM_CPU_IO_PROTOCOL * | MmCpuIo, |
IN UINT8 | Command | ||
) |
Definition at line 142 of file QemuCpuhp.c.
VOID QemuCpuhpWriteCpuSelector | ( | IN CONST EFI_MM_CPU_IO_PROTOCOL * | MmCpuIo, |
IN UINT32 | Selector | ||
) |
Definition at line 98 of file QemuCpuhp.c.
VOID QemuCpuhpWriteCpuStatus | ( | IN CONST EFI_MM_CPU_IO_PROTOCOL * | MmCpuIo, |
IN UINT8 | CpuStatus | ||
) |
Definition at line 120 of file QemuCpuhp.c.