EdkCompatibilityPkg: SmmBaseHelper: remove set but unused variables

This patch also eliminates an AsmReadCr3() call in PageFaultHandler(), but
that should not be a problem.

Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>
This commit is contained in:
Laszlo Ersek 2016-03-18 19:27:12 +01:00
parent dbd62b34bc
commit beca921d98
1 changed files with 8 additions and 11 deletions

View File

@ -228,7 +228,6 @@ WriteCpuSaveState (
IN EFI_SMM_CPU_SAVE_STATE *ToWrite IN EFI_SMM_CPU_SAVE_STATE *ToWrite
) )
{ {
EFI_STATUS Status;
UINTN Index; UINTN Index;
EFI_SMM_CPU_STATE *State; EFI_SMM_CPU_STATE *State;
EFI_SMI_CPU_SAVE_STATE *SaveState; EFI_SMI_CPU_SAVE_STATE *SaveState;
@ -250,14 +249,14 @@ WriteCpuSaveState (
State->x86.AutoHALTRestart = SaveState->AutoHALTRestart; State->x86.AutoHALTRestart = SaveState->AutoHALTRestart;
for (Index = 0; Index < sizeof (mCpuSaveStateConvTable) / sizeof (CPU_SAVE_STATE_CONVERSION); Index++) { for (Index = 0; Index < sizeof (mCpuSaveStateConvTable) / sizeof (CPU_SAVE_STATE_CONVERSION); Index++) {
Status = mSmmCpu->WriteSaveState ( mSmmCpu->WriteSaveState (
mSmmCpu, mSmmCpu,
(UINTN)sizeof (UINT32), (UINTN)sizeof (UINT32),
mCpuSaveStateConvTable[Index].Register, mCpuSaveStateConvTable[Index].Register,
CpuIndex, CpuIndex,
((UINT8 *)SaveState) + ((UINT8 *)SaveState) +
mCpuSaveStateConvTable[Index].Offset mCpuSaveStateConvTable[Index].Offset
); );
} }
} }
@ -345,14 +344,12 @@ PageFaultHandler (
) )
{ {
BOOLEAN IsHandled; BOOLEAN IsHandled;
UINT64 *PageTable;
UINT64 PFAddress; UINT64 PFAddress;
UINTN NumCpuStatePages; UINTN NumCpuStatePages;
ASSERT (mPageTableHookEnabled); ASSERT (mPageTableHookEnabled);
AcquireSpinLock (&mPFLock); AcquireSpinLock (&mPFLock);
PageTable = (UINT64*)(UINTN)(AsmReadCr3 () & mPhyMask);
PFAddress = AsmReadCr2 (); PFAddress = AsmReadCr2 ();
NumCpuStatePages = EFI_SIZE_TO_PAGES (mNumberOfProcessors * sizeof (EFI_SMM_CPU_SAVE_STATE)); NumCpuStatePages = EFI_SIZE_TO_PAGES (mNumberOfProcessors * sizeof (EFI_SMM_CPU_SAVE_STATE));
IsHandled = FALSE; IsHandled = FALSE;