From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by spool.mail.gandi.net (Postfix) with ESMTPS id ADADDD8018D for ; Wed, 30 Aug 2023 03:20:51 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=c17d3+yp1kW6l2RUnwBOAtF2eteIoeElpfi5gBeUyi4=; c=relaxed/simple; d=groups.io; h=ARC-Seal:ARC-Message-Signature:ARC-Authentication-Results:From:To:CC:Subject:Thread-Topic:Thread-Index:Date:Message-ID:References:In-Reply-To:Accept-Language:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Language:Content-Type:Content-Transfer-Encoding; s=20140610; t=1693365650; v=1; b=XUVfuCjBICyn84c+9tum365Ls4jdTF3tbybOCmlTna+1hS96F9EkjoIiwFZS4zBADmdWK4sA yGfwoWsapNORU0WmlKl86UVnN1xK1pnMWpjvok/neDCv5r00duWS0wOl2bnto0Om8zKq4CaFjoz 1dSW6N1fcta/llfWwefycC7w= X-Received: by 127.0.0.2 with SMTP id IsZiYY7687511xybyz5rR6L2; Tue, 29 Aug 2023 20:20:50 -0700 X-Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.88]) by mx.groups.io with SMTP id smtpd.web10.6206.1693365648937704328 for ; Tue, 29 Aug 2023 20:20:49 -0700 X-IronPort-AV: E=McAfee;i="6600,9927,10817"; a="406532404" X-IronPort-AV: E=Sophos;i="6.02,212,1688454000"; d="scan'208";a="406532404" X-Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Aug 2023 20:20:48 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10817"; a="804357894" X-IronPort-AV: E=Sophos;i="6.02,212,1688454000"; d="scan'208";a="804357894" X-Received: from fmsmsx601.amr.corp.intel.com ([10.18.126.81]) by fmsmga008.fm.intel.com with ESMTP; 29 Aug 2023 20:20:48 -0700 X-Received: from fmsmsx612.amr.corp.intel.com (10.18.126.92) by fmsmsx601.amr.corp.intel.com (10.18.126.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Tue, 29 Aug 2023 20:20:47 -0700 X-Received: from fmsmsx610.amr.corp.intel.com (10.18.126.90) by fmsmsx612.amr.corp.intel.com (10.18.126.92) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Tue, 29 Aug 2023 20:20:47 -0700 X-Received: from FMSEDG603.ED.cps.intel.com (10.1.192.133) by fmsmsx610.amr.corp.intel.com (10.18.126.90) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27 via Frontend Transport; Tue, 29 Aug 2023 20:20:47 -0700 X-Received: from NAM12-DM6-obe.outbound.protection.outlook.com (104.47.59.173) by edgegateway.intel.com (192.55.55.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.27; Tue, 29 Aug 2023 20:20:47 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Oz4yvmneOVZ1mBgQGO5YnWfJfcNpnHzf1nptu+4wPlK+g9dzKE0wGC82g67RKL4nhdWdEHh84p/XD1TvfH7si7QeWD+6U43/k95wLVK9w7VUiqWzp1s0j4o+A8loguqROWiqHAi904bRE+jiBTK9Y07GG/FKvwa7s3h4Joh2zhLLUZnndiwCqq2shgz1x4/U7CDjkkuGbNt8ynwo7D3HHZF5TdJlSOupT+zxi+LRngcqK0/dWzo8Lt6HLn1+a8x2vMVou4vji0jPOB1qNAPthgIQqSWMN8JBdxwBVGkdmKtIKYmspb+yNHVSW9Flqxmj3BLMLrfXp1ObtXBjLmS3jg== 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=C5V54ZJ7W3QqxV4JjQKWKiZzbrK8H7ZHbSzCCaYzISU=; b=S+8XhvR1XXYv1uYsq/UqbtBqT2guERcqJGNbW8lzZZEE5sSMOEwFCi1DYUdVUUODnnldWGrs5a+DqMqXVOnXH+xFu4BWVGbvw+Lo0b61fgvXlppkkTnsuARHP0RkupwyIsXf8WlcFliDA2L3aZTK8oZKfX0ormfCrBa3wtT0xEuUuU8XPhdqlJSMi6O1fTs3tHz/ycKV6LO54K4u1fve7uJS9EgY6n4SN3kvBVrGDAArNZa1BQn/ZrwWOtBoLEtMGB+JK+ATUJ56m/kT1PcyYxacV6wXTJEWl+BRcfh9hzj1nOLPHGrsZi4g2AVn+7B9sAn//nPagRj9VFu0enLOTw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none X-Received: from PH7PR11MB5943.namprd11.prod.outlook.com (2603:10b6:510:13f::19) by MN6PR11MB8171.namprd11.prod.outlook.com (2603:10b6:208:471::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6699.34; Wed, 30 Aug 2023 03:20:44 +0000 X-Received: from PH7PR11MB5943.namprd11.prod.outlook.com ([fe80::8ab0:6d5b:1f29:ccb0]) by PH7PR11MB5943.namprd11.prod.outlook.com ([fe80::8ab0:6d5b:1f29:ccb0%4]) with mapi id 15.20.6745.020; Wed, 30 Aug 2023 03:20:44 +0000 From: "Jayaprakash, N" To: "devel@edk2.groups.io" , "Jayaprakash, N" CC: Rebecca Cran , "Kinney, Michael D" , "Kloper, Dimitry" Subject: Re: [edk2-devel] [edk2-libc Patch 1/1] edk2-libc: Socket completion functions are not called on Linux Compilation Thread-Topic: [edk2-devel] [edk2-libc Patch 1/1] edk2-libc: Socket completion functions are not called on Linux Compilation Thread-Index: AQHZ2ZrwTtGtZdRlfkiCW/Y/zqVSmLACLiZg Date: Wed, 30 Aug 2023 03:20:44 +0000 Message-ID: References: <20230828103106.1624-1-n.jayaprakash@intel.com> <177F857066635B47.29523@groups.io> In-Reply-To: <177F857066635B47.29523@groups.io> Accept-Language: en-IN, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-publictraffictype: Email x-ms-traffictypediagnostic: PH7PR11MB5943:EE_|MN6PR11MB8171:EE_ x-ms-office365-filtering-correlation-id: 8bd5ecf3-2d41-4f18-4f6f-08dba90818fa x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam-message-info: mRtNsWMT6xa4UOjJ0oRtM9tBy9E3pMwJVO0IIVBgAZMrbZyqwON/c5fmU1bOi/RrxlRGgAvoeZdSA95SCWicGihwRSjl36NEIhkLU18/9EKiDKD8of1bDrRvW6M/EtZ+sMpaz2/3ZsgCCRR78b/V6GZ/yccOeSKgKBg+C4d5TOZthY5u7zDXs2RgV7zeqGb2bGCPkdndPbrN9AgVRi25400ZNPanK/mAoyxAmzZYcMu9XW2Rn3n9U1cIYpzOMPRZdVq71Km9FMghfEmvleAqkS5Ak/2K2r3wIXDWWA/uYteOO+SRvqI9fzrWdbIb/CNy+KALGusy9mEPztY+AXkJUi50D7p3VYwZDGSg3ktezBAbYmQrrpgEODSEIBCLVPFwr9W8wsqaTNkVFckMiuErbkRHV8cOva3taU7UTJwibmTYec56gdY5FQ6z6/gSxxDVD2JReeAf0EcrTP672eGIo4VFLQc415RP1sa40fc829QYm67rYdheiAFyxFZMiH49sim+cysETbKB3KVsT5cH+aQ7M5DcVnhNuTlWjGzJd1tmPK+LmBT3R/Fej/RIv91b36mL/251c1FhRbkKbWTLOMQJru4IeTqDuP5RuHVq654Wb7N3u5i1liCRmMI2Pis+Bfx0ZUYxx6yohG2ugt4CyA== x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?iUsAe/DqVvz9+y21yMZD08mvSEnJ8GbNdbN+CjLwy7SPC0Z2LKBxe7cmmJBD?= =?us-ascii?Q?ijXBQ0p5ZTIPWHKjFIbwvnledINcgqjSCZWVUG8xeJw6xOaQEvkrfFmHaU2g?= =?us-ascii?Q?It8x4+OvoHBkv7lJ4YhpX3H9ir+fHwHZD/F5LnBcf5CbrzNtbbuwg2ehGbrf?= =?us-ascii?Q?XgZFOQGg5OsN7M/eQ+INk08dswckLw4iS/lCJCjZcDHx73XQ0fSMH/iJXyIQ?= =?us-ascii?Q?cvyo1ol+sb++TyDRElRk3yX2JOr+UwTHmExvDNndTmBp5BlC9V4FNl4oOSQe?= =?us-ascii?Q?g7lgyo2F23qE+VTuyMPMIclL6vL6sSIyAqVKQAmlHvj6+R9cALou8tqYM4wY?= =?us-ascii?Q?Y86x8kiU/bmSjP42O7vIY+wWfDDcR+QS9hLDNoivqEkdyQY8/aXTaUGGs/Wh?= =?us-ascii?Q?P7NilL+k7SXwKtuU7y6b01HLtYpn/6c7oijdThnxgEA0z8dUwln2SKoclVXV?= =?us-ascii?Q?2Cdm08dRCuk7TKNjxrXLwyc0ETK1SQRfN2LytG9aKSubre4Mv/yPWveHJMb8?= =?us-ascii?Q?44v8W6zOV9CSwXhv7Z3Bx7WZEpIhBCujNwrpUj/vEZFILFIB5JXKx2c4rUUx?= =?us-ascii?Q?ZDviTjGmj/cWgXldKyYtr9afuCSTcFAnSkyJFgGoHpjmkRm0U8TyqaqiVM4T?= =?us-ascii?Q?yPWaVbuBM5w7g0JzsIg4S4iDVh7XQktn7H/Bq8n9jZD3s7dpzOeBOdPjS6QB?= =?us-ascii?Q?WgXtBoyV/oD2m+G+/BYdDRuHFTizK2IaUF/ii5y1hL7tnvXaUmWq6SxfKcu6?= =?us-ascii?Q?aSP8lleJsOFl0LyNxCaDr+JI77ZAnFJ4axSxiw4vVWqvMjabPuFexX5Z4bG0?= =?us-ascii?Q?awBWDAG7y/va3aKOVmtQbtpIVTqV1KkBnNnykGU7MdR9ZZ46n24qCVI+kH+Q?= =?us-ascii?Q?L41taPBQbnxcrwqpeHCmHGiiSEg+URg8+8u1/b9vx6zwktvW2DMMrmoyPecx?= =?us-ascii?Q?NlGtEZFdmFxOxBg6hq/CjIAdUUV+e9wNVrx6eDSBLHFIvxfoTdnHtRo4Yxhq?= =?us-ascii?Q?vGZhUU12xxgU1GP9jbSDr0pQtm+4b6mygs007dcw35kxqxkVS+r4NcjDWmQD?= =?us-ascii?Q?6gLE78wfAHlbC6JxmqXwaXjGw8hTXPnom5kIFiA6NR2x3qBM7SacjTvbrZtk?= =?us-ascii?Q?DreOc0nx+qypo+MINC2SJA3BEkJzjOq8Me3sal8ECJ9SpWlZWJtmued2fR5R?= =?us-ascii?Q?ZiEDJ6EU4h3+mLAgCuOC9pHHO2nBXdqMjM04h0RtqynzVJhELrUnc4V7/Jxk?= =?us-ascii?Q?TmHgXyk920C0MhoUPoRUqCPYvrQAX2tmufg9nU4QrcGisaFVovBNqj6hBqpF?= =?us-ascii?Q?ZLYujLRVGzzilHup24JSK/yhDA5FRx2pnFqJPhOLZys88UlZFLpW8PO7JoW6?= =?us-ascii?Q?kf3uxuDjowHknbOvLXdP98HCWGkCzvEGY0KCMOX8HYwx5pxzhaZFm5Mh+CRN?= =?us-ascii?Q?WPe5T/L8a6G1RRf9AFf78wMZkcgmVyQjg4uCz4vBMuCpwUQYhJNADsWpofv+?= =?us-ascii?Q?Off8cdG02uvTYv5YhtlNljNzSm9ikiccBEIsTdTXAHHmBX8Wf8TbPmZzKtkq?= =?us-ascii?Q?wiB3pfA8hs36/bv05lfEONwvaKbqinbGwe2558oe?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: PH7PR11MB5943.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8bd5ecf3-2d41-4f18-4f6f-08dba90818fa X-MS-Exchange-CrossTenant-originalarrivaltime: 30 Aug 2023 03:20:44.6549 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: Z9VzjtZS/4rJmXXmaPRpi+VrlMDg7MftbLYacjvc2+4E8E76CkS4jkGgO7vN6Wm2ZKTRb+niguBy1HIuBnF/Kw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN6PR11MB8171 X-OriginatorOrg: intel.com Precedence: Bulk 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,n.jayaprakash@intel.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: hjZruCjrUbX4X2ekbmU56wmNx7686176AA= Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=XUVfuCjB; spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=intel.com (policy=none); arc=reject ("signature check failed: fail, {[1] = sig:microsoft.com:reject}") Reviewed-by: Jayaprakash N =20 Regards, JP -----Original Message----- From: devel@edk2.groups.io On Behalf Of Jayaprakash,= N Sent: Monday, August 28, 2023 4:01 PM To: devel@edk2.groups.io Cc: Jayaprakash, N ; Rebecca Cran ; Kinney, Michael D ; Kloper, Dimitry Subject: [edk2-devel] [edk2-libc Patch 1/1] edk2-libc: Socket completion fu= nctions are not called on Linux Compilation REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D983 >From the bug description: Analysis and root cause ---------------------------- After some investigation and debugging I have figured out the following: The following function is implemented in file edk2/StdLib/EfiSocketLib/Tcp= 4.c VOID EslTcp4ListenComplete ( IN EFI_EVENT Event, IN ESL_PORT * pPort ); The function is used in EslTcp4Listen() as a callback for connection notifi= cation event, it is created by the following code: Status =3D gBS->CreateEvent ( EVT_NOTIFY_SIGNAL, TPL_SOCKETS, (EFI_EVENT_NOTIFY)EslTcp4ListenComplete, pPort, &pTcp4->ListenToken.CompletionToken.Event ); And this is actually introduces a bug: the CreateEvent() third parameter is= of type EFI_EVENT_NOTIFY which is defined as typedef VOID (EFIAPI *EFI_EVENT_NOTIFY) ( IN EFI_EVENT Event, IN VOID *Context ); That EFIAPI tag is important since it defines an ABI that is used by compil= er in order to call the callback function. Note that EslTcp4ListenComplete(= ) is not marked as EFIAPI. Thus, on Linux, where gcc defaults to SYSV ABI, there will be mismatch betw= een arguments passed to EslTcp4ListenComplete() by the event dispatcher. It= expects function with WIN64 ABI, while its code compiled with default SYSV= ABI. It will look in wrong registers for arguments. Specifically pPort pointer references an wrong memory location. Luckily EslTcp4ListenComplete() performs sanity check of the pPort structure and di= scovers that it is invalid. This causes discarding of all incoming connecti= ons. Proposed fix --------------- The fix is trivial - mark EslTcp4ListenComplete() as EFIAPI. This is a litt= le more complicated, since there are additional callback functions that suf= fer from the same problem. In addition fixing those causes some compiler wa= rnings that shall be addressed. Attached patch fixes the problem for me. Cc: Rebecca Cran Cc: Michael D Kinney Cc: Jayaprakash N Signed-off-by: Dimitry Kloper --- StdLib/EfiSocketLib/Ip4.c | 11 +++++++---- StdLib/EfiSocketLib/Socket.c | 5 +++-- StdLib/EfiSocketLib/Socket.h | 12= ++++++------ StdLib/EfiSocketLib/Tcp4.c | 35 ++++++++++++++++++++--------------- StdLib/EfiSocketLib/Tcp6.c | 35 ++++++++++++++++++++--------------- StdLib/EfiSocketLib/Udp4.c | 10 ++++++---- StdLib/EfiSocketLib/Udp6.c | 10 ++++++---- 7 files changed, 68 insertions(+), 50 deletions(-) diff --git a/StdLib/EfiSocketLib/Ip4.c b/StdLib/EfiSocketLib/Ip4.c index 4b= 8f05b..8d25537 100644 --- a/StdLib/EfiSocketLib/Ip4.c +++ b/StdLib/EfiSocketLib/Ip4.c @@ -588,16 +588,17 @@ EslIp4RemoteAddressSet ( @param [in] pIo The address of an ::ESL_IO_MGMT structure =20 **/ -VOID +VOID EFIAPI EslIp4RxComplete ( IN EFI_EVENT Event, - IN ESL_IO_MGMT * pIo + IN VOID *context ) { size_t LengthInBytes; ESL_PACKET * pPacket; EFI_IP4_RECEIVE_DATA * pRxData; EFI_STATUS Status; + ESL_IO_MGMT * pIo =3D (ESL_IO_MGMT *)context; =20 DBG_ENTER ( ); =20 @@ -1117,10 +1118,10 @@ EslIp4TxBuffer ( @param [in] pIo The address of an ::ESL_IO_MGMT structure =20 **/ -VOID +VOID EFIAPI EslIp4TxComplete ( IN EFI_EVENT Event, - IN ESL_IO_MGMT * pIo + IN VOID *context ) { UINT32 LengthInBytes; @@ -1128,6 +1129,7 @@ EslIp4TxComplete ( ESL_PACKET * pPacket; ESL_SOCKET * pSocket; EFI_STATUS Status; + ESL_IO_MGMT * pIo =3D (ESL_IO_MGMT*)context; =20 DBG_ENTER ( ); =20 @@ -1341,6 +1343,7 @@ CONST ESL_PROTOCOL_API cEslIp4Api =3D { OFFSET_OF ( ESL_PORT, Context.Ip4.ModeData.ConfigData ), OFFSET_OF ( ESL_LAYER, pIp4List ), OFFSET_OF ( struct sockaddr_in, sin_zero ), + sizeof ( struct sockaddr_in ), AF_INET, sizeof (((ESL_PACKET *)0 )->Op.Ip4Rx ), diff --git a/StdLib/EfiSocketLib= /Socket.c b/StdLib/EfiSocketLib/Socket.c index 59b8efa..ee15b62 100644 --- a/StdLib/EfiSocketLib/Socket.c +++ b/StdLib/EfiSocketLib/Socket.c @@ -3970,14 +3970,15 @@ EslSocketPortClose ( @param[in] Event The close completion event @param[in] pPort Address of an ::ESL_PORT structure. **/ -VOID +VOID EFIAPI EslSocketPortCloseComplete ( IN EFI_EVENT Event, - IN ESL_PORT * pPort + IN VOID *context ) { ESL_IO_MGMT * pIo; EFI_STATUS Status; + ESL_PORT * pPort =3D (ESL_PORT*) context; =20 DBG_ENTER ( ); VERIFY_AT_TPL ( TPL_SOCKETS ); diff --git a/StdLib/EfiSocketLib/Socket.h b/StdLib/EfiSocketLib/Socket.h in= dex d7d55e6..81d3b2c 100644 --- a/StdLib/EfiSocketLib/Socket.h +++ b/StdLib/EfiSocketLib/Socket.h @@ -591,9 +591,9 @@ EFI_STATUS **/ typedef VOID -(* PFN_API_IO_COMPLETE) ( +(EFIAPI * PFN_API_IO_COMPLETE) ( IN EFI_EVENT Event, - IN ESL_IO_MGMT * pIo + IN VOID *pIo //IN ESL_IO_MGMT * pIo ); =20 /** @@ -909,9 +909,9 @@ EFI_STATUS **/ typedef VOID -(* PFN_API_TX_COMPLETE) ( +(EFIAPI * PFN_API_TX_COMPLETE) ( IN EFI_EVENT Event, - IN ESL_IO_MGMT * pIo + IN VOID *pIo //IN ESL_IO_MGMT * pIo ); =20 /** @@ -1433,10 +1433,10 @@ EslSocketPortClose ( @param [in] pPort Address of an ::ESL_PORT structure. =20 **/ -VOID +VOID EFIAPI EslSocketPortCloseComplete ( IN EFI_EVENT Event, - IN ESL_PORT * pPort + IN VOID *context ); =20 /** diff --git a/StdLib/EfiSocketLib/Tcp4.c b/StdLib/EfiSocketLib/Tcp4.c index = 143b54b..0bd54ac 100644 --- a/StdLib/EfiSocketLib/Tcp4.c +++ b/StdLib/EfiSocketLib/Tcp4.c @@ -68,10 +68,10 @@ EslTcp4ConnectStart ( @param [in] pPort Address of an ::ESL_PORT structure. =20 **/ -VOID +VOID EFIAPI EslTcp4ListenComplete ( IN EFI_EVENT Event, - IN ESL_PORT * pPort + IN VOID *contet ); =20 =20 @@ -185,10 +185,10 @@ EslTcp4Accept ( @param [in] pPort Address of an ::ESL_PORT structure. =20 **/ -VOID +VOID EFIAPI EslTcp4ConnectComplete ( IN EFI_EVENT Event, - IN ESL_PORT * pPort + IN VOID *context ) { BOOLEAN bRemoveFirstPort; @@ -197,6 +197,7 @@ EslTcp4ConnectComplete ( ESL_SOCKET * pSocket; ESL_TCP4_CONTEXT * pTcp4; EFI_STATUS Status; + ESL_PORT * pPort =3D (ESL_PORT*)context; =20 DBG_ENTER ( ); =20 @@ -653,7 +654,7 @@ EslTcp4Listen ( pTcp4 =3D &pPort->Context.Tcp4; Status =3D gBS->CreateEvent ( EVT_NOTIFY_SIGNAL, TPL_SOCKETS, - (EFI_EVENT_NOTIFY)EslTcp4ListenComplet= e, + EslTcp4ListenComplete, pPort, &pTcp4->ListenToken.CompletionToken.Ev= ent ); if ( EFI_ERROR ( Status )) { @@ -825,10 +826,10 @@ EslTcp4Listen ( @param [in] pPort Address of an ::ESL_PORT structure. =20 **/ -VOID +VOID EFIAPI EslTcp4ListenComplete ( IN EFI_EVENT Event, - IN ESL_PORT * pPort + IN VOID *context ) { EFI_HANDLE ChildHandle; @@ -842,6 +843,7 @@ EslTcp4ListenComplete ( EFI_STATUS Status; EFI_HANDLE TcpPortHandle; EFI_STATUS TempStatus; + ESL_PORT * pPort =3D (ESL_PORT*)context; =20 DBG_ENTER ( ); VERIFY_AT_TPL ( TPL_SOCKETS ); @@ -1263,7 +1265,7 @@ EslTcp4PortAllocate ( pTcp4 =3D &pPort->Context.Tcp4; Status =3D gBS->CreateEvent ( EVT_NOTIFY_SIGNAL, TPL_SOCKETS, - (EFI_EVENT_NOTIFY)EslSocketPortCloseCompl= ete, + EslSocketPortCloseComplete, pPort, &pTcp4->CloseToken.CompletionToken.Event)= ; if ( EFI_ERROR ( Status )) { @@ -1282,7 +1284,7 @@ EslTcp4PortAllocate ( // Status =3D gBS->CreateEvent ( EVT_NOTIFY_SIGNAL, TPL_SOCKETS, - (EFI_EVENT_NOTIFY)EslTcp4ConnectComplete, + EslTcp4ConnectComplete, pPort, &pTcp4->ConnectToken.CompletionToken.Even= t); if ( EFI_ERROR ( Status )) { @@ -1732,16 +1734,17 @@ EslTcp4RemoteAddressSet ( @param [in] pIo Address of an ::ESL_IO_MGMT structure =20 **/ -VOID +VOID EFIAPI EslTcp4RxComplete ( IN EFI_EVENT Event, - IN ESL_IO_MGMT * pIo + IN VOID *context ) { BOOLEAN bUrgent; size_t LengthInBytes; ESL_PACKET * pPacket; EFI_STATUS Status; + ESL_IO_MGMT * pIo =3D (ESL_IO_MGMT*)context; =20 DBG_ENTER ( ); =20 @@ -2121,10 +2124,10 @@ EslTcp4TxBuffer ( @param [in] pIo The ESL_IO_MGMT structure address =20 **/ -VOID +VOID EFIAPI EslTcp4TxComplete ( IN EFI_EVENT Event, - IN ESL_IO_MGMT * pIo + IN VOID *context ) { UINT32 LengthInBytes; @@ -2132,6 +2135,7 @@ EslTcp4TxComplete ( ESL_PORT * pPort; ESL_SOCKET * pSocket; EFI_STATUS Status; + ESL_IO_MGMT * pIo =3D (ESL_IO_MGMT*)context; =20 DBG_ENTER ( ); =20 @@ -2178,10 +2182,10 @@ EslTcp4TxComplete ( @param [in] pIo The ESL_IO_MGMT structure address =20 **/ -VOID +VOID EFIAPI EslTcp4TxOobComplete ( IN EFI_EVENT Event, - IN ESL_IO_MGMT * pIo + IN VOID *context ) { UINT32 LengthInBytes; @@ -2189,6 +2193,7 @@ EslTcp4TxOobComplete ( ESL_PORT * pPort; ESL_SOCKET * pSocket; EFI_STATUS Status; + ESL_IO_MGMT * pIo =3D (ESL_IO_MGMT*)context; =20 DBG_ENTER ( ); =20 diff --git a/StdLib/EfiSocketLib/Tcp6.c b/StdLib/EfiSocketLib/Tcp6.c index = 2014298..62ebf00 100644 --- a/StdLib/EfiSocketLib/Tcp6.c +++ b/StdLib/EfiSocketLib/Tcp6.c @@ -68,10 +68,10 @@ EslTcp6ConnectStart ( @param [in] pPort Address of an ::ESL_PORT structure. =20 **/ -VOID +VOID EFIAPI EslTcp6ListenComplete ( IN EFI_EVENT Event, - IN ESL_PORT * pPort + IN VOID *pPort // IN ESL_PORT * pPort ); =20 =20 @@ -179,10 +179,10 @@ EslTcp6Accept ( @param [in] pPort Address of an ::ESL_PORT structure. =20 **/ -VOID +VOID EFIAPI EslTcp6ConnectComplete ( IN EFI_EVENT Event, - IN ESL_PORT * pPort + IN VOID *context ) { BOOLEAN bRemoveFirstPort; @@ -191,6 +191,7 @@ EslTcp6ConnectComplete ( ESL_SOCKET * pSocket; ESL_TCP6_CONTEXT * pTcp6; EFI_STATUS Status; + ESL_PORT * pPort =3D (ESL_PORT*)context; =20 DBG_ENTER ( ); =20 @@ -684,7 +685,7 @@ EslTcp6Listen ( pTcp6 =3D &pPort->Context.Tcp6; Status =3D gBS->CreateEvent ( EVT_NOTIFY_SIGNAL, TPL_SOCKETS, - (EFI_EVENT_NOTIFY)EslTcp6ListenComplet= e, + EslTcp6ListenComplete, pPort, &pTcp6->ListenToken.CompletionToken.Ev= ent ); if ( EFI_ERROR ( Status )) { @@ -856,10 +857,10 @@ EslTcp6Listen ( @param [in] pPort Address of an ::ESL_PORT structure. =20 **/ -VOID +VOID EFIAPI EslTcp6ListenComplete ( IN EFI_EVENT Event, - IN ESL_PORT * pPort + IN VOID *context ) { EFI_HANDLE ChildHandle; @@ -873,6 +874,7 @@ EslTcp6ListenComplete ( EFI_STATUS Status; EFI_HANDLE TcpPortHandle; EFI_STATUS TempStatus; + ESL_PORT * pPort =3D (ESL_PORT*)context; =20 DBG_ENTER ( ); VERIFY_AT_TPL ( TPL_SOCKETS ); @@ -1314,7 +1316,7 @@ EslTcp6PortAllocate ( pTcp6 =3D &pPort->Context.Tcp6; Status =3D gBS->CreateEvent ( EVT_NOTIFY_SIGNAL, TPL_SOCKETS, - (EFI_EVENT_NOTIFY)EslSocketPortCloseCompl= ete, + EslSocketPortCloseComplete, pPort, &pTcp6->CloseToken.CompletionToken.Event)= ; if ( EFI_ERROR ( Status )) { @@ -1333,7 +1335,7 @@ EslTcp6PortAllocate ( // Status =3D gBS->CreateEvent ( EVT_NOTIFY_SIGNAL, TPL_SOCKETS, - (EFI_EVENT_NOTIFY)EslTcp6ConnectComplete, + EslTcp6ConnectComplete, pPort, &pTcp6->ConnectToken.CompletionToken.Even= t); if ( EFI_ERROR ( Status )) { @@ -1801,16 +1803,17 @@ EslTcp6RemoteAddressSet ( @param [in] pIo Address of an ::ESL_IO_MGMT structure =20 **/ -VOID +VOID EFIAPI EslTcp6RxComplete ( IN EFI_EVENT Event, - IN ESL_IO_MGMT * pIo + IN VOID *context ) { BOOLEAN bUrgent; size_t LengthInBytes; ESL_PACKET * pPacket; EFI_STATUS Status; + ESL_IO_MGMT * pIo =3D (ESL_IO_MGMT*)context; =20 DBG_ENTER ( ); =20 @@ -2190,10 +2193,10 @@ EslTcp6TxBuffer ( @param [in] pIo The ESL_IO_MGMT structure address =20 **/ -VOID +VOID EFIAPI EslTcp6TxComplete ( IN EFI_EVENT Event, - IN ESL_IO_MGMT * pIo + IN VOID *context ) { UINT32 LengthInBytes; @@ -2201,6 +2204,7 @@ EslTcp6TxComplete ( ESL_PORT * pPort; ESL_SOCKET * pSocket; EFI_STATUS Status; + ESL_IO_MGMT * pIo =3D (ESL_IO_MGMT*)context; =20 DBG_ENTER ( ); =20 @@ -2247,10 +2251,10 @@ EslTcp6TxComplete ( @param [in] pIo The ESL_IO_MGMT structure address =20 **/ -VOID +VOID EFIAPI EslTcp6TxOobComplete ( IN EFI_EVENT Event, - IN ESL_IO_MGMT * pIo + IN VOID *context ) { UINT32 LengthInBytes; @@ -2258,6 +2262,7 @@ EslTcp6TxOobComplete ( ESL_PORT * pPort; ESL_SOCKET * pSocket; EFI_STATUS Status; + ESL_IO_MGMT * pIo =3D (ESL_IO_MGMT*)context; =20 DBG_ENTER ( ); =20 diff --git a/StdLib/EfiSocketLib/Udp4.c b/StdLib/EfiSocketLib/Udp4.c index = eafa014..ceaf3f4 100644 --- a/StdLib/EfiSocketLib/Udp4.c +++ b/StdLib/EfiSocketLib/Udp4.c @@ -484,16 +484,17 @@ EslUdp4RemoteAddressSet ( @param [in] pIo Address of an ::ESL_IO_MGMT structure =20 **/ -VOID +VOID EFIAPI EslUdp4RxComplete ( IN EFI_EVENT Event, - IN ESL_IO_MGMT * pIo + IN VOID *context ) { size_t LengthInBytes; ESL_PACKET * pPacket; EFI_UDP4_RECEIVE_DATA * pRxData; EFI_STATUS Status; + ESL_IO_MGMT * pIo =3D (ESL_IO_MGMT*)context; =20 DBG_ENTER ( ); =20 @@ -969,10 +970,10 @@ EslUdp4TxBuffer ( @param [in] pIo Address of an ::ESL_IO_MGMT structure =20 **/ -VOID +VOID EFIAPI EslUdp4TxComplete ( IN EFI_EVENT Event, - IN ESL_IO_MGMT * pIo + IN VOID *context ) { UINT32 LengthInBytes; @@ -980,6 +981,7 @@ EslUdp4TxComplete ( ESL_PACKET * pPacket; ESL_SOCKET * pSocket; EFI_STATUS Status; + ESL_IO_MGMT * pIo =3D (ESL_IO_MGMT*)context; =20 DBG_ENTER ( ); =20 diff --git a/StdLib/EfiSocketLib/Udp6.c b/StdLib/EfiSocketLib/Udp6.c index = 67dbd32..dca55ec 100644 --- a/StdLib/EfiSocketLib/Udp6.c +++ b/StdLib/EfiSocketLib/Udp6.c @@ -478,16 +478,17 @@ EslUdp6RemoteAddressSet ( @param [in] pIo Address of an ::ESL_IO_MGMT structure =20 **/ -VOID +VOID EFIAPI EslUdp6RxComplete ( IN EFI_EVENT Event, - IN ESL_IO_MGMT * pIo + IN VOID *context ) { size_t LengthInBytes; ESL_PACKET * pPacket; EFI_UDP6_RECEIVE_DATA * pRxData; EFI_STATUS Status; + ESL_IO_MGMT * pIo =3D (ESL_IO_MGMT*)context; =20 DBG_ENTER ( ); =20 @@ -1021,10 +1022,10 @@ EslUdp6TxBuffer ( @param [in] pIo Address of an ::ESL_IO_MGMT structure =20 **/ -VOID +VOID EFIAPI EslUdp6TxComplete ( IN EFI_EVENT Event, - IN ESL_IO_MGMT * pIo + IN VOID *context ) { UINT32 LengthInBytes; @@ -1032,6 +1033,7 @@ EslUdp6TxComplete ( ESL_PACKET * pPacket; ESL_SOCKET * pSocket; EFI_STATUS Status; + ESL_IO_MGMT * pIo =3D (ESL_IO_MGMT*)context; =20 DBG_ENTER ( ); =20 -- 2.40.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 (#108112): https://edk2.groups.io/g/devel/message/108112 Mute This Topic: https://groups.io/mt/101046088/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-