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 AFC2DD80477 for ; Fri, 1 Dec 2023 01:56:37 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=cTIORT7VTE0GYYP+3Fhe6zRMVMDSHs3hjNYrPXxk/zU=; c=relaxed/simple; d=groups.io; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Transfer-Encoding; s=20140610; t=1701395796; v=1; b=bZl7r0G0A8jQWjgHhSotxrVDrqb3tYMVvob/rIIKGcWS29uKtguOYQ2leO5oOdsJkTl1Zvef fxC7Yi1yT6Uyb07/isozNy7INHvoEbHTiXW6+m+T1F7zWIhUl81GCaoR45eXbDjA7grN5YMHreD t2ejUKBTQ8mIpngQJSBEqv4M= X-Received: by 127.0.0.2 with SMTP id pLy0YY7687511xZyT3NgXeMO; Thu, 30 Nov 2023 17:56:36 -0800 X-Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.151]) by mx.groups.io with SMTP id smtpd.web11.13222.1701395795770041683 for ; Thu, 30 Nov 2023 17:56:35 -0800 X-IronPort-AV: E=McAfee;i="6600,9927,10910"; a="373604451" X-IronPort-AV: E=Sophos;i="6.04,240,1695711600"; d="scan'208";a="373604451" X-Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Nov 2023 17:56:35 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10910"; a="913416533" X-IronPort-AV: E=Sophos;i="6.04,240,1695711600"; d="scan'208";a="913416533" X-Received: from nldesimo-desk.amr.corp.intel.com ([10.241.240.67]) by fmsmga001-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Nov 2023 17:56:35 -0800 From: "Nate DeSimone" To: devel@edk2.groups.io Cc: Ray Ni , Michael D Kinney Subject: [edk2-devel] [PATCH v1] MdeModulePkg/Bus: Fix XhciDxe Linker Issues Date: Thu, 30 Nov 2023 17:56:17 -0800 Message-Id: <20231201015618.3920-2-nathaniel.l.desimone@intel.com> In-Reply-To: <20231201015618.3920-1-nathaniel.l.desimone@intel.com> References: <20231201015618.3920-1-nathaniel.l.desimone@intel.com> MIME-Version: 1.0 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,nathaniel.l.desimone@intel.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: E3QEyhuqYq7EkpTV1b1MpEyQx7686176AA= Content-Transfer-Encoding: 8bit X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=bZl7r0G0; 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) The DXE & MM standalone variant of AcpiTimerLib defines a global named mPerformanceCounterFrequency. A global with an identical name is also present in MdeModulePkg/Bus/Pci/XhciDxe/Xhci.c Since XhciDxe has a dependency on TimerLib, this can cause link errors due to the same symbol being defined twice if the platform DSC chooses to use AcpiTimerLib as the TimerLib implementation for any given platform. To resolve this, I noted that some of the globals in Xhci.c are not used outside of the Xhci.c compilation unit: - mPerformanceCounterStartValue - mPerformanceCounterEndValue - mPerformanceCounterFrequency - mPerformanceCounterValuesCached I have changed the definition for all of these to STATIC. Since they are not used outside of the Xhci.c compilation unit, there is no reason to have them exported as globals. Cc: Ray Ni Cc: Michael D Kinney Signed-off-by: Nate DeSimone --- MdeModulePkg/Bus/Pci/XhciDxe/Xhci.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/MdeModulePkg/Bus/Pci/XhciDxe/Xhci.c b/MdeModulePkg/Bus/Pci/XhciDxe/Xhci.c index 7a2e32a9dd..cc8332500b 100644 --- a/MdeModulePkg/Bus/Pci/XhciDxe/Xhci.c +++ b/MdeModulePkg/Bus/Pci/XhciDxe/Xhci.c @@ -2,7 +2,7 @@ The XHCI controller driver. (C) Copyright 2023 Hewlett Packard Enterprise Development LP
-Copyright (c) 2011 - 2022, Intel Corporation. All rights reserved.
+Copyright (c) 2011 - 2023, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent **/ @@ -86,10 +86,10 @@ EFI_USB2_HC_PROTOCOL gXhciUsb2HcTemplate = { 0x0 }; -UINT64 mPerformanceCounterStartValue; -UINT64 mPerformanceCounterEndValue; -UINT64 mPerformanceCounterFrequency; -BOOLEAN mPerformanceCounterValuesCached = FALSE; +STATIC UINT64 mPerformanceCounterStartValue; +STATIC UINT64 mPerformanceCounterEndValue; +STATIC UINT64 mPerformanceCounterFrequency; +STATIC BOOLEAN mPerformanceCounterValuesCached = FALSE; /** Retrieves the capability of root hub ports. -- 2.39.2.windows.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#111961): https://edk2.groups.io/g/devel/message/111961 Mute This Topic: https://groups.io/mt/102907650/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=-