]> git.proxmox.com Git - mirror_edk2.git/commitdiff
UefiCpuPkg/MtrrLib: Remove unnecessary API MtrrGetVariableMtrr()
authorRay Ni <ray.ni@intel.com>
Mon, 13 Jul 2020 07:43:44 +0000 (15:43 +0800)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Tue, 14 Jul 2020 03:24:24 +0000 (03:24 +0000)
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2849

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 unnecessary 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 <ray.ni@intel.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Cc: Rahul Kumar <rahul1.kumar@intel.com>
UefiCpuPkg/Include/Library/MtrrLib.h
UefiCpuPkg/Library/MtrrLib/MtrrLib.c

index 95ffbc8bf172a589a95d75e82dc679c9e568452d..cfe3c0ab5998062b7696980390d5a86a994b3031 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   MTRR setting library\r
 \r
-  Copyright (c) 2008 - 2018, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2008 - 2020, Intel Corporation. All rights reserved.<BR>\r
   SPDX-License-Identifier: BSD-2-Clause-Patent\r
 \r
 **/\r
@@ -185,21 +185,6 @@ MtrrGetMemoryAttribute (
   );\r
 \r
 \r
-/**\r
-  This function will get the raw value in variable MTRRs\r
-\r
-  @param[out]  VariableSettings   A buffer to hold variable MTRRs content.\r
-\r
-  @return The buffer point to MTRR_VARIABLE_SETTINGS in which holds the content of the variable MTRR\r
-\r
-**/\r
-MTRR_VARIABLE_SETTINGS*\r
-EFIAPI\r
-MtrrGetVariableMtrr (\r
-  OUT MTRR_VARIABLE_SETTINGS         *VariableSettings\r
-  );\r
-\r
-\r
 /**\r
   This function sets variable MTRRs\r
 \r
index dfa848022b30a1fcd4b63a371168939f7aa525be..f4a10edc87054b3e5fc0748048f7dce0001de6f9 100644 (file)
@@ -5,7 +5,7 @@
     Most of services in this library instance are suggested to be invoked by BSP only,\r
     except for MtrrSetAllMtrrs() which is used to sync BSP's MTRR setting to APs.\r
 \r
-  Copyright (c) 2008 - 2019, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2008 - 2020, Intel Corporation. All rights reserved.<BR>\r
   SPDX-License-Identifier: BSD-2-Clause-Patent\r
 \r
 **/\r
@@ -456,31 +456,6 @@ MtrrGetVariableMtrrWorker (
   return  VariableSettings;\r
 }\r
 \r
-/**\r
-  This function will get the raw value in variable MTRRs\r
-\r
-  @param[out]  VariableSettings   A buffer to hold variable MTRRs content.\r
-\r
-  @return The VariableSettings input pointer\r
-\r
-**/\r
-MTRR_VARIABLE_SETTINGS*\r
-EFIAPI\r
-MtrrGetVariableMtrr (\r
-  OUT MTRR_VARIABLE_SETTINGS         *VariableSettings\r
-  )\r
-{\r
-  if (!IsMtrrSupported ()) {\r
-    return VariableSettings;\r
-  }\r
-\r
-  return MtrrGetVariableMtrrWorker (\r
-           NULL,\r
-           GetVariableMtrrCountWorker (),\r
-           VariableSettings\r
-           );\r
-}\r
-\r
 /**\r
   Programs fixed MTRRs registers.\r
 \r