From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by mx.groups.io with SMTP id smtpd.web09.4277.1635980411005838808 for ; Wed, 03 Nov 2021 16:00:11 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 192.55.52.93, mailfrom: michael.d.kinney@intel.com) X-IronPort-AV: E=McAfee;i="6200,9189,10157"; a="229070027" X-IronPort-AV: E=Sophos;i="5.87,207,1631602800"; d="scan'208";a="229070027" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Nov 2021 16:00:10 -0700 X-IronPort-AV: E=Sophos;i="5.87,207,1631602800"; d="scan'208";a="729813078" Received: from mdkinney-mobl2.amr.corp.intel.com ([10.209.88.80]) by fmsmga005-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Nov 2021 16:00:09 -0700 From: "Michael D Kinney" To: devel@edk2.groups.io Cc: Eric Dong , Ray Ni , Rahul Kumar , Philippe Mathieu-Daude Subject: [Patch V2 5/7] UefiCpuPkg/MtrrLib/UnitTest: Fix 32-bit GCC build issues Date: Wed, 3 Nov 2021 15:59:52 -0700 Message-Id: <20211103225954.1680-6-michael.d.kinney@intel.com> X-Mailer: git-send-email 2.32.0.windows.1 In-Reply-To: <20211103225954.1680-1-michael.d.kinney@intel.com> References: <20211103225954.1680-1-michael.d.kinney@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit When using UT_ASSERT_EQUAL() on a pointer value, it must be cast to UINTN. This follows the samples provided with the UnitTestFrameworkPkg. Cc: Eric Dong Cc: Ray Ni Cc: Rahul Kumar Signed-off-by: Michael D Kinney Reviewed-by: Philippe Mathieu-Daude --- UefiCpuPkg/Library/MtrrLib/UnitTest/MtrrLibUnitTest.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/UefiCpuPkg/Library/MtrrLib/UnitTest/MtrrLibUnitTest.c b/UefiCpuPkg/Library/MtrrLib/UnitTest/MtrrLibUnitTest.c index 30ee1dc32522..e84b9390601d 100644 --- a/UefiCpuPkg/Library/MtrrLib/UnitTest/MtrrLibUnitTest.c +++ b/UefiCpuPkg/Library/MtrrLib/UnitTest/MtrrLibUnitTest.c @@ -599,7 +599,7 @@ UnitTestMtrrGetFixedMtrr ( } Result = MtrrGetFixedMtrr (&FixedSettings); - UT_ASSERT_EQUAL (Result, &FixedSettings); + UT_ASSERT_EQUAL ((UINTN)Result, (UINTN)&FixedSettings); UT_ASSERT_MEM_EQUAL (&FixedSettings, &ExpectedFixedSettings, sizeof (FixedSettings)); } @@ -612,7 +612,7 @@ UnitTestMtrrGetFixedMtrr ( ZeroMem (&FixedSettings, sizeof (FixedSettings)); ZeroMem (&ExpectedFixedSettings, sizeof (ExpectedFixedSettings)); Result = MtrrGetFixedMtrr (&FixedSettings); - UT_ASSERT_EQUAL (Result, &FixedSettings); + UT_ASSERT_EQUAL ((UINTN)Result, (UINTN)&FixedSettings); UT_ASSERT_MEM_EQUAL (&ExpectedFixedSettings, &FixedSettings, sizeof (ExpectedFixedSettings)); return UNIT_TEST_PASSED; @@ -653,7 +653,7 @@ UnitTestMtrrGetAllMtrrs ( AsmWriteMsr64 (MSR_IA32_MTRR_PHYSMASK0 + (Index << 1), VariableMtrr[Index].Mask); } Result = MtrrGetAllMtrrs (&Mtrrs); - UT_ASSERT_EQUAL (Result, &Mtrrs); + UT_ASSERT_EQUAL ((UINTN)Result, (UINTN)&Mtrrs); UT_ASSERT_MEM_EQUAL (Mtrrs.Variables.Mtrr, VariableMtrr, sizeof (MTRR_VARIABLE_SETTING) * SystemParameter.VariableMtrrCount); // @@ -665,7 +665,7 @@ UnitTestMtrrGetAllMtrrs ( SystemParameter.MtrrSupported = FALSE; InitializeMtrrRegs (&SystemParameter); Result = MtrrGetAllMtrrs (&Mtrrs); - UT_ASSERT_EQUAL (Result, &Mtrrs); + UT_ASSERT_EQUAL ((UINTN)Result, (UINTN)&Mtrrs); UT_ASSERT_MEM_EQUAL (&ExpectedMtrrs, &Mtrrs, sizeof (ExpectedMtrrs)); // @@ -718,7 +718,7 @@ UnitTestMtrrSetAllMtrrs ( GenerateRandomMtrrPair (SystemParameter.PhysicalAddressBits, GenerateRandomCacheType (), &Mtrrs.Variables.Mtrr[Index], NULL); } Result = MtrrSetAllMtrrs (&Mtrrs); - UT_ASSERT_EQUAL (Result, &Mtrrs); + UT_ASSERT_EQUAL ((UINTN)Result, (UINTN)&Mtrrs); UT_ASSERT_EQUAL (AsmReadMsr64 (MSR_IA32_MTRR_DEF_TYPE), Mtrrs.MtrrDefType); for (Index = 0; Index < SystemParameter.VariableMtrrCount; Index++) { -- 2.32.0.windows.1