From e033a1a83e84effb893899d9272778be5d7f2e1f Mon Sep 17 00:00:00 2001 From: Chen Fan Date: Mon, 9 Mar 2015 06:38:16 +0000 Subject: [PATCH] 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 Reviewed-by: Jeff Fan Reviewed-by: Jordan Justen git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17022 6f19259b-4bc3-4df7-8a09-765794883524 --- UefiCpuPkg/CpuDxe/CpuMp.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/UefiCpuPkg/CpuDxe/CpuMp.c b/UefiCpuPkg/CpuDxe/CpuMp.c index 25b6fcb056..25c909193e 100644 --- a/UefiCpuPkg/CpuDxe/CpuMp.c +++ b/UefiCpuPkg/CpuDxe/CpuMp.c @@ -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); -- 2.39.2