]> git.proxmox.com Git - mirror_edk2.git/commitdiff
UefiCpuPkg/MpService: put AP to busy state when execution
authorChen Fan <chen.fan.fnst@cn.fujitsu.com>
Mon, 9 Mar 2015 06:38:16 +0000 (06:38 +0000)
committervanjeff <vanjeff@Edk2>
Mon, 9 Mar 2015 06:38:16 +0000 (06:38 +0000)
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

UefiCpuPkg/CpuDxe/CpuMp.c

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