diff --git a/UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c b/UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c index e988ce0542..71d6b0c6d8 100644 --- a/UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c +++ b/UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c @@ -696,10 +696,10 @@ BSPHandler ( ResetTokens (); // - // Reset BspIndex to -1, meaning BSP has not been elected. + // Reset BspIndex to MAX_UINT32, meaning BSP has not been elected. // if (FeaturePcdGet (PcdCpuSmmEnableBspElection)) { - mSmmMpSyncData->BspIndex = (UINT32)-1; + mSmmMpSyncData->BspIndex = MAX_UINT32; } // @@ -747,7 +747,7 @@ APHandler ( // // BSP timeout in the first round // - if (mSmmMpSyncData->BspIndex != -1) { + if (mSmmMpSyncData->BspIndex != MAX_UINT32) { // // BSP Index is known // Existing AP is in SMI now but BSP not in, so, try bring BSP in SMM. @@ -1656,7 +1656,7 @@ SmiRendezvous ( // InterlockedCompareExchange32 ( (UINT32 *)&mSmmMpSyncData->BspIndex, - (UINT32)-1, + MAX_UINT32, (UINT32)CpuIndex ); } @@ -1854,9 +1854,9 @@ InitializeMpSyncData ( mSmmMpSyncData->CandidateBsp = (BOOLEAN *)(mSmmMpSyncData->CpuData + gSmmCpuPrivate->SmmCoreEntryContext.NumberOfCpus); if (FeaturePcdGet (PcdCpuSmmEnableBspElection)) { // - // Enable BSP election by setting BspIndex to -1 + // Enable BSP election by setting BspIndex to MAX_UINT32 // - mSmmMpSyncData->BspIndex = (UINT32)-1; + mSmmMpSyncData->BspIndex = MAX_UINT32; } else { // // Use NonSMM BSP as SMM BSP