From nobody Mon Feb 9 21:37:42 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+83211+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+83211+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1635908762; cv=none; d=zohomail.com; s=zohoarc; b=MUtiXl1dL5x//wkLFn7D6iLHn+aONQw6fUwXYx6jZHlzANA1JQANV/4flzOiVckznKgmvzCK2FOpc16rzDktRyqUz115mIr95VhXPqXHPto0gYE/MKfQfXMZ6gXG0gFusxH40ykeYTULscWJWKYeYr7hzq1piOQ6RMp6ELDKQk8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1635908762; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=z0ofdQawIL0DyjkLNLNuSRWhk8GWcnf+cLbPGeTkTDE=; b=E4vBIHc9hfWQcLggpnGzZlkSnrfDDtOiIUXoVgW2djZ++v9fYY3FTZO+aRmG649vOhBZg+ZJvqw9xiXc1DBTaxjY/wHbNxKUYxFHpDHbh7W7sC6rPVru0HnKpTfE9zTfarPkLEbZ7OUtpO7X+S0VoHwPdnHwsAl61nQ1DDB0ftg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+83211+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1635908762859775.6373860588312; Tue, 2 Nov 2021 20:06:02 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id igxyYY1788612x9fDwN3Kvkq; Tue, 02 Nov 2021 20:06:02 -0700 X-Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by mx.groups.io with SMTP id smtpd.web11.2610.1635908759020758070 for ; Tue, 02 Nov 2021 20:06:00 -0700 X-IronPort-AV: E=McAfee;i="6200,9189,10156"; a="211474871" X-IronPort-AV: E=Sophos;i="5.87,204,1631602800"; d="scan'208";a="211474871" X-Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Nov 2021 20:05:54 -0700 X-IronPort-AV: E=Sophos;i="5.87,204,1631602800"; d="scan'208";a="449635067" X-Received: from mdkinney-mobl2.amr.corp.intel.com ([10.212.152.41]) by orsmga006-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Nov 2021 20:05:54 -0700 From: "Michael D Kinney" To: devel@edk2.groups.io Cc: Eric Dong , Ray Ni , Rahul Kumar Subject: [edk2-devel] [Patch 5/6] UefiCpuPkg/MtrrLib/UnitTest: Fix 32-bit GCC build issues Date: Tue, 2 Nov 2021 20:05:41 -0700 Message-Id: <20211103030542.1529-6-michael.d.kinney@intel.com> In-Reply-To: <20211103030542.1529-1-michael.d.kinney@intel.com> References: <20211103030542.1529-1-michael.d.kinney@intel.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,michael.d.kinney@intel.com X-Gm-Message-State: FmqrP4aJPftf74V4AQQ8jzIPx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1635908762; bh=HX7n/CUl8WA0jlD3Hb8lciZPJhP4CioqV4nsDdqBkf8=; h=Cc:Date:From:Reply-To:Subject:To; b=qF6NDUi/OstCNGthFXJ8QXEmuIYW3YdAQKKIApF7oOtpRo0v6x6mBx8kmmxeXNQlEpl Q1ZT4L7DlQ+N5B8v2as20blOB24ErtJuCUYv72q/9hB5+cHf68PPPv8gKU3vfc9eeeepI YSZ9be1kjgapVWsLHtZKn7gs72bm4cB3+XI= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1635909664083100001 Content-Type: text/plain; charset="utf-8" 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/UefiCp= uPkg/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 ( } =20 Result =3D MtrrGetFixedMtrr (&FixedSettings); - UT_ASSERT_EQUAL (Result, &FixedSettings); + UT_ASSERT_EQUAL ((UINTN)Result, (UINTN)&FixedSettings); UT_ASSERT_MEM_EQUAL (&FixedSettings, &ExpectedFixedSettings, sizeof (F= ixedSettings)); } =20 @@ -612,7 +612,7 @@ UnitTestMtrrGetFixedMtrr ( ZeroMem (&FixedSettings, sizeof (FixedSettings)); ZeroMem (&ExpectedFixedSettings, sizeof (ExpectedFixedSettings)); Result =3D MtrrGetFixedMtrr (&FixedSettings); - UT_ASSERT_EQUAL (Result, &FixedSettings); + UT_ASSERT_EQUAL ((UINTN)Result, (UINTN)&FixedSettings); UT_ASSERT_MEM_EQUAL (&ExpectedFixedSettings, &FixedSettings, sizeof (Exp= ectedFixedSettings)); =20 return UNIT_TEST_PASSED; @@ -653,7 +653,7 @@ UnitTestMtrrGetAllMtrrs ( AsmWriteMsr64 (MSR_IA32_MTRR_PHYSMASK0 + (Index << 1), VariableMtrr[In= dex].Mask); } Result =3D MtrrGetAllMtrrs (&Mtrrs); - UT_ASSERT_EQUAL (Result, &Mtrrs); + UT_ASSERT_EQUAL ((UINTN)Result, (UINTN)&Mtrrs); UT_ASSERT_MEM_EQUAL (Mtrrs.Variables.Mtrr, VariableMtrr, sizeof (MTRR_VA= RIABLE_SETTING) * SystemParameter.VariableMtrrCount); =20 // @@ -665,7 +665,7 @@ UnitTestMtrrGetAllMtrrs ( SystemParameter.MtrrSupported =3D FALSE; InitializeMtrrRegs (&SystemParameter); Result =3D MtrrGetAllMtrrs (&Mtrrs); - UT_ASSERT_EQUAL (Result, &Mtrrs); + UT_ASSERT_EQUAL ((UINTN)Result, (UINTN)&Mtrrs); UT_ASSERT_MEM_EQUAL (&ExpectedMtrrs, &Mtrrs, sizeof (ExpectedMtrrs)); =20 // @@ -718,7 +718,7 @@ UnitTestMtrrSetAllMtrrs ( GenerateRandomMtrrPair (SystemParameter.PhysicalAddressBits, GenerateR= andomCacheType (), &Mtrrs.Variables.Mtrr[Index], NULL); } Result =3D MtrrSetAllMtrrs (&Mtrrs); - UT_ASSERT_EQUAL (Result, &Mtrrs); + UT_ASSERT_EQUAL ((UINTN)Result, (UINTN)&Mtrrs); =20 UT_ASSERT_EQUAL (AsmReadMsr64 (MSR_IA32_MTRR_DEF_TYPE), Mtrrs.MtrrDefTyp= e); for (Index =3D 0; Index < SystemParameter.VariableMtrrCount; Index++) { --=20 2.32.0.windows.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#83211): https://edk2.groups.io/g/devel/message/83211 Mute This Topic: https://groups.io/mt/86783677/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-