mirror of https://github.com/acidanthera/audk.git
UefiCpuPkg CpuDxe: Enhance get mtrr mask logic.
In order to not use the deprecated macro, refine get mtrr mask value logic. Cc: Jeff Fan <jeff.fan@intel.com> Cc: Ruiyu Ni <ruiyu.ni@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Eric Dong <eric.dong@intel.com> Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
This commit is contained in:
parent
055fa1c666
commit
c894f83fe3
|
@ -25,8 +25,8 @@
|
|||
BOOLEAN InterruptState = FALSE;
|
||||
EFI_HANDLE mCpuHandle = NULL;
|
||||
BOOLEAN mIsFlushingGCD;
|
||||
UINT64 mValidMtrrAddressMask = MTRR_LIB_CACHE_VALID_ADDRESS;
|
||||
UINT64 mValidMtrrBitsMask = MTRR_LIB_MSR_VALID_MASK;
|
||||
UINT64 mValidMtrrAddressMask;
|
||||
UINT64 mValidMtrrBitsMask;
|
||||
UINT64 mTimerPeriod = 0;
|
||||
|
||||
FIXED_MTRR mFixedMtrrTable[] = {
|
||||
|
@ -510,13 +510,12 @@ InitializeMtrrMask (
|
|||
AsmCpuid (0x80000008, &RegEax, NULL, NULL, NULL);
|
||||
|
||||
PhysicalAddressBits = (UINT8) RegEax;
|
||||
|
||||
mValidMtrrBitsMask = LShiftU64 (1, PhysicalAddressBits) - 1;
|
||||
mValidMtrrAddressMask = mValidMtrrBitsMask & 0xfffffffffffff000ULL;
|
||||
} else {
|
||||
mValidMtrrBitsMask = MTRR_LIB_MSR_VALID_MASK;
|
||||
mValidMtrrAddressMask = MTRR_LIB_CACHE_VALID_ADDRESS;
|
||||
PhysicalAddressBits = 36;
|
||||
}
|
||||
|
||||
mValidMtrrBitsMask = LShiftU64 (1, PhysicalAddressBits) - 1;
|
||||
mValidMtrrAddressMask = mValidMtrrBitsMask & 0xfffffffffffff000ULL;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue