]> git.proxmox.com Git - mirror_edk2.git/commitdiff
UefiCpuPkg/MtrrLib: Remove unnecessary API MtrrSetVariableMtrr()
authorRay Ni <ray.ni@intel.com>
Mon, 13 Jul 2020 07:47:41 +0000 (15:47 +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

MtrrSetVariableMtrr() sets all the variable MTRR settings.
But in fact MtrrSetAllMtrrs() is always used by callers to set all
MTRR settings including the fixed and variable ones.

The patch removes the unnecessary API MtrrSetVariableMtrr() to
simplify the MtrrLib API.

There is no code in edk2 and edk2-platforms repo that calls
MtrrSetVariableMtrr().

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 cfe3c0ab5998062b7696980390d5a86a994b3031..0bc69e235cd3dc2343c29c499f59bb5e6af01e72 100644 (file)
@@ -185,21 +185,6 @@ MtrrGetMemoryAttribute (
   );\r
 \r
 \r
-/**\r
-  This function sets variable MTRRs\r
-\r
-  @param[in]  VariableSettings   A buffer to hold variable MTRRs content.\r
-\r
-  @return The pointer of VariableSettings\r
-\r
-**/\r
-MTRR_VARIABLE_SETTINGS*\r
-EFIAPI\r
-MtrrSetVariableMtrr (\r
-  IN MTRR_VARIABLE_SETTINGS         *VariableSettings\r
-  );\r
-\r
-\r
 /**\r
   This function gets the content in fixed MTRRs\r
 \r
index f4a10edc87054b3e5fc0748048f7dce0001de6f9..8b54f2c03bc6c22ac66b62032c7672af774460a9 100644 (file)
@@ -2558,35 +2558,6 @@ MtrrSetVariableMtrrWorker (
   }\r
 }\r
 \r
-\r
-/**\r
-  This function sets variable MTRRs\r
-\r
-  @param[in]  VariableSettings   A buffer to hold variable MTRRs content.\r
-\r
-  @return The pointer of VariableSettings\r
-\r
-**/\r
-MTRR_VARIABLE_SETTINGS*\r
-EFIAPI\r
-MtrrSetVariableMtrr (\r
-  IN MTRR_VARIABLE_SETTINGS         *VariableSettings\r
-  )\r
-{\r
-  MTRR_CONTEXT  MtrrContext;\r
-\r
-  if (!IsMtrrSupported ()) {\r
-    return VariableSettings;\r
-  }\r
-\r
-  MtrrLibPreMtrrChange (&MtrrContext);\r
-  MtrrSetVariableMtrrWorker (VariableSettings);\r
-  MtrrLibPostMtrrChange (&MtrrContext);\r
-  MtrrDebugPrintAllMtrrs ();\r
-\r
-  return  VariableSettings;\r
-}\r
-\r
 /**\r
   Worker function setting fixed MTRRs\r
 \r