summaryrefslogtreecommitdiff
path: root/UefiCpuPkg
diff options
context:
space:
mode:
authorYuanhaoXie <yuanhao.xie@intel.com>2023-09-11 18:57:48 +0800
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2023-10-09 08:22:02 +0000
commitf784fc0e39f9837dc409aa4f776bcd80e88e925f (patch)
tree0ee64c185af3c1a353b936da574acc18180dd55d /UefiCpuPkg
parentca3f8638fa4f5dd2ab52b5f29b3c5c3a2ddf536e (diff)
downloadedk2-f784fc0e39f9837dc409aa4f776bcd80e88e925f.zip
edk2-f784fc0e39f9837dc409aa4f776bcd80e88e925f.tar.gz
edk2-f784fc0e39f9837dc409aa4f776bcd80e88e925f.tar.bz2
UefiCpuPkg/MtrrUnitTest: Update UnitTestGetFirmwareVariableMtrrCount.
Update UnitTestGetFirmwareVariableMtrrCount for the case the when Fixed MTRRs are not supported. The original implementation returns FALSE when either fixed MTRR isn't supported or the number of variable MTRRs is 0. The correct behavior should return FALSE only when both fixed MTRR isn't supported and the number of variable MTRRs is 0. Signed-off-by: Ray Ni <ray.ni@intel.com> Cc: Eric Dong <eric.dong@intel.com> Cc: Rahul Kumar <rahul1.kumar@intel.com> Cc: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Eric Dong <eric.dong@intel.com> Reviewed-by: Ray Ni <ray.ni@intel.com>
Diffstat (limited to 'UefiCpuPkg')
-rw-r--r--UefiCpuPkg/Library/MtrrLib/UnitTest/MtrrLibUnitTest.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/UefiCpuPkg/Library/MtrrLib/UnitTest/MtrrLibUnitTest.c b/UefiCpuPkg/Library/MtrrLib/UnitTest/MtrrLibUnitTest.c
index ac18d9d..75ae4d6 100644
--- a/UefiCpuPkg/Library/MtrrLib/UnitTest/MtrrLibUnitTest.c
+++ b/UefiCpuPkg/Library/MtrrLib/UnitTest/MtrrLibUnitTest.c
@@ -550,7 +550,7 @@ UnitTestGetFirmwareVariableMtrrCount (
InitializeMtrrRegs (&SystemParameter);
PatchPcdSet32 (PcdCpuNumberOfReservedVariableMtrrs, 2);
Result = GetFirmwareVariableMtrrCount ();
- UT_ASSERT_EQUAL (Result, 0);
+ UT_ASSERT_EQUAL (Result, SystemParameter.VariableMtrrCount - 2);
//
// Expect ASSERT() if variable MTRR count is > MTRR_NUMBER_OF_VARIABLE_MTRR