Revision: 17022
          http://sourceforge.net/p/edk2/code/17022
Author:   vanjeff
Date:     2015-03-09 06:38:16 +0000 (Mon, 09 Mar 2015)
Log Message:
-----------
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 <[email protected]>
Reviewed-by: Jeff Fan <[email protected]>
Reviewed-by: Jordan Justen <[email protected]>

Modified Paths:
--------------
    trunk/edk2/UefiCpuPkg/CpuDxe/CpuMp.c

Modified: trunk/edk2/UefiCpuPkg/CpuDxe/CpuMp.c
===================================================================
--- trunk/edk2/UefiCpuPkg/CpuDxe/CpuMp.c        2015-03-09 06:37:32 UTC (rev 
17021)
+++ trunk/edk2/UefiCpuPkg/CpuDxe/CpuMp.c        2015-03-09 06:38:16 UTC (rev 
17022)
@@ -1176,11 +1176,14 @@
   }
 
   //
-  // 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 @@
     ReleaseMpSpinLock (CpuData);
 
     if (Procedure != NULL) {
+      SetApState (CpuData, CpuStateBusy);
+
       Procedure (ProcedureArgument);
 
       GetMpSpinLock (CpuData);


------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
edk2-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-commits

Reply via email to