[edk2-devel] [PATCH 08/16] UefiCpuPkg/MtrrLib: Update MtrrGetFixedMtrr().

Yuanhao Xie posted 16 patches 1 year, 1 month ago
Only 11 patches received!
[edk2-devel] [PATCH 08/16] UefiCpuPkg/MtrrLib: Update MtrrGetFixedMtrr().
Posted by Yuanhao Xie 1 year, 1 month ago
IsMtrrSupported() return true when either fixed mtrr supported or
variable mtrr suppored. In this case, rather than checking whether
MTRR is supported or not, we should specifically check for fixed MTRR
support.

Signed-off-by: Yuanhao Xie <yuanhao.xie@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Cc: Rahul Kumar <rahul1.kumar@intel.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Ray Ni <ray.ni@intel.com>
---
 UefiCpuPkg/Library/MtrrLib/MtrrLib.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/UefiCpuPkg/Library/MtrrLib/MtrrLib.c b/UefiCpuPkg/Library/MtrrLib/MtrrLib.c
index c9440f01ef..b63c4b1c26 100644
--- a/UefiCpuPkg/Library/MtrrLib/MtrrLib.c
+++ b/UefiCpuPkg/Library/MtrrLib/MtrrLib.c
@@ -468,7 +468,10 @@ MtrrGetFixedMtrr (
   OUT MTRR_FIXED_SETTINGS  *FixedSettings
   )
 {
-  if (!IsMtrrSupported ()) {
+  BOOLEAN  FixedMtrrSupported;
+
+  MtrrLibIsMtrrSupported (&FixedMtrrSupported, NULL);
+  if (!FixedMtrrSupported) {
     return FixedSettings;
   }
 
-- 
2.36.1.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#108564): https://edk2.groups.io/g/devel/message/108564
Mute This Topic: https://groups.io/mt/101331026/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-