From 386f5785ea31fc535a7d85e7f477da2dc0a8c9ba Mon Sep 17 00:00:00 2001 From: Ruiyu Ni Date: Fri, 2 Sep 2016 10:35:45 +0800 Subject: UefiCpuPkg/MtrrLib: GetVariableMtrrCountWorker uses definitions in Msr.h Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni Reviewed-by: Jeff Fan --- UefiCpuPkg/Library/MtrrLib/MtrrLib.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/UefiCpuPkg/Library/MtrrLib/MtrrLib.c b/UefiCpuPkg/Library/MtrrLib/MtrrLib.c index b80519ba6d..cbcc584f1f 100644 --- a/UefiCpuPkg/Library/MtrrLib/MtrrLib.c +++ b/UefiCpuPkg/Library/MtrrLib/MtrrLib.c @@ -124,11 +124,11 @@ GetVariableMtrrCountWorker ( VOID ) { - UINT32 VariableMtrrCount; + MSR_IA32_MTRRCAP_REGISTER MtrrCap; - VariableMtrrCount = (UINT32)(AsmReadMsr64 (MTRR_LIB_IA32_MTRR_CAP) & MTRR_LIB_IA32_MTRR_CAP_VCNT_MASK); - ASSERT (VariableMtrrCount <= MTRR_NUMBER_OF_VARIABLE_MTRR); - return VariableMtrrCount; + MtrrCap.Uint64 = AsmReadMsr64 (MSR_IA32_MTRRCAP); + ASSERT (MtrrCap.Bits.VCNT <= MTRR_NUMBER_OF_VARIABLE_MTRR); + return MtrrCap.Bits.VCNT; } /** -- cgit v1.2.3