56 if ((ProcessorNumber >= mMaxNumberOfCpus) || (ProcessorInfoBuffer ==
NULL)) {
57 return EFI_INVALID_PARAMETER;
60 if (gSmmCpuPrivate->ProcessorInfo[ProcessorNumber].
ProcessorId == INVALID_APIC_ID) {
92 if (ProcessorNumber >= mMaxNumberOfCpus) {
93 return EFI_INVALID_PARAMETER;
96 if (gSmmCpuPrivate->ProcessorInfo[ProcessorNumber].
ProcessorId == INVALID_APIC_ID) {
100 if ((gSmmCpuPrivate->Operation[ProcessorNumber] != SmmCpuNone) ||
103 return EFI_UNSUPPORTED;
109 gSmmCpuPrivate->Operation[ProcessorNumber] = SmmCpuSwitchBsp;
130 IN UINT64 ProcessorId,
137 return EFI_UNSUPPORTED;
143 if ((ProcessorNumber ==
NULL) || (ProcessorId == INVALID_APIC_ID)) {
144 return EFI_INVALID_PARAMETER;
151 for (Index = 0; Index < mMaxNumberOfCpus; Index++) {
152 if (gSmmCpuPrivate->ProcessorInfo[Index].
ProcessorId == ProcessorId) {
153 return EFI_ALREADY_STARTED;
161 for (Index = 0; Index < mMaxNumberOfCpus; Index++) {
162 if ((mCpuHotPlugData.ApicId[Index] == ProcessorId) &&
163 (gSmmCpuPrivate->ProcessorInfo[Index].
ProcessorId == INVALID_APIC_ID))
165 gSmmCpuPrivate->ProcessorInfo[Index].
ProcessorId = ProcessorId;
166 gSmmCpuPrivate->ProcessorInfo[Index].
StatusFlag = 0;
184 *ProcessorNumber = Index;
185 gSmmCpuPrivate->Operation[Index] = SmmCpuAdd;
190 return EFI_INVALID_PARAMETER;
213 return EFI_UNSUPPORTED;
219 if ((ProcessorNumber >= mMaxNumberOfCpus) ||
220 (gSmmCpuPrivate->ProcessorInfo[ProcessorNumber].
ProcessorId == INVALID_APIC_ID))
222 return EFI_INVALID_PARAMETER;
229 return EFI_UNSUPPORTED;
232 if (gSmmCpuPrivate->Operation[ProcessorNumber] != SmmCpuNone) {
233 return EFI_UNSUPPORTED;
236 gSmmCpuPrivate->ProcessorInfo[ProcessorNumber].
ProcessorId = INVALID_APIC_ID;
237 mCpuHotPlugData.ApicId[ProcessorNumber] = INVALID_APIC_ID;
242 gSmmCpuPrivate->Operation[ProcessorNumber] = SmmCpuRemove;
270 if (ProcessorNumber ==
NULL) {
271 return EFI_INVALID_PARAMETER;
276 for (Index = 0; Index < mMaxNumberOfCpus; Index++) {
277 if (gSmmCpuPrivate->ProcessorInfo[Index].
ProcessorId == ApicId) {
278 *ProcessorNumber = Index;
287 return EFI_NOT_FOUND;
305 for (Index = 0; Index < mMaxNumberOfCpus; Index++) {
306 if (gSmmCpuPrivate->Operation[Index] == SmmCpuSwitchBsp) {
307 gSmmCpuPrivate->Operation[Index] = SmmCpuNone;
308 mSmmMpSyncData->SwitchBsp =
TRUE;
309 mSmmMpSyncData->CandidateBsp[Index] =
TRUE;
316 for (Index = 0; Index < mMaxNumberOfCpus; Index++) {
317 if (gSmmCpuPrivate->Operation[Index] == SmmCpuAdd) {
318 gSmmCpuPrivate->Operation[Index] = SmmCpuNone;
326 for (Index = 0; Index < mMaxNumberOfCpus; Index++) {
327 if (gSmmCpuPrivate->Operation[Index] == SmmCpuRemove) {
328 gSmmCpuPrivate->Operation[Index] = SmmCpuNone;
359 return RegisterCpuInterruptHandler (ExceptionType, InterruptHandler);
381 &gEfiSmmCpuServiceProtocolGuid,
386 if (EFI_ERROR (Status)) {
392 &gEdkiiSmmCpuRendezvousProtocolGuid,
394 &mSmmCpuRendezvousService
416 IN BOOLEAN BlockingMode
424 if (mSmmMpSyncData->AllApArrivedWithException) {
430 Status = EFI_TIMEOUT;
439 Status = mSmmMpSyncData->AllApArrivedWithException ?
EFI_SUCCESS : EFI_TIMEOUT;
444 Status = EFI_TIMEOUT;
448 if (!mSmmMpSyncData->AllApArrivedWithException) {
449 DEBUG ((DEBUG_INFO,
"EdkiiSmmWaitForAllApArrival: Timeout to wait all APs arrival\n"));
VOID *EFIAPI CopyMem(OUT VOID *DestinationBuffer, IN CONST VOID *SourceBuffer, IN UINTN Length)
VOID(EFIAPI * EFI_CPU_INTERRUPT_HANDLER)(IN CONST EFI_EXCEPTION_TYPE InterruptType, IN CONST EFI_SYSTEM_CONTEXT SystemContext)
EFI_STATUS EFIAPI SmmSwitchBsp(IN CONST EFI_SMM_CPU_SERVICE_PROTOCOL *This, IN UINTN ProcessorNumber)
EFI_STATUS EFIAPI SmmCpuRendezvous(IN EDKII_SMM_CPU_RENDEZVOUS_PROTOCOL *This, IN BOOLEAN BlockingMode)
EFI_STATUS InitializeSmmCpuServices(IN EFI_HANDLE Handle)
EFI_STATUS EFIAPI SmmRegisterExceptionHandler(IN EFI_SMM_CPU_SERVICE_PROTOCOL *This, IN EFI_EXCEPTION_TYPE ExceptionType, IN EFI_CPU_INTERRUPT_HANDLER InterruptHandler)
EFI_STATUS EFIAPI SmmAddProcessor(IN CONST EFI_SMM_CPU_SERVICE_PROTOCOL *This, IN UINT64 ProcessorId, OUT UINTN *ProcessorNumber)
EFI_STATUS EFIAPI SmmWhoAmI(IN CONST EFI_SMM_CPU_SERVICE_PROTOCOL *This, OUT UINTN *ProcessorNumber)
EFI_STATUS EFIAPI SmmGetProcessorInfo(IN CONST EFI_SMM_CPU_SERVICE_PROTOCOL *This, IN UINTN ProcessorNumber, OUT EFI_PROCESSOR_INFORMATION *ProcessorInfoBuffer)
EFI_STATUS EFIAPI SmmRemoveProcessor(IN CONST EFI_SMM_CPU_SERVICE_PROTOCOL *This, IN UINTN ProcessorNumber)
UINT32 EFIAPI GetApicId(VOID)
VOID EFIAPI GetProcessorLocation2ByApicId(IN UINT32 InitialApicId, OUT UINT32 *Package OPTIONAL, OUT UINT32 *Die OPTIONAL, OUT UINT32 *Tile OPTIONAL, OUT UINT32 *Module OPTIONAL, OUT UINT32 *Core OPTIONAL, OUT UINT32 *Thread OPTIONAL)
VOID EFIAPI GetProcessorLocationByApicId(IN UINT32 InitialApicId, OUT UINT32 *Package OPTIONAL, OUT UINT32 *Core OPTIONAL, OUT UINT32 *Thread OPTIONAL)
#define ASSERT_EFI_ERROR(StatusParameter)
#define DEBUG(Expression)
BOOLEAN EFIAPI SmmCpuFeaturesNeedConfigureMtrrs(VOID)
#define FeaturePcdGet(TokenName)
VOID SmmWaitForApArrival(VOID)
EFI_INSTALL_PROTOCOL_INTERFACE MmInstallProtocolInterface
UINTN CurrentlyExecutingCpu
UINTN CurrentlyExecutingCpu
EXTENDED_PROCESSOR_INFORMATION ExtendedInformation
EFI_CPU_PHYSICAL_LOCATION Location
EFI_CPU_PHYSICAL_LOCATION2 Location2