mirror of https://github.com/acidanthera/audk.git
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>
This commit is contained in:
parent
3fdc47c65b
commit
d84f090fd7
|
@ -441,7 +441,6 @@ ResetTokens (
|
||||||
ProcToken = PROCEDURE_TOKEN_FROM_LINK (Link);
|
ProcToken = PROCEDURE_TOKEN_FROM_LINK (Link);
|
||||||
|
|
||||||
ProcToken->RunningApCount = 0;
|
ProcToken->RunningApCount = 0;
|
||||||
ProcToken->Used = FALSE;
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// Check the spinlock status and release it if not released yet.
|
// Check the spinlock status and release it if not released yet.
|
||||||
|
@ -1049,10 +1048,13 @@ IsTokenInUse (
|
||||||
}
|
}
|
||||||
|
|
||||||
Link = GetFirstNode (&gSmmCpuPrivate->TokenList);
|
Link = GetFirstNode (&gSmmCpuPrivate->TokenList);
|
||||||
while (!IsNull (&gSmmCpuPrivate->TokenList, Link)) {
|
//
|
||||||
|
// Only search used tokens.
|
||||||
|
//
|
||||||
|
while (Link != gSmmCpuPrivate->FirstFreeToken) {
|
||||||
ProcToken = PROCEDURE_TOKEN_FROM_LINK (Link);
|
ProcToken = PROCEDURE_TOKEN_FROM_LINK (Link);
|
||||||
|
|
||||||
if (ProcToken->Used && ProcToken->SpinLock == Token) {
|
if (ProcToken->SpinLock == Token) {
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1104,7 +1106,6 @@ AllocateTokenBuffer (
|
||||||
|
|
||||||
ProcTokens[Index].Signature = PROCEDURE_TOKEN_SIGNATURE;
|
ProcTokens[Index].Signature = PROCEDURE_TOKEN_SIGNATURE;
|
||||||
ProcTokens[Index].SpinLock = SpinLock;
|
ProcTokens[Index].SpinLock = SpinLock;
|
||||||
ProcTokens[Index].Used = FALSE;
|
|
||||||
ProcTokens[Index].RunningApCount = 0;
|
ProcTokens[Index].RunningApCount = 0;
|
||||||
|
|
||||||
InsertTailList (&gSmmCpuPrivate->TokenList, &ProcTokens[Index].Link);
|
InsertTailList (&gSmmCpuPrivate->TokenList, &ProcTokens[Index].Link);
|
||||||
|
@ -1140,7 +1141,6 @@ GetFreeToken (
|
||||||
NewToken = PROCEDURE_TOKEN_FROM_LINK (gSmmCpuPrivate->FirstFreeToken);
|
NewToken = PROCEDURE_TOKEN_FROM_LINK (gSmmCpuPrivate->FirstFreeToken);
|
||||||
gSmmCpuPrivate->FirstFreeToken = GetNextNode (&gSmmCpuPrivate->TokenList, gSmmCpuPrivate->FirstFreeToken);
|
gSmmCpuPrivate->FirstFreeToken = GetNextNode (&gSmmCpuPrivate->TokenList, gSmmCpuPrivate->FirstFreeToken);
|
||||||
|
|
||||||
NewToken->Used = TRUE;
|
|
||||||
NewToken->RunningApCount = RunningApsCount;
|
NewToken->RunningApCount = RunningApsCount;
|
||||||
AcquireSpinLock (NewToken->SpinLock);
|
AcquireSpinLock (NewToken->SpinLock);
|
||||||
|
|
||||||
|
|
|
@ -214,7 +214,6 @@ typedef struct {
|
||||||
|
|
||||||
SPIN_LOCK *SpinLock;
|
SPIN_LOCK *SpinLock;
|
||||||
volatile UINT32 RunningApCount;
|
volatile UINT32 RunningApCount;
|
||||||
BOOLEAN Used;
|
|
||||||
} PROCEDURE_TOKEN;
|
} PROCEDURE_TOKEN;
|
||||||
|
|
||||||
#define PROCEDURE_TOKEN_FROM_LINK(a) CR (a, PROCEDURE_TOKEN, Link, PROCEDURE_TOKEN_SIGNATURE)
|
#define PROCEDURE_TOKEN_FROM_LINK(a) CR (a, PROCEDURE_TOKEN, Link, PROCEDURE_TOKEN_SIGNATURE)
|
||||||
|
|
Loading…
Reference in New Issue