]> git.proxmox.com Git - mirror_edk2.git/blobdiff - UefiCpuPkg/Library/MpInitLib/MpLib.h
UefiCpuPkg/MpInitLib: Not use disabled AP when call StartAllAPs.
[mirror_edk2.git] / UefiCpuPkg / Library / MpInitLib / MpLib.h
index 9aedb52636e6fb2fce1d583dde67654c65462e92..75f3fdda1d84148177d92afc0926f1f5cf7f12db 100644 (file)
@@ -81,11 +81,14 @@ typedef enum {
 //\r
 // AP state\r
 //\r
+// The state transitions for an AP when it process a procedure are:\r
+//  Idle ----> Ready ----> Busy ----> Idle\r
+//       [BSP]       [AP]       [AP]\r
+//\r
 typedef enum {\r
   CpuStateIdle,\r
   CpuStateReady,\r
   CpuStateBusy,\r
-  CpuStateFinished,\r
   CpuStateDisabled\r
 } CPU_STATE;\r
 \r
@@ -212,9 +215,8 @@ struct _CPU_MP_DATA {
   UINTN                          BackupBuffer;\r
   UINTN                          BackupBufferSize;\r
 \r
-  volatile UINT32                StartCount;\r
   volatile UINT32                FinishedCount;\r
-  volatile UINT32                RunningCount;\r
+  UINT32                         RunningCount;\r
   BOOLEAN                        SingleThread;\r
   EFI_AP_PROCEDURE               Procedure;\r
   VOID                           *ProcArguments;\r
@@ -245,6 +247,20 @@ struct _CPU_MP_DATA {
   BOOLEAN                        TimerInterruptState;\r
   UINT64                         MicrocodePatchAddress;\r
   UINT64                         MicrocodePatchRegionSize;\r
+\r
+  UINT32                         ProcessorSignature;\r
+  UINT32                         ProcessorFlags;\r
+  UINT64                         MicrocodeDataAddress;\r
+  UINT32                         MicrocodeRevision;\r
+\r
+  //\r
+  // Whether need to use Init-Sipi-Sipi to wake up the APs.\r
+  // Two cases need to set this value to TRUE. One is in HLT\r
+  // loop mode, the other is resume from S3 which loop mode\r
+  // will be hardcode change to HLT mode by PiSmmCpuDxeSmm \r
+  // driver.\r
+  //\r
+  BOOLEAN                        WakeUpByInitSipiSipi;\r
 };\r
 \r
 extern EFI_GUID mCpuInitMpLibHobGuid;\r
@@ -361,6 +377,7 @@ GetModeTransitionBuffer (
   @param[in] ProcessorNumber    The handle number of specified processor\r
   @param[in] Procedure          The function to be invoked by AP\r
   @param[in] ProcedureArgument  The argument to be passed into AP function\r
+  @param[in] WakeUpDisabledAps  Whether need to wake up disabled APs in broadcast mode.\r
 **/\r
 VOID\r
 WakeUpAP (\r
@@ -368,7 +385,8 @@ WakeUpAP (
   IN BOOLEAN                   Broadcast,\r
   IN UINTN                     ProcessorNumber,\r
   IN EFI_AP_PROCEDURE          Procedure,              OPTIONAL\r
-  IN VOID                      *ProcedureArgument      OPTIONAL\r
+  IN VOID                      *ProcedureArgument,     OPTIONAL\r
+  IN BOOLEAN                   WakeUpDisabledAps       OPTIONAL\r
   );\r
 \r
 /**\r
@@ -546,11 +564,13 @@ CheckAndUpdateApsStatus (
 /**\r
   Detect whether specified processor can find matching microcode patch and load it.\r
 \r
-  @param[in]  CpuMpData  The pointer to CPU MP Data structure.\r
+  @param[in]  CpuMpData    The pointer to CPU MP Data structure.\r
+  @param[in]  IsBspCallIn  Indicate whether the caller is BSP or not.\r
 **/\r
 VOID\r
 MicrocodeDetect (\r
-  IN CPU_MP_DATA             *CpuMpData\r
+  IN CPU_MP_DATA             *CpuMpData,\r
+  IN BOOLEAN                 IsBspCallIn\r
   );\r
 \r
 /**\r