From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga02.intel.com (mga02.intel.com []) by mx.groups.io with SMTP id smtpd.web11.14795.1594628015690258850 for ; Mon, 13 Jul 2020 01:13:36 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=fail (domain: intel.com, ip: , mailfrom: ray.ni@intel.com) IronPort-SDR: vp80YILG0ywmFPLPQ3gB00QRWMgD5P1puqJtDnribJEvDB98I4u3dqxNU0JcZkBQ7j/LjKUZ0B oHON8q8GjozQ== X-IronPort-AV: E=McAfee;i="6000,8403,9680"; a="136743947" X-IronPort-AV: E=Sophos;i="5.75,346,1589266800"; d="scan'208";a="136743947" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Jul 2020 01:13:36 -0700 IronPort-SDR: yuNA+JLKBain/7JdvRP1d6nCQxbSn5OD/kc2gzChay5bPqUQpClwHelhZ5530FZTd7Yb4RikbQ hIQteQx3UZow== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,346,1589266800"; d="scan'208";a="307374204" Received: from ray-dev.ccr.corp.intel.com ([10.239.158.87]) by fmsmga004.fm.intel.com with ESMTP; 13 Jul 2020 01:13:33 -0700 From: "Ni, Ray" To: devel@edk2.groups.io Cc: Eric Dong , Laszlo Ersek , Rahul Kumar Subject: [PATCH v2 1/3] UefiCpuPkg/MtrrLib: Remove unnecessary API MtrrGetVariableMtrr() Date: Mon, 13 Jul 2020 16:12:34 +0800 Message-Id: <20200713081236.1284-2-ray.ni@intel.com> X-Mailer: git-send-email 2.27.0.windows.1 In-Reply-To: <20200713081236.1284-1-ray.ni@intel.com> References: <20200713081236.1284-1-ray.ni@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable MtrrGetVariableMtrr() returns all the variable MTRR settings. But in fact MtrrGetAllMtrrs() and MtrrGetMemoryAttributeInVariableMtrr() are used by callers to get the MTRR settings. The former one returns both the fixed and variable MTRR settings. The patch removes the necessary API MtrrGetVariableMtrr() to simplify the MtrrLib API. There is no code in edk2 and edk2-platforms repo that calls MtrrGetVariableMtrr(). Signed-off-by: Ray Ni Cc: Eric Dong Cc: Laszlo Ersek Cc: Rahul Kumar --- UefiCpuPkg/Include/Library/MtrrLib.h | 17 +---------------- UefiCpuPkg/Library/MtrrLib/MtrrLib.c | 27 +-------------------------- 2 files changed, 2 insertions(+), 42 deletions(-) diff --git a/UefiCpuPkg/Include/Library/MtrrLib.h b/UefiCpuPkg/Include/Libr= ary/MtrrLib.h index 95ffbc8bf1..cfe3c0ab59 100644 --- a/UefiCpuPkg/Include/Library/MtrrLib.h +++ b/UefiCpuPkg/Include/Library/MtrrLib.h @@ -1,7 +1,7 @@ /** @file=0D MTRR setting library=0D =0D - Copyright (c) 2008 - 2018, Intel Corporation. All rights reserved.
=0D + Copyright (c) 2008 - 2020, Intel Corporation. All rights reserved.
=0D SPDX-License-Identifier: BSD-2-Clause-Patent=0D =0D **/=0D @@ -185,21 +185,6 @@ MtrrGetMemoryAttribute ( );=0D =0D =0D -/**=0D - This function will get the raw value in variable MTRRs=0D -=0D - @param[out] VariableSettings A buffer to hold variable MTRRs content.= =0D -=0D - @return The buffer point to MTRR_VARIABLE_SETTINGS in which holds the co= ntent of the variable MTRR=0D -=0D -**/=0D -MTRR_VARIABLE_SETTINGS*=0D -EFIAPI=0D -MtrrGetVariableMtrr (=0D - OUT MTRR_VARIABLE_SETTINGS *VariableSettings=0D - );=0D -=0D -=0D /**=0D This function sets variable MTRRs=0D =0D diff --git a/UefiCpuPkg/Library/MtrrLib/MtrrLib.c b/UefiCpuPkg/Library/Mtrr= Lib/MtrrLib.c index dfa848022b..f4a10edc87 100644 --- a/UefiCpuPkg/Library/MtrrLib/MtrrLib.c +++ b/UefiCpuPkg/Library/MtrrLib/MtrrLib.c @@ -5,7 +5,7 @@ Most of services in this library instance are suggested to be invoked = by BSP only,=0D except for MtrrSetAllMtrrs() which is used to sync BSP's MTRR setting = to APs.=0D =0D - Copyright (c) 2008 - 2019, Intel Corporation. All rights reserved.
=0D + Copyright (c) 2008 - 2020, Intel Corporation. All rights reserved.
=0D SPDX-License-Identifier: BSD-2-Clause-Patent=0D =0D **/=0D @@ -456,31 +456,6 @@ MtrrGetVariableMtrrWorker ( return VariableSettings;=0D }=0D =0D -/**=0D - This function will get the raw value in variable MTRRs=0D -=0D - @param[out] VariableSettings A buffer to hold variable MTRRs content.= =0D -=0D - @return The VariableSettings input pointer=0D -=0D -**/=0D -MTRR_VARIABLE_SETTINGS*=0D -EFIAPI=0D -MtrrGetVariableMtrr (=0D - OUT MTRR_VARIABLE_SETTINGS *VariableSettings=0D - )=0D -{=0D - if (!IsMtrrSupported ()) {=0D - return VariableSettings;=0D - }=0D -=0D - return MtrrGetVariableMtrrWorker (=0D - NULL,=0D - GetVariableMtrrCountWorker (),=0D - VariableSettings=0D - );=0D -}=0D -=0D /**=0D Programs fixed MTRRs registers.=0D =0D --=20 2.27.0.windows.1