From nobody Sun May 5 06:53:41 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+62400+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+62400+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1594626318; cv=none; d=zohomail.com; s=zohoarc; b=L2kyWP4LiaaKGNq7Tod7AWQNmnsj6KmCixzOKR7z/GUQsPth+f+Bpa1O82EdoZP4RGZUSsmH3QwMCuRh2GWz5VUQQ7JK++dJCaHOOZdvaQ65rEBtWKSna7pFAn0jbsqrPwT9VLR4xo155d5V3HhDEB3IMEtzxCW6roldqII6+Og= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1594626318; h=Content-Transfer-Encoding:Cc:Date:From:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Sender:Subject:To; bh=PgwXCUoWVjXUgrTF7DG+p6kwLaZmF2iNNgZc8sD8JFg=; b=h4Mm4q59MD4ysWtUGInZy5TtlO6BF1PtCXsP5jBiBTNi2zEjVk+rnL5WpLsrHPKppaqFKP++olKJ93m2wxwsfZ33eqCX47uyZ59Hbv/U7BrzmkbIvs/QQD0yMTEUk3Bjsj7avHBtNZiugZvfWRVx0dpxyG4pmV6F3bUtBFBVJ4k= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+62400+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1594626318195634.3252222031198; Mon, 13 Jul 2020 00:45:18 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id FhFeYY1788612x7hyg5Sqjwu; Mon, 13 Jul 2020 00:45:17 -0700 X-Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by mx.groups.io with SMTP id smtpd.web12.14658.1594626317049250520 for ; Mon, 13 Jul 2020 00:45:17 -0700 IronPort-SDR: hxVTP9PapSFumhqYkh1AptgOJIZZHv+UWLcEBFD6NLoKpjjFQj41wmuHIAZhHjWLs9/xqerdjc C3cbEhGpxe6g== X-IronPort-AV: E=McAfee;i="6000,8403,9680"; a="136043101" X-IronPort-AV: E=Sophos;i="5.75,346,1589266800"; d="scan'208";a="136043101" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Jul 2020 00:45:12 -0700 IronPort-SDR: c/MCaXdmimJlngkkncix7OYI97L2iH4UAwr0UEh8UPGbOa1YUHmfai9X2Ao814QVZIPWZILNqs 44o9/sCU7vIg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,346,1589266800"; d="scan'208";a="429282925" X-Received: from ray-dev.ccr.corp.intel.com ([10.239.158.87]) by orsmga004.jf.intel.com with ESMTP; 13 Jul 2020 00:45:11 -0700 From: "Ni, Ray" To: devel@edk2.groups.io Cc: Eric Dong , Laszlo Ersek , Rahul Kumar Subject: [edk2-devel] [PATCH] UefiCpuPkg/MtrrLib: Remove unnecessary API MtrrGetVariableMtrr() Date: Mon, 13 Jul 2020 15:44:16 +0800 Message-Id: <20200713074416.1343-1-ray.ni@intel.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,ray.ni@intel.com X-Gm-Message-State: KoSZcdTRKyH7In50fBouH8wnx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1594626317; bh=ygrx7U1pIlGfG1HKa3JJWSV8wmspyaisG+U2pZOpgfE=; h=Cc:Date:From:Reply-To:Subject:To; b=DmFQ/4dgaSg8CoCwm+uCW05or/eEFf7Jx1jjAYLMmB8M7h8YTFA4idW0yclAPRLffj9 tURf4yi1uLiZiNGZwUkrgl/3e8T9pREltKNU2udX/0C8sQfOlk8A+e3QU+zALln/Eni9a lPkfon5Mzy8PTonwKKG7T6ngzKqyVIzoJGM= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" MtrrGetVariableMtrr() returns all the variable MTRR settings. But in fact MtrrGetAllMtrrs() is always used by callers to get all MTRR settings including the fixed and variable ones. 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 MTRR setting library =20 - Copyright (c) 2008 - 2018, Intel Corporation. All rights reserved.
+ Copyright (c) 2008 - 2020, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent =20 **/ @@ -185,21 +185,6 @@ MtrrGetMemoryAttribute ( ); =20 =20 -/** - This function will get the raw value in variable MTRRs - - @param[out] VariableSettings A buffer to hold variable MTRRs content. - - @return The buffer point to MTRR_VARIABLE_SETTINGS in which holds the co= ntent of the variable MTRR - -**/ -MTRR_VARIABLE_SETTINGS* -EFIAPI -MtrrGetVariableMtrr ( - OUT MTRR_VARIABLE_SETTINGS *VariableSettings - ); - - /** This function sets variable MTRRs =20 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, except for MtrrSetAllMtrrs() which is used to sync BSP's MTRR setting = to APs. =20 - Copyright (c) 2008 - 2019, Intel Corporation. All rights reserved.
+ Copyright (c) 2008 - 2020, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent =20 **/ @@ -456,31 +456,6 @@ MtrrGetVariableMtrrWorker ( return VariableSettings; } =20 -/** - This function will get the raw value in variable MTRRs - - @param[out] VariableSettings A buffer to hold variable MTRRs content. - - @return The VariableSettings input pointer - -**/ -MTRR_VARIABLE_SETTINGS* -EFIAPI -MtrrGetVariableMtrr ( - OUT MTRR_VARIABLE_SETTINGS *VariableSettings - ) -{ - if (!IsMtrrSupported ()) { - return VariableSettings; - } - - return MtrrGetVariableMtrrWorker ( - NULL, - GetVariableMtrrCountWorker (), - VariableSettings - ); -} - /** Programs fixed MTRRs registers. =20 --=20 2.27.0.windows.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#62400): https://edk2.groups.io/g/devel/message/62400 Mute This Topic: https://groups.io/mt/75472582/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-