UefiCpuPkg/MpService: put AP to busy state when execution

CpuState should follow the process?

    Idle -> Ready -> Busy -> Finished
     ^                         |
     |                         |
     + - - - - - - - - - - - - +

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>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17022 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
Chen Fan 2015-03-09 06:38:16 +00:00 committed by vanjeff
parent b302a9784c
commit e033a1a83e
1 changed files with 7 additions and 2 deletions

View File

@ -1176,11 +1176,14 @@ ProcessorToIdleState (
}
//
// Avoid forcibly reset AP caused the AP State is not updated.
// Avoid forcibly reset AP caused the timeout AP State is not
// updated.
//
GetMpSpinLock (CpuData);
if (CpuData->State == CpuStateBusy) {
CpuData->Procedure = NULL;
}
CpuData->State = CpuStateIdle;
CpuData->Procedure = NULL;
ReleaseMpSpinLock (CpuData);
while (TRUE) {
@ -1190,6 +1193,8 @@ ProcessorToIdleState (
ReleaseMpSpinLock (CpuData);
if (Procedure != NULL) {
SetApState (CpuData, CpuStateBusy);
Procedure (ProcedureArgument);
GetMpSpinLock (CpuData);