From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from na01-obe.outbound.protection.outlook.com (na01-obe.outbound.protection.outlook.com [52.101.61.18]) by mx.groups.io with SMTP id smtpd.web08.4751.1635983292527371303 for ; Wed, 03 Nov 2021 16:48:12 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@microsoft.com header.s=selector2 header.b=OwsYYQY2; spf=pass (domain: microsoft.com, ip: 52.101.61.18, mailfrom: bret.barkelew@microsoft.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cPvT6OBOd+m1YNlLzCtV0zG4f2chRP9VfanStiYXIBpHm978/6bMvk9ZCtIkw1ic2tR1gU5WgWRt+rOqSOHk3unIVxwUH1VraLXtNbBEOXN6nJkAhQsFJrshOm30ncGR574Q9puzg+Z4V2a7cZzL67YkxUBjaO6UFT939k1fdcASmz+LHESKGLdkn9TYwosrWLTK6EbyMszJ/fjnwr47jRKfyNF2G8GVcwXjwnkO7FdU2imvMnm3qrL/pVpvgY9DPGTw7o6TRGRXwmykeHITiiWMsbQrtN+MhbmHFPHGyL3CvOoqu705OaQ/t9l7L5Trnacx9MFMuTm4+5ouFlWrjA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=PqQWJ53t/S+SQzeqnLxhry63U1navg7OX1MFuBV+aQo=; b=dzcqxQjVlxeeIgcimXsVZfUdvnrXFABgUyGyW0DrA1t5T8y1XgEn++smW6WYZMLhN3pwnYWGwUsJfBT5WdXxVgujqXgyal4eynv2tsrYOMRRLDJZl850Qy/H0RKS1UyO+SWlACRMXq1EwgmezIcwrOAS90P2wmOpmYla1ML/EM/pWqUKUfU13l+EGQVJwPdBiXf79kDk9kBgfVNkGaMM3wzDqPPh2MSn4I7mLkcVlifFjWtHdblH7jEy17tN0rfjI3dXQ1rhpupbMuJ5IR4XtRU3fTA0dNCP75i1jcr/a7k2zPRfN3cBI6e3ECAFe10pL5bCPMPpQGGoprXtfaCB3g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=microsoft.com; dmarc=pass action=none header.from=microsoft.com; dkim=pass header.d=microsoft.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=PqQWJ53t/S+SQzeqnLxhry63U1navg7OX1MFuBV+aQo=; b=OwsYYQY2r64cSViR5JHhNuhn7dDM8RMWO5Mn6UTbqcd2eDXXPWDo3etp+8fdkQpSj5ERM14MCLRdMtfqGZJkADOuiCKdqN9NX6sI8BLrOzM9MQom849pdeeiENta0IsyTRJffL0ZtkXbLMKDNr+I5MPCbK6lbDsC7EQ/zPqe1zE= Received: from MW4PR21MB1907.namprd21.prod.outlook.com (2603:10b6:303:71::8) by MWHPR21MB0832.namprd21.prod.outlook.com (2603:10b6:300:76::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4649.11; Wed, 3 Nov 2021 23:46:01 +0000 Received: from MW4PR21MB1907.namprd21.prod.outlook.com ([fe80::7d8b:5fc0:be80:ab1f]) by MW4PR21MB1907.namprd21.prod.outlook.com ([fe80::7d8b:5fc0:be80:ab1f%6]) with mapi id 15.20.4690.005; Wed, 3 Nov 2021 23:46:01 +0000 From: "Bret Barkelew" To: "Kinney, Michael D" , "devel@edk2.groups.io" CC: Hao A Wu , Liming Gao , Philippe Mathieu-Daude Subject: Re: [EXTERNAL] [Patch V2 6/7] MdeModulePkg/Variable/RuntimeDxeUnitTest: Fix 32-bit GCC builds Thread-Topic: [EXTERNAL] [Patch V2 6/7] MdeModulePkg/Variable/RuntimeDxeUnitTest: Fix 32-bit GCC builds Thread-Index: AQHX0QaRPrXzDwxEUUusdD6ksDeqz6vyd8yA Date: Wed, 3 Nov 2021 23:46:01 +0000 Message-ID: References: <20211103225954.1680-1-michael.d.kinney@intel.com> <20211103225954.1680-7-michael.d.kinney@intel.com> In-Reply-To: <20211103225954.1680-7-michael.d.kinney@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Enabled=True;MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_SiteId=72f988bf-86f1-41af-91ab-2d7cd011db47;MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_SetDate=2021-11-03T23:45:47.5802100Z;MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_ContentBits=0;MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Method=Standard authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=microsoft.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 3bd974fd-71da-4c88-4cd9-08d99f2417c4 x-ms-traffictypediagnostic: MWHPR21MB0832: x-ld-processed: 72f988bf-86f1-41af-91ab-2d7cd011db47,ExtAddr x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:6108; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: MN/G7Ris48QEMYtbe95Kr8Mfn3+//mEZHYkDubmvuqNRZ3eqnqPkhupLvq28+ob9ldoMbBXX38rQJ2GfaGsRHzpbwuYPOy/iEoieVudt3ji45C19Dz/i7obTNLF5lBev1DjqbmhEOL22FIzLUf2IDl/a24WCM6xsZlKsNLbhVXNM5h6xKYelbeVV+tUfCgT0ANshnnWuXzZ1ebHnfgaXr84E+KnYLNV2W5BBbG8QX+nVq+tvNwSErHk8MdsOIuDfJRf+3f11IeKDu+7tcPcG0lLZ3r0C+211iS7UyxvvjmGuoGKLGvhbb7O8A99jgwIrQx4aQsfsEVsa18FRcNSYUt+Kp6X//JzStnKwa2KQyivO+PYncr+Re1W24+26CC3EBelKKGgFFf4FsJThhKzW2pQkeoCY3axLvFmWasEQ0a1cNjFxPb/MyEqRlstclQ85GTwmAbsGWLlMJdsGs8ixIG0nh/TjhEVVSHhZx2CHC/nKG0RdwjS+WEiHGBIf3UBs728fgsGSQk8BRx17FPZoZI4elJJZrbi8SHqey8vAzJkooCNYqTsbIoUIKUMWasBtFY1+aIO5lzp9wk5CIe7W7orwNtz9FfREw2Rt1pteSSzA5CUSyk4fQhmTqb3LKDYAKxzdMksHMHU6p2nZlrVfPf/1eJD2XUXyVWEqvi7rDnJ6UEpWYRxTWEiTqRINr8g8AGw9Mi7MMC59LEKZH20QLA== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MW4PR21MB1907.namprd21.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(366004)(6506007)(53546011)(5660300002)(66476007)(8676002)(26005)(83380400001)(66446008)(86362001)(10290500003)(54906003)(8990500004)(55016002)(52536014)(7696005)(64756008)(38100700002)(66556008)(38070700005)(122000001)(316002)(66946007)(82960400001)(9686003)(71200400001)(82950400001)(508600001)(2906002)(33656002)(76116006)(4326008)(8936002)(110136005)(186003);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?uhiQQ9o0DZrcqNdzwt68tPvOhMCDkISSjeps6vH+O3swm7VOa/TDvxfgMrKs?= =?us-ascii?Q?H9DDUp+PpCsthk6cK+LzEoPAWL33DzxwEQOXsFbl5B2f12+LhqHuRAi/RLre?= =?us-ascii?Q?XV9sO+erLX1EMd40wGkgZCop9P0r76/15QS4/QWenJhVwZWDQezW1FJy9QMu?= =?us-ascii?Q?Vf/gMbhnobKXxLN9af7A7RH4r0drXgKjXSVxJvFsXJxSKkmGp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4h9GVrGvAbKOU7M++OtypBrpwFlMEuSLg/INVD?= =?us-ascii?Q?aO5IC3atazRyzrn7KM9jkB/j7G/Ox+hzj1lZZPW1/etdkdHouQbEoBDoY3Ap?= =?us-ascii?Q?LMmQHVJH76DPaPgA7tqcf8xHSTQZKzN0jgfRK0I9VjkaxC3KzCruqdCvGzdE?= =?us-ascii?Q?zJHM/vV3YAllgYZ0R7PylmISU0S6DkR+adV6s03BcTFzj6bA2NfwwV+m32bY?= =?us-ascii?Q?sRh+7uIANBbMW4ADzlTZQWqeEEKFNb8i+OR0p1wH7//5USOsIF0BxUAaO775?= =?us-ascii?Q?8MiYxrVwOW0fAgQZwofsscQurXA2ZeM4KeeG+ZdeioBkDi169z7LJ8zqkmvA?= =?us-ascii?Q?ciZNKvAGWmv4R5TTY4WPyiOQOyD2qlDZbkC0Z71h7reoTpPEgdfkKqnPJ+ym?= =?us-ascii?Q?javbQYQv8QEVYWYriOWx29wLr8cUfjfItXQnV6GnhEeMejIzx6MP15EkApYM?= =?us-ascii?Q?+EfkQVZUJ1yf/gh2ssu6u66sFDbCp9hmKf9FOxpDlZDUkDf7w34vKu/FanuM?= =?us-ascii?Q?WTo2qkhgUgNHyCyNdRKOLONPAqJlIgdAVIlY1DhA31zZ?= MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: MW4PR21MB1907.namprd21.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3bd974fd-71da-4c88-4cd9-08d99f2417c4 X-MS-Exchange-CrossTenant-originalarrivaltime: 03 Nov 2021 23:46:01.4870 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: QCYZ2pLWDJ6nyPh4DNJE4+YQRjFheuEHnJ/60ChaVv9au0/qCNP4ER8oxgzU+da+E+eYufMHP31eS1YsiVhG1w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR21MB0832 Content-Language: en-US Content-Type: multipart/alternative; boundary="_000_MW4PR21MB1907F875261CF14F891DC4B6EF8C9MW4PR21MB1907namp_" --_000_MW4PR21MB1907F875261CF14F891DC4B6EF8C9MW4PR21MB1907namp_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Bret Barkelew - Bret From: Michael D Kinney Sent: Wednesday, November 3, 2021 4:00 PM To: devel@edk2.groups.io Cc: Hao A Wu; Liming Gao; Bret Barkelew; Philippe Math= ieu-Daude Subject: [EXTERNAL] [Patch V2 6/7] MdeModulePkg/Variable/RuntimeDxeUnitTest= : Fix 32-bit GCC builds When using will_return() on a pointer value, it must be cast to UINTN to be compatible with 32-bit GCC builds. This uses the same approach in samples provided in the UnitTestFramworkPkg when passing pointer values to UT_ASSERT_EQUAL(). Cc: Hao A Wu Cc: Liming Gao Cc: Bret Barkelew Signed-off-by: Michael D Kinney Reviewed-by: Philippe Mathieu-Daude --- .../RuntimeDxeUnitTest/VariableLockRequestToLockUnitTest.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/MdeModulePkg/Universal/Variable/RuntimeDxe/RuntimeDxeUnitTest/= VariableLockRequestToLockUnitTest.c b/MdeModulePkg/Universal/Variable/Runti= meDxe/RuntimeDxeUnitTest/VariableLockRequestToLockUnitTest.c index 44d70e639d77..880994fe71fc 100644 --- a/MdeModulePkg/Universal/Variable/RuntimeDxe/RuntimeDxeUnitTest/Variabl= eLockRequestToLockUnitTest.c +++ b/MdeModulePkg/Universal/Variable/RuntimeDxe/RuntimeDxeUnitTest/Variabl= eLockRequestToLockUnitTest.c @@ -287,7 +287,7 @@ LockingAnUnlockedVariableShouldFail ( // With a policy, make sure that writes still work, since the variable d= oesn't exist. will_return( StubGetVariableNull, TEST_POLICY_ATTRIBUTES_NULL ); // A= ttributes will_return( StubGetVariableNull, 0 ); // S= ize - will_return( StubGetVariableNull, NULL ); // D= ataPtr + will_return( StubGetVariableNull, (UINTN)NULL ); // D= ataPtr will_return( StubGetVariableNull, EFI_NOT_FOUND); // S= tatus Status =3D VariableLockRequestToLock (NULL, TEST_VAR_1_NAME, &mTestGuid1= ); @@ -342,7 +342,7 @@ LockingALockedVariableWithMatchingDataShouldSucceed ( Data =3D 1; will_return( StubGetVariableNull, TEST_POLICY_ATTRIBUTES_NULL ); // A= ttributes will_return( StubGetVariableNull, sizeof (Data) ); // S= ize - will_return( StubGetVariableNull, &Data ); // D= ataPtr + will_return( StubGetVariableNull, (UINTN)&Data ); // D= ataPtr will_return( StubGetVariableNull, EFI_SUCCESS); // S= tatus Status =3D VariableLockRequestToLock (NULL, TEST_VAR_1_NAME, &mTestGuid1= ); @@ -397,7 +397,7 @@ LockingALockedVariableWithNonMatchingDataShouldFail ( Data =3D 2; will_return( StubGetVariableNull, TEST_POLICY_ATTRIBUTES_NULL ); // A= ttributes will_return( StubGetVariableNull, sizeof (Data) ); // S= ize - will_return( StubGetVariableNull, &Data ); // D= ataPtr + will_return( StubGetVariableNull, (UINTN)&Data ); // D= ataPtr will_return( StubGetVariableNull, EFI_SUCCESS); // S= tatus Status =3D VariableLockRequestToLock (NULL, TEST_VAR_1_NAME, &mTestGuid1= ); -- 2.32.0.windows.1 --_000_MW4PR21MB1907F875261CF14F891DC4B6EF8C9MW4PR21MB1907namp_ Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

Reviewed-by: Bret Barkelew <bret.barkelew@microso= ft.com>

 

- Bret

 

From: Michael D Kinney
Sent: Wednesday, November 3, 2021 4:00 PM
To: devel@edk2.groups.io=
Cc: Hao A Wu; Liming Gao; Bret Barkele= w; Philippe Mathieu-Daude
Subject: [EXTERNAL] [Patch V2 6/7] MdeModulePkg/Variable/RuntimeDxeU= nitTest: Fix 32-bit GCC builds

 

When using will_retur= n() on a pointer value, it must be
cast to UINTN to be compatible with 32-bit GCC builds.
This uses the same approach in samples provided in the
UnitTestFramworkPkg when passing pointer values to
UT_ASSERT_EQUAL().

Cc: Hao A Wu <hao.a.wu@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Bret Barkelew <Bret.Barkelew@microsoft.com>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Philippe Mathieu-Daude <philmd@redhat.com>
---
 .../RuntimeDxeUnitTest/VariableLockRequestToLockUnitTest.c  | 6 = +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/MdeModulePkg/Universal/Variable/RuntimeDxe/RuntimeDxeUnitTest/= VariableLockRequestToLockUnitTest.c b/MdeModulePkg/Universal/Variable/Runti= meDxe/RuntimeDxeUnitTest/VariableLockRequestToLockUnitTest.c
index 44d70e639d77..880994fe71fc 100644
--- a/MdeModulePkg/Universal/Variable/RuntimeDxe/RuntimeDxeUnitTest/Variabl= eLockRequestToLockUnitTest.c
+++ b/MdeModulePkg/Universal/Variable/RuntimeDxe/RuntimeDxeUnitTest/Variabl= eLockRequestToLockUnitTest.c
@@ -287,7 +287,7 @@ LockingAnUnlockedVariableShouldFail (
   // With a policy, make sure that writes still work, since the = variable doesn't exist.
   will_return( StubGetVariableNull, TEST_POLICY_ATTRIBUTES_NULL = );    // Attributes
   will_return( StubGetVariableNull, 0 );    =             &nb= sp;            = // Size
-  will_return( StubGetVariableNull, NULL );    &n= bsp;            = ;          // DataPtr
+  will_return( StubGetVariableNull, (UINTN)NULL );   &= nbsp;           &nbs= p;    // DataPtr
   will_return( StubGetVariableNull, EFI_NOT_FOUND);  &= nbsp;           &nbs= p;    // Status
 
   Status =3D VariableLockRequestToLock (NULL, TEST_VAR_1_NAME, &= amp;mTestGuid1);
@@ -342,7 +342,7 @@ LockingALockedVariableWithMatchingDataShouldSucceed (    Data =3D 1;
   will_return( StubGetVariableNull, TEST_POLICY_ATTRIBUTES_NULL = );    // Attributes
   will_return( StubGetVariableNull, sizeof (Data) );  =             &nb= sp;   // Size
-  will_return( StubGetVariableNull, &Data );   &nb= sp;            =           // DataPtr
+  will_return( StubGetVariableNull, (UINTN)&Data );  &n= bsp;            = ;    // DataPtr
   will_return( StubGetVariableNull, EFI_SUCCESS);  &nb= sp;            =       // Status
 
   Status =3D VariableLockRequestToLock (NULL, TEST_VAR_1_NAME, &= amp;mTestGuid1);
@@ -397,7 +397,7 @@ LockingALockedVariableWithNonMatchingDataShouldFail (    Data =3D 2;
   will_return( StubGetVariableNull, TEST_POLICY_ATTRIBUTES_NULL = );    // Attributes
   will_return( StubGetVariableNull, sizeof (Data) );  =             &nb= sp;   // Size
-  will_return( StubGetVariableNull, &Data );   &nb= sp;            =           // DataPtr
+  will_return( StubGetVariableNull, (UINTN)&Data );  &n= bsp;            = ;    // DataPtr
   will_return( StubGetVariableNull, EFI_SUCCESS);  &nb= sp;            =       // Status
 
   Status =3D VariableLockRequestToLock (NULL, TEST_VAR_1_NAME, &= amp;mTestGuid1);
--
2.32.0.windows.1

 

--_000_MW4PR21MB1907F875261CF14F891DC4B6EF8C9MW4PR21MB1907namp_--