summaryrefslogtreecommitdiffstats
path: root/UefiCpuPkg/PiSmmCpuDxeSmm
diff options
context:
space:
mode:
authorJiaxin Wu <jiaxin.wu@intel.com>2024-02-06 15:49:00 +0800
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2024-02-21 01:33:51 +0000
commitd698bcfe4f3da50418561eaf8d6163136c714f01 (patch)
tree3e15f138b0b3c6c7ddefdc09c5c6871f2fbfbf72 /UefiCpuPkg/PiSmmCpuDxeSmm
parentedc6681206c1a8791981a2f911d2fb8b3d2f5768 (diff)
downloadedk2-d698bcfe4f3da50418561eaf8d6163136c714f01.tar.gz
edk2-d698bcfe4f3da50418561eaf8d6163136c714f01.tar.bz2
edk2-d698bcfe4f3da50418561eaf8d6163136c714f01.zip
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>
Diffstat (limited to 'UefiCpuPkg/PiSmmCpuDxeSmm')
-rw-r--r--UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c12
1 files changed, 6 insertions, 6 deletions
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