Revision: 19093
          http://sourceforge.net/p/edk2/code/19093
Author:   vanjeff
Date:     2015-12-02 03:25:21 +0000 (Wed, 02 Dec 2015)
Log Message:
-----------
UefiCpuPkg/CpuMpPei: Set AP state to CpuStateIdle after initialization

(Sync patch r19087 from main trunk.)

Cc: Feng Tian <[email protected]>
Cc: Michael Kinney <[email protected]>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jeff Fan <[email protected]>
Reviewed-by: Feng Tian <[email protected]>

Revision Links:
--------------
    http://sourceforge.net/p/edk2/code/19087

Modified Paths:
--------------
    branches/UDK2015/UefiCpuPkg/CpuMpPei/CpuMpPei.c

Modified: branches/UDK2015/UefiCpuPkg/CpuMpPei/CpuMpPei.c
===================================================================
--- branches/UDK2015/UefiCpuPkg/CpuMpPei/CpuMpPei.c     2015-12-02 03:24:52 UTC 
(rev 19092)
+++ branches/UDK2015/UefiCpuPkg/CpuMpPei/CpuMpPei.c     2015-12-02 03:25:21 UTC 
(rev 19093)
@@ -228,13 +228,14 @@
 
   PeiCpuMpData = ExchangeInfo->PeiCpuMpData;
   if (PeiCpuMpData->InitFlag) {
+    ProcessorNumber = NumApsExecuting;
     //
     // This is first time AP wakeup, get BIST information from AP stack
     //
-    BistData = *(UINTN *) (PeiCpuMpData->Buffer + NumApsExecuting * 
PeiCpuMpData->CpuApStackSize - sizeof (UINTN));
-    PeiCpuMpData->CpuData[NumApsExecuting].Health.Uint32 = (UINT32) BistData;
-    PeiCpuMpData->CpuData[NumApsExecuting].ApicId = GetInitialApicId ();
-    if (PeiCpuMpData->CpuData[NumApsExecuting].ApicId >= 0xFF) {
+    BistData = *(UINTN *) (PeiCpuMpData->Buffer + ProcessorNumber * 
PeiCpuMpData->CpuApStackSize - sizeof (UINTN));
+    PeiCpuMpData->CpuData[ProcessorNumber].Health.Uint32 = (UINT32) BistData;
+    PeiCpuMpData->CpuData[ProcessorNumber].ApicId = GetInitialApicId ();
+    if (PeiCpuMpData->CpuData[ProcessorNumber].ApicId >= 0xFF) {
       //
       // Set x2APIC mode if there are any logical processor reporting
       // an APIC ID of 255 or greater.
@@ -248,6 +249,7 @@
     //
     MtrrSetAllMtrrs (&PeiCpuMpData->MtrrTable);
     MicrocodeDetect ();
+    PeiCpuMpData->CpuData[ProcessorNumber].State = CpuStateIdle;
   } else {
     //
     // Execute AP function if AP is not disabled


------------------------------------------------------------------------------
Go from Idea to Many App Stores Faster with Intel(R) XDK
Give your users amazing mobile app experiences with Intel(R) XDK.
Use one codebase in this all-in-one HTML5 development environment.
Design, debug & build mobile apps & 2D/3D high-impact games for multiple OSs.
http://pubads.g.doubleclick.net/gampad/clk?id=254741911&iu=/4140
_______________________________________________
edk2-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-commits

Reply via email to