mirror of https://github.com/acidanthera/audk.git
UefiCpuPkg/PiSmmCpuDxeSmm: Avoid BspIndex typecasting
Use MAX_UINT32 directly instead of typecasting from signed to unsigned value. Cc: Ray Ni <ray.ni@intel.com> Cc: Laszlo Ersek <lersek@redhat.com> Cc: Eric Dong <eric.dong@intel.com> Cc: Zeng Star <star.zeng@intel.com> Cc: Gerd Hoffmann <kraxel@redhat.com> Cc: Rahul Kumar <rahul1.kumar@intel.com> Cc: Kinney Michael D <michael.d.kinney@intel.com> Signed-off-by: Jiaxin Wu <jiaxin.wu@intel.com> Reviewed-by: Ray Ni <ray.ni@intel.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
This commit is contained in:
parent
edc6681206
commit
d698bcfe4f
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue