From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id D78972095DE5A for ; Thu, 10 Aug 2017 15:56:55 -0700 (PDT) Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 10 Aug 2017 15:59:15 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.41,355,1498546800"; d="scan'208";a="117787195" Received: from fmsmsx106.amr.corp.intel.com ([10.18.124.204]) by orsmga004.jf.intel.com with ESMTP; 10 Aug 2017 15:59:15 -0700 Received: from fmsmsx103.amr.corp.intel.com ([169.254.2.159]) by FMSMSX106.amr.corp.intel.com ([169.254.5.182]) with mapi id 14.03.0319.002; Thu, 10 Aug 2017 15:59:14 -0700 From: "Carsey, Jaben" To: Thomas Palmer , "edk2-devel@lists.01.org" CC: "edk2-lists@mc2research.org" , "joseph.shifflett@hpe.com" Thread-Topic: [PATCH 1/1] StdLib/EfiSocketLib: Fix ABI mismatch for 2 event functions Thread-Index: AQHTEijqTwY2CPOCBkCu9I2B5T228qJ+NCHQ Date: Thu, 10 Aug 2017 22:59:13 +0000 Message-ID: References: <1502404487-12865-1-git-send-email-thomas.palmer@hpe.com> In-Reply-To: <1502404487-12865-1-git-send-email-thomas.palmer@hpe.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.1.200.108] MIME-Version: 1.0 Subject: Re: [PATCH 1/1] StdLib/EfiSocketLib: Fix ABI mismatch for 2 event functions X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Aug 2017 22:56:56 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Looks good to me. Daryl? > -----Original Message----- > From: Thomas Palmer [mailto:thomas.palmer@hpe.com] > Sent: Thursday, August 10, 2017 3:35 PM > To: edk2-devel@lists.01.org > Cc: edk2-lists@mc2research.org; Carsey, Jaben ; > joseph.shifflett@hpe.com; Thomas Palmer > Subject: [PATCH 1/1] StdLib/EfiSocketLib: Fix ABI mismatch for 2 event > functions > Importance: High >=20 > The gBS->CreateEvent expects a EFI_EVENT_NOTIFY function as the third > argument. The EFIAPI token is an important component of that prototype. I= ts > absence can cause unexpected issues on DEBUG systems built with GCC due > to > ABI mismatches. >=20 > Both EslTcp4ConnectComplete and EslTcp6ConnectComplete did not have > the > EFIAPI token required of a EFI_EVENT_NOTIFY function. GCC did not catch > this because of the explicit EFI_EVENT_NOTIFY cast. By removing the cast= , > a build error ensues. >=20 > This patch removes the cast and updates both functions to comply with > EFI_EVENT_NOTIFY. >=20 > Contributed-under: TianoCore Contribution Agreement 1.1 > Signed-off-by: Thomas Palmer > --- > StdLib/EfiSocketLib/Tcp4.c | 8 ++++++-- > StdLib/EfiSocketLib/Tcp6.c | 8 ++++++-- > 2 files changed, 12 insertions(+), 4 deletions(-) >=20 > diff --git a/StdLib/EfiSocketLib/Tcp4.c b/StdLib/EfiSocketLib/Tcp4.c > index 68477fba6e70..8125a8d4f5ad 100644 > --- a/StdLib/EfiSocketLib/Tcp4.c > +++ b/StdLib/EfiSocketLib/Tcp4.c > @@ -2,6 +2,7 @@ > Implement the TCP4 driver support for the socket layer. >=20 > Copyright (c) 2011 - 2015, Intel Corporation. All rights reserved.
> + (C) Copyright 2017 Hewlett Packard Enterprise Development LP
> This program and the accompanying materials are licensed and made > available > under the terms and conditions of the BSD License which accompanies th= is > distribution. The full text of the license may be found at > @@ -192,9 +193,10 @@ EslTcp4Accept ( >=20 > **/ > VOID > +EFIAPI > EslTcp4ConnectComplete ( > IN EFI_EVENT Event, > - IN ESL_PORT * pPort > + IN VOID *Context > ) > { > BOOLEAN bRemoveFirstPort; > @@ -203,12 +205,14 @@ EslTcp4ConnectComplete ( > ESL_SOCKET * pSocket; > ESL_TCP4_CONTEXT * pTcp4; > EFI_STATUS Status; > + ESL_PORT * pPort; >=20 > DBG_ENTER ( ); >=20 > // > // Locate the TCP context > // > + pPort =3D Context; > pSocket =3D pPort->pSocket; > pTcp4 =3D &pPort->Context.Tcp4; >=20 > @@ -1288,7 +1292,7 @@ EslTcp4PortAllocate ( > // > Status =3D gBS->CreateEvent ( EVT_NOTIFY_SIGNAL, > TPL_SOCKETS, > - (EFI_EVENT_NOTIFY)EslTcp4ConnectComplet= e, > + EslTcp4ConnectComplete, > pPort, > &pTcp4->ConnectToken.CompletionToken.Ev= ent); > if ( EFI_ERROR ( Status )) { > diff --git a/StdLib/EfiSocketLib/Tcp6.c b/StdLib/EfiSocketLib/Tcp6.c > index 0f6d2d6ac93c..9f9c00f6dc57 100644 > --- a/StdLib/EfiSocketLib/Tcp6.c > +++ b/StdLib/EfiSocketLib/Tcp6.c > @@ -2,6 +2,7 @@ > Implement the TCP6 driver support for the socket layer. >=20 > Copyright (c) 2011 - 2014, Intel Corporation. All rights reserved.
> + (C) Copyright 2017 Hewlett Packard Enterprise Development LP
> This program and the accompanying materials are licensed and made > available > under the terms and conditions of the BSD License which accompanies th= is > distribution. The full text of the license may be found at > @@ -186,9 +187,10 @@ EslTcp6Accept ( >=20 > **/ > VOID > +EFIAPI > EslTcp6ConnectComplete ( > IN EFI_EVENT Event, > - IN ESL_PORT * pPort > + IN VOID *Context > ) > { > BOOLEAN bRemoveFirstPort; > @@ -197,12 +199,14 @@ EslTcp6ConnectComplete ( > ESL_SOCKET * pSocket; > ESL_TCP6_CONTEXT * pTcp6; > EFI_STATUS Status; > + ESL_PORT * pPort; >=20 > DBG_ENTER ( ); >=20 > // > // Locate the TCP context > // > + pPort =3D Context; > pSocket =3D pPort->pSocket; > pTcp6 =3D &pPort->Context.Tcp6; >=20 > @@ -1339,7 +1343,7 @@ EslTcp6PortAllocate ( > // > Status =3D gBS->CreateEvent ( EVT_NOTIFY_SIGNAL, > TPL_SOCKETS, > - (EFI_EVENT_NOTIFY)EslTcp6ConnectComplet= e, > + EslTcp6ConnectComplete, > pPort, > &pTcp6->ConnectToken.CompletionToken.Ev= ent); > if ( EFI_ERROR ( Status )) { > -- > 2.7.4