18#define REGISTER_CPU_FEATURES_GUID \
20 0xa694c467, 0x697a, 0x446b, { 0xb9, 0x29, 0x5b, 0x14, 0xa0, 0xcf, 0x39, 0xf } \
23EFI_GUID mRegisterCpuFeaturesHobGuid = REGISTER_CPU_FEATURES_GUID;
42 if (GuidHob !=
NULL) {
43 DataInHob = GET_GUID_HOB_DATA (GuidHob);
45 ASSERT (CpuInitData !=
NULL);
48 ASSERT (CpuInitData !=
NULL);
52 Data64 = (UINT64)(
UINTN)CpuInitData;
54 &mRegisterCpuFeaturesHobGuid,
80 &gEdkiiPeiMpServices2PpiGuid,
83 (VOID **)&MpService.Ppi
103 UINTN ProcessorIndex;
105 CpuMp2Ppi = CpuFeaturesData->MpService.Ppi;
112 Status = CpuMp2Ppi->WhoAmI (CpuMp2Ppi, &ProcessorIndex);
114 return ProcessorIndex;
138 CpuMp2Ppi = CpuFeaturesData->MpService.Ppi;
140 Status = CpuMp2Ppi->GetProcessorInfo (
167 CpuMp2Ppi = CpuFeaturesData->MpService.Ppi;
172 Status = CpuMp2Ppi->StartupAllAPs (
203 CpuMp2Ppi = CpuFeaturesData->MpService.Ppi;
204 Status = CpuMp2Ppi->StartupAllCPUs (
228 CpuMp2Ppi = CpuFeaturesData->MpService.Ppi;
233 Status = CpuMp2Ppi->SwitchBSP (
254 OUT UINTN *NumberOfEnabledProcessors
262 CpuMp2Ppi = CpuFeaturesData->MpService.Ppi;
267 Status = CpuMp2Ppi->GetNumberOfProcessors (
270 NumberOfEnabledProcessors
295 CpuFeaturesData->BspNumber = OldBspNumber;
305 if (CpuFeaturesData->BspNumber != OldBspNumber) {
VOID *EFIAPI GetFirstGuidHob(IN CONST EFI_GUID *Guid)
VOID *EFIAPI BuildGuidDataHob(IN CONST EFI_GUID *Guid, IN VOID *Data, IN UINTN DataLength)
VOID EFIAPI SetProcessorRegister(IN OUT VOID *Buffer)
VOID *EFIAPI AllocateZeroPool(IN UINTN AllocationSize)
EFI_STATUS EFIAPI PeiServicesLocatePpi(IN CONST EFI_GUID *Guid, IN UINTN Instance, IN OUT EFI_PEI_PPI_DESCRIPTOR **PpiDescriptor, IN OUT VOID **Ppi)
#define ASSERT_EFI_ERROR(StatusParameter)
#define CPU_V2_EXTENDED_TOPOLOGY
UINTN GetProcessorIndex(IN CPU_FEATURES_DATA *CpuFeaturesData)
CPU_FEATURES_DATA * GetCpuFeaturesData(VOID)
VOID SwitchNewBsp(IN UINTN ProcessorNumber)
VOID GetNumberOfProcessor(OUT UINTN *NumberOfCpus, OUT UINTN *NumberOfEnabledProcessors)
EFI_STATUS GetProcessorInformation(IN UINTN ProcessorNumber, OUT EFI_PROCESSOR_INFORMATION *ProcessorInfoBuffer)
VOID EFIAPI CpuFeaturesInitialize(VOID)
VOID StartupAllAPsWorker(IN EFI_AP_PROCEDURE Procedure, IN EFI_EVENT MpEvent)
MP_SERVICES GetMpService(VOID)
VOID StartupAllCPUsWorker(IN EFI_AP_PROCEDURE Procedure)
VOID(EFIAPI * EFI_AP_PROCEDURE)(IN OUT VOID *Buffer)