From patchwork Thu Aug 10 22:34:47 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Palmer, Thomas" X-Patchwork-Id: 109848 Delivered-To: patch@linaro.org Received: by 10.140.95.78 with SMTP id h72csp111166qge; Thu, 10 Aug 2017 15:35:08 -0700 (PDT) X-Received: by 10.98.105.138 with SMTP id e132mr6541562pfc.220.1502404508198; Thu, 10 Aug 2017 15:35:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1502404508; cv=none; d=google.com; s=arc-20160816; b=fvsf5x8yOvb40H59cWLJ6fpZV7DNagfnXXLIBceErZq3pQF1+3upQtiRBSrlmY+V98 pFPuDVdfmKAhPFk1Ft2E3sjGH5VgWNOMvzCYUNyPQCDNmbdt1moIuaJ9DkDKxQwCxplh FG4Yd8rLUCg2GMNZE3brRPMbELRktw6XlNXNGk+UH3IKdrqNMXWRUKgrqrzITLr+HGrh DFjRUhZ0wQU7KDngVgsstKxvmVvENSWkAeli68UuDEhYvVrzGn7Nh5jKPCjA522OOhQq vUlPEbWERv/IBVUlN2ca8HU3ZkvGta4wTYlzZ+LwCbo1taGr20Wo/BVmKOueWjSbH1aB z/Ag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:cc :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:message-id:date:to:from:delivered-to :arc-authentication-results; bh=5sDMk0WhiJ9qrDeB6CLsiIWXehWmbByr5qQM80kJFUk=; b=QO2z/7jmb1Yw7LFjemwD2sQvkj7pus1J+qhRr47GohxTXjhg4LwA6VVbbX4Pw/0yzu 9NJEYdTrxgD8RxsEFAJKyEcXSBG28CdeskyD23RNSNbkCZVQoHpEHejAoMwsBpbT0F4l XqcCZ2GYpPDxlt4IlOMb6KfIKKPPqWPi5O94XUCaFmaq2aCalTGmBr3xFXtwijRjQqVR Wv+HcFoa9b1dt1fEKQ/twd/bexdGB43Y8g14nfIYCcTsScLGN3CZRu5pw11tyHgwIwXG oJKAgjBR6+uw7gQSLOVZh25PGcYYxMQNB40n/2h2yRkWeRAY14zjXuPCxMymC0Z4PHTr wGFg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 2001:19d0:306:5::1 as permitted sender) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org. [2001:19d0:306:5::1]) by mx.google.com with ESMTPS id 62si5097996ply.124.2017.08.10.15.35.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 10 Aug 2017 15:35:08 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 2001:19d0:306:5::1 as permitted sender) client-ip=2001:19d0:306:5::1; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 2001:19d0:306:5::1 as permitted sender) smtp.mailfrom=edk2-devel-bounces@lists.01.org Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 475B121D49C74; Thu, 10 Aug 2017 15:32:47 -0700 (PDT) X-Original-To: edk2-devel@lists.01.org Delivered-To: edk2-devel@lists.01.org Received: from g9t5008.houston.hpe.com (g9t5008.houston.hpe.com [15.241.48.72]) (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 AFCC2208F7A18 for ; Thu, 10 Aug 2017 15:32:45 -0700 (PDT) Received: from arm-build-server.us.rdlabs.hpecorp.net (arm-build-server.us.rdlabs.hpecorp.net [16.84.24.54]) by g9t5008.houston.hpe.com (Postfix) with ESMTP id 44AC56F; Thu, 10 Aug 2017 22:35:04 +0000 (UTC) From: Thomas Palmer To: edk2-devel@lists.01.org Date: Thu, 10 Aug 2017 17:34:47 -0500 Message-Id: <1502404487-12865-1-git-send-email-thomas.palmer@hpe.com> X-Mailer: git-send-email 2.7.4 Subject: [edk2] [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: , Cc: jaben.carsey@intel.com, edk2-lists@mc2research.org MIME-Version: 1.0 Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" The gBS->CreateEvent expects a EFI_EVENT_NOTIFY function as the third argument. The EFIAPI token is an important component of that prototype. Its absence can cause unexpected issues on DEBUG systems built with GCC due to ABI mismatches. 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. This patch removes the cast and updates both functions to comply with EFI_EVENT_NOTIFY. 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(-) -- 2.7.4 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel 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. 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 this distribution. The full text of the license may be found at @@ -192,9 +193,10 @@ EslTcp4Accept ( **/ 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; DBG_ENTER ( ); // // Locate the TCP context // + pPort = Context; pSocket = pPort->pSocket; pTcp4 = &pPort->Context.Tcp4; @@ -1288,7 +1292,7 @@ EslTcp4PortAllocate ( // Status = gBS->CreateEvent ( EVT_NOTIFY_SIGNAL, TPL_SOCKETS, - (EFI_EVENT_NOTIFY)EslTcp4ConnectComplete, + EslTcp4ConnectComplete, pPort, &pTcp4->ConnectToken.CompletionToken.Event); 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. 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 this distribution. The full text of the license may be found at @@ -186,9 +187,10 @@ EslTcp6Accept ( **/ 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; DBG_ENTER ( ); // // Locate the TCP context // + pPort = Context; pSocket = pPort->pSocket; pTcp6 = &pPort->Context.Tcp6; @@ -1339,7 +1343,7 @@ EslTcp6PortAllocate ( // Status = gBS->CreateEvent ( EVT_NOTIFY_SIGNAL, TPL_SOCKETS, - (EFI_EVENT_NOTIFY)EslTcp6ConnectComplete, + EslTcp6ConnectComplete, pPort, &pTcp6->ConnectToken.CompletionToken.Event); if ( EFI_ERROR ( Status )) {