QemuCpuhp.h 1.8 KB

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