From nobody Fri Dec 27 18:04:03 2024 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1501752744621577.5889386139276; Thu, 3 Aug 2017 02:32:24 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 0B26C21AEB0B0; Thu, 3 Aug 2017 02:30:04 -0700 (PDT) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id D0AB121AEB0B0 for ; Thu, 3 Aug 2017 02:30:01 -0700 (PDT) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 03 Aug 2017 02:32:13 -0700 Received: from ydong10-win10.ccr.corp.intel.com ([10.239.158.51]) by orsmga002.jf.intel.com with ESMTP; 03 Aug 2017 02:32:11 -0700 X-Original-To: edk2-devel@lists.01.org X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.41,315,1498546800"; d="scan'208";a="119098256" From: Eric Dong To: edk2-devel@lists.01.org Date: Thu, 3 Aug 2017 17:32:03 +0800 Message-Id: <1501752726-14072-5-git-send-email-eric.dong@intel.com> X-Mailer: git-send-email 2.7.0.windows.1 In-Reply-To: <1501752726-14072-1-git-send-email-eric.dong@intel.com> References: <1501752726-14072-1-git-send-email-eric.dong@intel.com> Subject: [edk2] [Patch 4/7] QuarkSocPkg MtrrLib: Remove reference deprecated macro. X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Ruiyu Ni , Michael D Kinney , Jeff Fan MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Cc: Jeff Fan Cc: Ruiyu Ni Cc: Michael D Kinney Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Eric Dong Reviewed-by: Ruiyu Ni --- .../QuarkNorthCluster/Library/MtrrLib/MtrrLib.c | 26 +++++++++++++-----= ---- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/QuarkSocPkg/QuarkNorthCluster/Library/MtrrLib/MtrrLib.c b/Quar= kSocPkg/QuarkNorthCluster/Library/MtrrLib/MtrrLib.c index 2760427..fe00b37 100644 --- a/QuarkSocPkg/QuarkNorthCluster/Library/MtrrLib/MtrrLib.c +++ b/QuarkSocPkg/QuarkNorthCluster/Library/MtrrLib/MtrrLib.c @@ -23,6 +23,10 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHE= R EXPRESS OR IMPLIED. =20 #define QUARK_SOC_CPUID_FAMILY_MODEL_STEPPING 0x590 =20 +#define CACHE_MTRR_ENABLED 0x800 +#define CACHE_FIXED_MTRR_ENABLED 0x400 +#define IA32_MTRR_CAP_VCNT_MASK 0xFF + // // Context to save and restore when MTRRs are programmed // @@ -121,7 +125,7 @@ GetVariableMtrrCountWorker ( { UINT32 VariableMtrrCount; =20 - VariableMtrrCount =3D (UINT32)(MtrrRegisterRead (QUARK_NC_HOST_BRIDGE_IA= 32_MTRR_CAP) & MTRR_LIB_IA32_MTRR_CAP_VCNT_MASK); + VariableMtrrCount =3D (UINT32)(MtrrRegisterRead (QUARK_NC_HOST_BRIDGE_IA= 32_MTRR_CAP) & IA32_MTRR_CAP_VCNT_MASK); ASSERT (VariableMtrrCount <=3D MTRR_NUMBER_OF_VARIABLE_MTRR); return VariableMtrrCount; } @@ -558,7 +562,7 @@ MtrrGetMemoryAttributeInVariableMtrrWorker ( =20 ZeroMem (VariableMtrr, sizeof (VARIABLE_MTRR) * MTRR_NUMBER_OF_VARIABLE_= MTRR); for (Index =3D 0, UsedMtrr =3D 0; Index < FirmwareVariableMtrrCount; Ind= ex++) { - if ((VariableSettings->Mtrr[Index].Mask & MTRR_LIB_CACHE_MTRR_ENABLED)= !=3D 0) { + if ((VariableSettings->Mtrr[Index].Mask & CACHE_MTRR_ENABLED) !=3D 0) { VariableMtrr[Index].Msr =3D (UINT32)Index; VariableMtrr[Index].BaseAddress =3D (VariableSettings->Mtrr[Index].B= ase & MtrrValidAddressMask); VariableMtrr[Index].Length =3D ((~(VariableSettings->Mtrr[Index= ].Mask & MtrrValidAddressMask)) & MtrrValidBitsMask) + 1; @@ -969,7 +973,7 @@ ProgramVariableMtrr ( // MTRR Physical Mask // TempQword =3D ~(Length - 1); - VariableSettings->Mtrr[MtrrNumber].Mask =3D (TempQword & MtrrValidAddres= sMask) | MTRR_LIB_CACHE_MTRR_ENABLED; + VariableSettings->Mtrr[MtrrNumber].Mask =3D (TempQword & MtrrValidAddres= sMask) | CACHE_MTRR_ENABLED; } =20 =20 @@ -1157,7 +1161,7 @@ MtrrGetMemoryAttributeByAddressWorker ( } MtrrType =3D MTRR_CACHE_INVALID_TYPE; =20 - if ((TempQword & MTRR_LIB_CACHE_MTRR_ENABLED) =3D=3D 0) { + if ((TempQword & CACHE_MTRR_ENABLED) =3D=3D 0) { return CacheUncacheable; } =20 @@ -1165,7 +1169,7 @@ MtrrGetMemoryAttributeByAddressWorker ( // If address is less than 1M, then try to go through the fixed MTRR // if (Address < BASE_1MB) { - if ((TempQword & MTRR_LIB_CACHE_FIXED_MTRR_ENABLED) !=3D 0) { + if ((TempQword & CACHE_FIXED_MTRR_ENABLED) !=3D 0) { // // Go through the fixed MTRR // @@ -1539,7 +1543,7 @@ MtrrSetMemoryAttributeWorker ( } if (MtrrSetting !=3D NULL) { MtrrSetting->Fixed.Mtrr[MsrNum] =3D (MtrrSetting->Fixed.Mtrr[MsrNu= m] & ~ClearMask) | OrMask; - MtrrSetting->MtrrDefType |=3D MTRR_LIB_CACHE_FIXED_MTRR_ENABLED; + MtrrSetting->MtrrDefType |=3D CACHE_FIXED_MTRR_ENABLED; } else { if (!FixedSettingsValid[MsrNum]) { WorkingFixedSettings.Mtrr[MsrNum] =3D MtrrRegisterRead (mMtrrLib= FixedMtrrTable[MsrNum].Msr); @@ -1654,7 +1658,7 @@ MtrrSetMemoryAttributeWorker ( // Find first unused MTRR // for (MsrNum =3D 0; MsrNum < VariableMtrrCount; MsrNum++) { - if ((VariableSettings->Mtrr[MsrNum].Mask & MTRR_LIB_CACHE_MTRR_ENABLED= ) =3D=3D 0) { + if ((VariableSettings->Mtrr[MsrNum].Mask & CACHE_MTRR_ENABLED) =3D=3D = 0) { break; } } @@ -1674,7 +1678,7 @@ MtrrSetMemoryAttributeWorker ( // Find unused MTRR // for (; MsrNum < VariableMtrrCount; MsrNum++) { - if ((VariableSettings->Mtrr[MsrNum].Mask & MTRR_LIB_CACHE_MTRR_ENA= BLED) =3D=3D 0) { + if ((VariableSettings->Mtrr[MsrNum].Mask & CACHE_MTRR_ENABLED) =3D= =3D 0) { break; } } @@ -1705,7 +1709,7 @@ MtrrSetMemoryAttributeWorker ( // Find unused MTRR // for (; MsrNum < VariableMtrrCount; MsrNum++) { - if ((VariableSettings->Mtrr[MsrNum].Mask & MTRR_LIB_CACHE_MTRR_ENABL= ED) =3D=3D 0) { + if ((VariableSettings->Mtrr[MsrNum].Mask & CACHE_MTRR_ENABLED) =3D= =3D 0) { break; } } @@ -1728,7 +1732,7 @@ MtrrSetMemoryAttributeWorker ( // Find unused MTRR // for (; MsrNum < VariableMtrrCount; MsrNum++) { - if ((VariableSettings->Mtrr[MsrNum].Mask & MTRR_LIB_CACHE_MTRR_ENABL= ED) =3D=3D 0) { + if ((VariableSettings->Mtrr[MsrNum].Mask & CACHE_MTRR_ENABLED) =3D= =3D 0) { break; } } @@ -1801,7 +1805,7 @@ Done: DEBUG((DEBUG_CACHE, " Status =3D %r\n", Status)); if (!RETURN_ERROR (Status)) { if (MtrrSetting !=3D NULL) { - MtrrSetting->MtrrDefType |=3D MTRR_LIB_CACHE_MTRR_ENABLED; + MtrrSetting->MtrrDefType |=3D CACHE_MTRR_ENABLED; } MtrrDebugPrintAllMtrrsWorker (MtrrSetting); } --=20 2.7.0.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel