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 1C1D6740034 for ; Fri, 1 Dec 2023 04:39:09 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=Ey+12/sjjEb8q23RoIFmn3/eBpO3fqp5l7n1SHbFBzQ=; 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=1701405548; v=1; b=aVy183kBHwEExWBeLGjakbUfeyhQSZATlsSXlex9A9fgdJ5WGzWUh2exy1fvVmHHqVMJrfOc mW5zz+A7aUdBWy6ttMUdgFDCzi/Y+A2q4Jvao3vIQM12V2XQBxIrHTDqE4FDd3IOcind6f/COuM UbaSELn9aJv1nuetGxg62mI0= X-Received: by 127.0.0.2 with SMTP id ZaM4YY7687511xitdcl53uZd; Thu, 30 Nov 2023 20:39:08 -0800 X-Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.100]) by mx.groups.io with SMTP id smtpd.web11.15826.1701405547948826762 for ; Thu, 30 Nov 2023 20:39:08 -0800 X-IronPort-AV: E=McAfee;i="6600,9927,10910"; a="459935577" X-IronPort-AV: E=Sophos;i="6.04,240,1695711600"; d="scan'208";a="459935577" X-Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Nov 2023 20:39:07 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10910"; a="1101175618" X-IronPort-AV: E=Sophos;i="6.04,240,1695711600"; d="scan'208";a="1101175618" X-Received: from fmsmsx601.amr.corp.intel.com ([10.18.126.81]) by fmsmga005.fm.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 30 Nov 2023 20:39:07 -0800 X-Received: from fmsmsx602.amr.corp.intel.com (10.18.126.82) 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.34; Thu, 30 Nov 2023 20:39:06 -0800 X-Received: from FMSEDG603.ED.cps.intel.com (10.1.192.133) by fmsmsx602.amr.corp.intel.com (10.18.126.82) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.34 via Frontend Transport; Thu, 30 Nov 2023 20:39:06 -0800 X-Received: from NAM11-CO1-obe.outbound.protection.outlook.com (104.47.56.169) 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.34; Thu, 30 Nov 2023 20:39:06 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dBiKzSQuau/CrBDTaZ/fNJB+edRXKEdNnmSpLX3BdPYIcS6q4noDlGFMLUJ4Cd25XaCsg6nNzZpdDgXGQvBGVDXwFY+KgJkHdOE975J+NfJjNZlahK+oFv7m1P1kMgzP+2XzB7V4wRyJYAx8FIc0ObWNdnKLz+b71m307bcpGL+wAHH8YD0BT6dZ52wpUOrkNcWSW8y6cAhVL4AT5Pin/m6GgkOIJKlb3Pv12u8AXyLMA6pM95qPovJABQdtzRbPIIaQvoVeBHRyXmsdrjPRWVZcOJzIuy4fI//HJiLpKBtW0VuF14Rmf7e2Qyn+50ym2IfsWA5aheZ+qBVtlEYqtw== 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=BHso1Ef/Tj5vpRKq5nd3uMPnBQ0/4NRlr37CdWRr+rc=; b=Ypov5y/X384mR9cGCBbddujXg666dzGJqpZnGnslHwfUFsm1shswAz5qf5dETKLbQn8wbc30pDQqQpRDI2mHxKeChF1Qv8cdZNf+PeJDI5cc3QRcKdjVf2AOLcF3NakozQPMqQs7B8cNGKMWzWpBtIfeRKdNhc16MslVi7Uxr7BUBDIMVefjdj5adqVK47bW7yfVF/XODO4DWsdbHkdvisNps/8WQLfpK2nsf4dIsu9yN0HmpEAbW3voOPTm7CEyhFETivOCCZ59O32KyVYR1D061vSv8ulKsUAUycvPwGn/SFA6XrZrX8Lw3vheM/w8qgIP2OgwAZcenZgZcYE2GA== 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 CO1PR11MB4929.namprd11.prod.outlook.com (2603:10b6:303:6d::19) by DM4PR11MB8225.namprd11.prod.outlook.com (2603:10b6:8:188::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7046.24; Fri, 1 Dec 2023 04:39:04 +0000 X-Received: from CO1PR11MB4929.namprd11.prod.outlook.com ([fe80::4382:5b03:f13:88ff]) by CO1PR11MB4929.namprd11.prod.outlook.com ([fe80::4382:5b03:f13:88ff%5]) with mapi id 15.20.7046.027; Fri, 1 Dec 2023 04:39:04 +0000 From: "Michael D Kinney" To: "Ni, Ray" , "Desimone, Nathaniel L" , "devel@edk2.groups.io" CC: "Kinney, Michael D" Subject: Re: [edk2-devel] [PATCH v1] PcAtChipsetPkg: Fix AcpiTimerLib incompatibility with XhciDxe Thread-Topic: [PATCH v1] PcAtChipsetPkg: Fix AcpiTimerLib incompatibility with XhciDxe Thread-Index: AQHaI/moe3uJ1/3jHUyikYhDloZHY7CTwKAAgAAWdeA= Date: Fri, 1 Dec 2023 04:39:04 +0000 Message-ID: References: <20231201015618.3920-1-nathaniel.l.desimone@intel.com> <20231201015618.3920-3-nathaniel.l.desimone@intel.com> In-Reply-To: Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-publictraffictype: Email x-ms-traffictypediagnostic: CO1PR11MB4929:EE_|DM4PR11MB8225:EE_ x-ms-office365-filtering-correlation-id: a88da8aa-8541-4a66-e01c-08dbf22772b2 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam-message-info: YzYuYMCmy0AGNHqchnCRhzIyVAnksOH+82AeJPYv3MerO4AJrDgmtSoT+Vf6lpTMgIcikGvcX+YWTVOjQulOaN5omkBIeNROkAfjk8FsTaG/zArXavkKENP53Hpnmay6uyT9IT4nUyb9nXNFbRFW5E2DA4qgD7kA81Q+TL9Qm6a8zJ7n+Ot3P/HE01WOKjyVZyRgyP0LJK89qBebwUMa9hz7TLba+km2kpQRYLBPMo0uHUgeCARfyIqwLOo246XOQMHnIqOc464fe9hhMGpppNu2H0h9kkdcxOFmdqNK+u26YlnJ1YjHvAIXmwwRn7spyMyUHzSescvYTbJPV8f8nL69e6pcTf/hJHMcAFdDGkde0/PKyZLWQpkt3WUF47+UrpXZyMGJ0XeDC0suYarlL4UAA+dBDPPpx0W1XT0ifP9jbvud9YRdflRnDZxjiHIId8B/jTPAe79fjvmSrV+8wbPlvr/3B+KUbrB2l/8N1fLWr2u+GNFo5aRsACiq2rKkn2l/e+AC6txZ0LxgZUMqONm4E4jQ6oyRFx3ay5qhBypY1OIcQQ2rNuc1GS7m941t4bu9FQBsrsgTldchMVrqc27qkswciTs1BT75hHt7+4wBqnmu+sJguJ0DprjfFcj8 x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?kddVlPwu4g7H01oYJP/Zee3JiV+b95DKEC4z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ascii?Q?eDb8dvxgf3fdeC/gzacWFlBCT7TrPXg86Caer0eBlBZG4gLe6YPCo7Ew7cvB?= =?us-ascii?Q?jKTyYfqZiJs3FOyn71B03DufxEVlo5dwfVJIumJP2Ee5dZGtKKf1Xc1Eu1MQ?= =?us-ascii?Q?GU4UddGHtHSNYIR3bGegGFVk8gcqnxtKgTkJXEug/p2va3tm+vcap9ab5BsI?= =?us-ascii?Q?pKo+FTOPm1WZizHtbJU/P6fqq50n7kKQOPF91q+jXY9T/7LI/PVbijinGX4Q?= =?us-ascii?Q?0fSbd5HQwUAvUtc9GVrNVijnmSBKPs8uqDD1wWarx6tu0wsKdEjjTvkFtUd4?= =?us-ascii?Q?wy+2EG7ekfC4ADqZieJRYdXKqaftkQeJM3/T7mvck0iBLMN9funeDKbZUMxq?= =?us-ascii?Q?S65pIkrFKeM+NxnvF78GSzooHu0mYTKIXmMtcXqh181SBQ734jlLeswyPp7J?= =?us-ascii?Q?JPDnIhS5VLmgHlZcRG+rmSOd7mJoO9zZWH+dI/2sPMOfqo/VqIrn+bHYE1fk?= =?us-ascii?Q?y8ON1XDLumYDrRDu+A/ph7D9ewqBLkP1fU2G0RYrF4LJ9NOESyWfFqpck+O4?= =?us-ascii?Q?3wMbU4y4UrCVIkJ6PzAiUeuAGRNW0l2pgE3e0oth1ehu3mTsgeMRhlh8pJPg?= =?us-ascii?Q?FgAHmelBvBJWVYh+t9FjQnnV2T2TO2RRvsg/jSZHZPJZwMHPEOUywLtpcsZA?= =?us-ascii?Q?hgyKY6e8/ORitUrHSCfJDdeUxiyjk1S4Cx3fcM1UshJVQaEUKgYCZIeHf3R/?= =?us-ascii?Q?Dw=3D=3D?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: CO1PR11MB4929.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: a88da8aa-8541-4a66-e01c-08dbf22772b2 X-MS-Exchange-CrossTenant-originalarrivaltime: 01 Dec 2023 04:39:04.4845 (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: LUyDNN9i9qq1A9r52xYXAexL58pkD62FNDp75q0r0CzmnWFVxMDs1KsQ52sSBMDiMCM/gwJoOwpZaYIiOy80uLzsMUrbm7fyo8RDreofXP4= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR11MB8225 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,michael.d.kinney@intel.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: 7sm9F7P8CCAqJkFN6ZMGxi9hx7686176AA= 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=aVy183kB; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=intel.com (policy=none); spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io; arc=reject ("signature check failed: fail, {[1] = sig:microsoft.com:reject}") Hi Ray, 'static' is allowed and actually preferred for module globals=20 that start with 'm' that are scoped to a single C file. Globals that start with 'g' that need to be access by multiple C files can not be static. Since 'm' globals could be changed to 'g' globals due to maintenance, we want to avoid symbol collisions between 'g' globals. Prefixing all globals with a module name helps prevent symbol collisions. Summary =3D=3D=3D=3D=3D=3D=3D=3D * Use lower case 'static' * Use 'static' for 'm' globals * Do not use 'static' for 'g' globals * Add module/lib specific prefix to 'm' and 'g' global Mike > -----Original Message----- > From: Ni, Ray > Sent: Thursday, November 30, 2023 7:13 PM > To: Desimone, Nathaniel L ; > devel@edk2.groups.io > Cc: Kinney, Michael D > Subject: RE: [PATCH v1] PcAtChipsetPkg: Fix AcpiTimerLib incompatibility > with XhciDxe >=20 > Mike, > Does today's EDK2 C coding style spec allow using "STATIC" for global > variables? > Or lower case "static"? > Or changing the variable to a name with lib name prefix, e.g.: " > mTimerLibPerformanceCounterFrequency"? >=20 >=20 > Thanks, > Ray > > -----Original Message----- > > From: Desimone, Nathaniel L > > Sent: Friday, December 1, 2023 9:56 AM > > To: devel@edk2.groups.io > > Cc: Ni, Ray ; Kinney, Michael D > > > > Subject: [PATCH v1] PcAtChipsetPkg: Fix AcpiTimerLib incompatibility wi= th > > XhciDxe > > > > 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 have changed made the definition of > > mPerformanceCounterFrequency to STATIC. Since this variable is not > > used outside of the DxeStandaloneMmAcpiTimerLib.c compilation unit, > > there is no reason to have it exported as a global. > > > > Cc: Ray Ni > > Cc: Michael D Kinney > > Signed-off-by: Nate DeSimone > > --- > > .../Library/AcpiTimerLib/DxeStandaloneMmAcpiTimerLib.c | 4 ++-- > > 1 file changed, 2 insertions(+), 2 deletions(-) > > > > diff --git > > a/PcAtChipsetPkg/Library/AcpiTimerLib/DxeStandaloneMmAcpiTimerLib.c > > b/PcAtChipsetPkg/Library/AcpiTimerLib/DxeStandaloneMmAcpiTimerLib.c > > index 16ac48938f..41d2af7d55 100644 > > --- a/PcAtChipsetPkg/Library/AcpiTimerLib/DxeStandaloneMmAcpiTimerLib.c > > +++ > > b/PcAtChipsetPkg/Library/AcpiTimerLib/DxeStandaloneMmAcpiTimerLib.c > > @@ -1,7 +1,7 @@ > > /** @file > > ACPI Timer implements one instance of Timer Library. > > > > - Copyright (c) 2013 - 2018, Intel Corporation. All rights reserved. > > + Copyright (c) 2013 - 2023, Intel Corporation. All rights reserved. > > SPDX-License-Identifier: BSD-2-Clause-Patent > > > > **/ > > @@ -51,7 +51,7 @@ InternalCalculateTscFrequency ( > > // > > // Cached performance counter frequency > > // > > -UINT64 mPerformanceCounterFrequency =3D 0; > > +STATIC UINT64 mPerformanceCounterFrequency =3D 0; > > > > /** > > Internal function to retrieves the 64-bit frequency in Hz. > > -- > > 2.39.2.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 (#111966): https://edk2.groups.io/g/devel/message/111966 Mute This Topic: https://groups.io/mt/102907651/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/leave/12367111/7686176/19134562= 12/xyzzy [rebecca@openfw.io] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-