UefiCpuPkg/MpService: avoid next timer getting into CheckAllAPsStatus()

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Chen Fan <chen.fan.fnst@cn.fujitsu.com>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16364 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
Chen Fan 2014-11-13 18:28:48 +00:00 committed by jljusten
parent d16cf36d2a
commit e4aaf76428
1 changed files with 22 additions and 1 deletions

View File

@ -1231,6 +1231,7 @@ CheckAllAPsStatus (
{
CPU_DATA_BLOCK *CpuData;
UINTN Number;
EFI_STATUS Status;
if (mMpSystemData.TimeoutActive) {
mMpSystemData.Timeout -= gPollInterval;
@ -1240,6 +1241,16 @@ CheckAllAPsStatus (
return;
}
//
// avoid next timer enter.
//
Status = gBS->SetTimer (
mMpSystemData.CheckAllAPsEvent,
TimerCancel,
0
);
ASSERT_EFI_ERROR (Status);
if (mMpSystemData.WaitEvent != NULL) {
CheckAndUpdateAllAPsToIdleState ();
//
@ -1254,13 +1265,15 @@ CheckAllAPsStatus (
}
if (mMpSystemData.FinishCount != mMpSystemData.StartCount) {
return;
goto EXIT;
}
mMpSystemData.TimeoutActive = FALSE;
gBS->SignalEvent (mMpSystemData.WaitEvent);
mMpSystemData.WaitEvent = NULL;
mStopCheckAllAPsStatus = TRUE;
goto EXIT;
}
//
@ -1286,6 +1299,14 @@ CheckAllAPsStatus (
CheckThisAPStatus (NULL, (VOID *)CpuData);
}
}
EXIT:
Status = gBS->SetTimer (
mMpSystemData.CheckAllAPsEvent,
TimerPeriodic,
EFI_TIMER_PERIOD_MICROSECONDS (100)
);
ASSERT_EFI_ERROR (Status);
}
/**