diff options
author | Dong, Eric <eric.dong@intel.com> | 2020-04-10 14:54:00 +0800 |
---|---|---|
committer | mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> | 2020-04-13 03:13:36 +0000 |
commit | d84f090fd7629d026a70d592a7be081d1447357d (patch) | |
tree | 4949eb171dbd5dcb040f34d04857e4139887ade2 /UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c | |
parent | 3fdc47c65bba3fbbec96b5c8c8b7615dfefa9d42 (diff) | |
download | edk2-d84f090fd7629d026a70d592a7be081d1447357d.tar.gz edk2-d84f090fd7629d026a70d592a7be081d1447357d.tar.bz2 edk2-d84f090fd7629d026a70d592a7be081d1447357d.zip |
UefiCpuPkg/PiSmmCpuDxeSmm: Remove Used parameter.
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2388
After patch "UefiCpuPkg/PiSmmCpuDxeSmm: Improve the
performance of GetFreeToken()" which adds new parameter
FirstFreeToken, it's not need to use Uses parameter.
This patch used to remove this parameter.
Signed-off-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Ray Ni <ray.ni@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Diffstat (limited to 'UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c')
-rw-r--r-- | UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c b/UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c index 93cac5e4fa..305bffa9bc 100644 --- a/UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c +++ b/UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c @@ -441,7 +441,6 @@ ResetTokens ( ProcToken = PROCEDURE_TOKEN_FROM_LINK (Link);
ProcToken->RunningApCount = 0;
- ProcToken->Used = FALSE;
//
// Check the spinlock status and release it if not released yet.
@@ -1049,10 +1048,13 @@ IsTokenInUse ( }
Link = GetFirstNode (&gSmmCpuPrivate->TokenList);
- while (!IsNull (&gSmmCpuPrivate->TokenList, Link)) {
+ //
+ // Only search used tokens.
+ //
+ while (Link != gSmmCpuPrivate->FirstFreeToken) {
ProcToken = PROCEDURE_TOKEN_FROM_LINK (Link);
- if (ProcToken->Used && ProcToken->SpinLock == Token) {
+ if (ProcToken->SpinLock == Token) {
return TRUE;
}
@@ -1104,7 +1106,6 @@ AllocateTokenBuffer ( ProcTokens[Index].Signature = PROCEDURE_TOKEN_SIGNATURE;
ProcTokens[Index].SpinLock = SpinLock;
- ProcTokens[Index].Used = FALSE;
ProcTokens[Index].RunningApCount = 0;
InsertTailList (&gSmmCpuPrivate->TokenList, &ProcTokens[Index].Link);
@@ -1140,7 +1141,6 @@ GetFreeToken ( NewToken = PROCEDURE_TOKEN_FROM_LINK (gSmmCpuPrivate->FirstFreeToken);
gSmmCpuPrivate->FirstFreeToken = GetNextNode (&gSmmCpuPrivate->TokenList, gSmmCpuPrivate->FirstFreeToken);
- NewToken->Used = TRUE;
NewToken->RunningApCount = RunningApsCount;
AcquireSpinLock (NewToken->SpinLock);
|