From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from EUR05-VI1-obe.outbound.protection.outlook.com (EUR05-VI1-obe.outbound.protection.outlook.com [40.107.21.79]) by mx.groups.io with SMTP id smtpd.web12.5581.1601673272804650587 for ; Fri, 02 Oct 2020 14:14:33 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=YX6vK9sa; spf=pass (domain: arm.com, ip: 40.107.21.79, mailfrom: sami.mujawar@arm.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=RdWWG2WYj3y2Ie6qVuYl2rdrZvGGAkfaKh4o65VLJjw=; b=YX6vK9sarYRwphfVh4cErBGSrah8MGsOxGIWmDkUT4rUuPjwok3iUBW0tlX+XaAdTsF8ewsaEKSmoSs+JpVq3CXYqDh+lCLM6E79/x0E1TbWhoMNf2hyN1mn7w0p+sffVc4LsKstnFujklroKSFAr5AV0IjtyeiPjz6jRXs2wDo= Received: from AM6PR08CA0017.eurprd08.prod.outlook.com (2603:10a6:20b:b2::29) by VI1PR0801MB1935.eurprd08.prod.outlook.com (2603:10a6:800:87::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3433.32; Fri, 2 Oct 2020 21:14:27 +0000 Received: from VE1EUR03FT030.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:b2:cafe::1) by AM6PR08CA0017.outlook.office365.com (2603:10a6:20b:b2::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3433.36 via Frontend Transport; Fri, 2 Oct 2020 21:14:27 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; edk2.groups.io; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;edk2.groups.io; dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by VE1EUR03FT030.mail.protection.outlook.com (10.152.18.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3433.34 via Frontend Transport; Fri, 2 Oct 2020 21:14:27 +0000 Received: ("Tessian outbound a0bffebca527:v64"); Fri, 02 Oct 2020 21:14:27 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: a30b65e8c64cf590 X-CR-MTA-TID: 64aa7808 Received: from e032ac99c5fa.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 5DA91D3D-6CEE-498A-9AB0-91BB1D1248FE.1; Fri, 02 Oct 2020 21:14:21 +0000 Received: from EUR05-AM6-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id e032ac99c5fa.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Fri, 02 Oct 2020 21:14:21 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JpvqPOy1Sro/kY85yKvmTPT79Urkxjm/poLldF1N3Ocq2yb0/mQnqhdV7pGU43BG618C5v+Mj/7Q2P7TirfAiRXCcRgFfOUZUU0fqekJ+J61T9CZ/CIDJHMTgulqLzZpY7a5nE1c2Xqqn6s7B6IkcdLI8zJJ2D74pzdewExd7wa14jfR9ggrMnWEp96eC1byBfRJWkxQfPmF7TIt4MPPKsJ1mxiVwBM+CAOPEar8KYJqFhtwexfouvpJ2i+kgRqtKm4j3kFA/BRGYQRpXn1FRxdYj2lsjBejnMdpL1bhneIKAO6sJxJapRuLiuFq7rX3OJglPy4nE6OV9cm05q4I7w== 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-SenderADCheck; bh=RdWWG2WYj3y2Ie6qVuYl2rdrZvGGAkfaKh4o65VLJjw=; b=gxZ57kGsRXnvKg1E3eZCaDP2R3v0o97TieV4NRGPc4+t6rmFAqvQ3DNwUyDa6CavwMGlE9hiJOqqJAL4u5IzeY4mNIrW6R9WtZa0QrZLkwv/84b6MStJ57s6nrFDC4kGIe3GvDZ8LcfVma0QUSbRDM1TA+1I+AgvV02evFNQ8R1PSzL3bkRAa3bfgqzx6iL2lw3OCsC+D8TAMBIH0OTCebyhzK4d9UBSsvIGoy/1WN+V6Y057X2RLV0U3Q+w4QQurtoiGXdUNaS9zLFukWA5Ebknt6s0FllvrLlRZYoSV6JrzOtHsFn8jiX0gBat8YvWL2LE1zMSJaJ6qznQCynCCA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 40.67.248.234) smtp.rcpttodomain=edk2.groups.io smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=RdWWG2WYj3y2Ie6qVuYl2rdrZvGGAkfaKh4o65VLJjw=; b=YX6vK9sarYRwphfVh4cErBGSrah8MGsOxGIWmDkUT4rUuPjwok3iUBW0tlX+XaAdTsF8ewsaEKSmoSs+JpVq3CXYqDh+lCLM6E79/x0E1TbWhoMNf2hyN1mn7w0p+sffVc4LsKstnFujklroKSFAr5AV0IjtyeiPjz6jRXs2wDo= Received: from AM3PR05CA0118.eurprd05.prod.outlook.com (2603:10a6:207:2::20) by DB6PR0801MB2086.eurprd08.prod.outlook.com (2603:10a6:4:7a::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3433.32; Fri, 2 Oct 2020 21:14:20 +0000 Received: from AM5EUR03FT049.eop-EUR03.prod.protection.outlook.com (2603:10a6:207:2:cafe::4c) by AM3PR05CA0118.outlook.office365.com (2603:10a6:207:2::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3433.36 via Frontend Transport; Fri, 2 Oct 2020 21:14:20 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234) smtp.mailfrom=arm.com; edk2.groups.io; dkim=none (message not signed) header.d=none;edk2.groups.io; dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 40.67.248.234 as permitted sender) receiver=protection.outlook.com; client-ip=40.67.248.234; helo=nebula.arm.com; Received: from nebula.arm.com (40.67.248.234) by AM5EUR03FT049.mail.protection.outlook.com (10.152.17.130) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.3433.34 via Frontend Transport; Fri, 2 Oct 2020 21:14:20 +0000 Received: from AZ-NEU-EX04.Arm.com (10.251.24.32) by AZ-NEU-EX03.Arm.com (10.251.24.31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2044.4; Fri, 2 Oct 2020 21:14:17 +0000 Received: from E107187.Arm.com (10.57.53.44) by mail.arm.com (10.251.24.32) with Microsoft SMTP Server id 15.1.2044.4 via Frontend Transport; Fri, 2 Oct 2020 21:14:17 +0000 From: "Sami Mujawar" To: CC: Sami Mujawar , , , , , , , , , , Subject: [PATCH v5 07/15] MdeModulePkg: Fix constructor invocation ordering Date: Fri, 2 Oct 2020 22:14:01 +0100 Message-ID: <20201002211409.43888-8-sami.mujawar@arm.com> X-Mailer: git-send-email 2.11.0.windows.3 In-Reply-To: <20201002211409.43888-1-sami.mujawar@arm.com> References: <20201002211409.43888-1-sami.mujawar@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-Office365-Filtering-HT: Tenant X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 9115111f-a18f-4a9c-bbed-08d867182514 X-MS-TrafficTypeDiagnostic: DB6PR0801MB2086:|VI1PR0801MB1935: X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Oob-TLC-OOBClassifiers: OLM:7219;OLM:7219; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: +eB9Eq1H1PzszO64J31HXPsQdb+VFuvQWrHH+x7pRE3zKt99neqpEE6X6F+OYxlLR1p0fayfijMRvs+vWJOzmKCT5CD1q1sCrmTEMTqBnF1TDZw0h/y1amo/twgelRPVOaPSWVr14W12NAqxr3qyHrbtqghnHh6+dSa1mcwvlPU6iGzXk7dzmRZ1cQpYgEnQhrRo8lbseXiRx6DvnfHi9vwpDRT4VZFDUwuO3Gv/z9y0V7/1EQz2v4zbzFBYtenAISPEMSO7OjJs7OsQrnJD597j6r31YOQihJ5TmZClFqggBgK145lr0iRizBy2TWCKEZu9qDMVqBuYWAsfKDjLeGobAVEWogSjOrOXXrnRYZ0w3KqWU8CuTEtSOl5smA35WlWwlS1dxrXwyFfPx4fwqg07drTdosBB32d/CZiJ7H7eKF5GEg0CsCvlpoCw3ZVMNiXVKSwR80OSkyly3GBHGn9HpO/ApSlVp95i9YJgPjA= X-Forefront-Antispam-Report-Untrusted: CIP:40.67.248.234;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:nebula.arm.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(4636009)(346002)(39860400002)(136003)(376002)(396003)(46966005)(83080400001)(81166007)(5660300002)(4326008)(82740400003)(26005)(316002)(1076003)(19627235002)(6666004)(54906003)(7696005)(2616005)(86362001)(478600001)(83380400001)(8936002)(70586007)(47076004)(966005)(70206006)(36756003)(6916009)(426003)(336012)(82310400003)(8676002)(186003)(2906002)(356005)(44832011);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR0801MB2086 Return-Path: Sami.Mujawar@arm.com X-MS-Exchange-Transport-CrossTenantHeadersStripped: VE1EUR03FT030.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: 357ab172-6107-44a0-4a44-08d8671820e0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: HJ6ccriBU7CNqNT/IXa5vaVV5VrVSKZZLAS55JQ5lqzppjXZOCZkYPwBXNe15wKLJaBgIrYTLdQHMXcF2j/2Q038J8hTOvhiekw0x6lrOms4ndOZAtS0DB8oZsfQdn875ZgUwmEw3whh2XrLnUrdkP1P/scdv7sOjydzDvYI44YKWL6Xn20OlSjO1VsYq3B+MnaUkw4P8qD771KRrtyODsngcyb3XYpp7kxeezxRQ9r+3jAk4UhMA0m76Yg8eabUtILek0FO4ehoe42mm8ynZiLeeifoYfHkNeJZwm1huSsciGcTf/jSoMhav8L9J/V1/kDLJUBMVS7LcdNh5rjg2Z6ohBwiPDeGUQZZaZxZIjXGIk+Z8AQoRBPaWnpHiXhQehdkdW91+yRNTqCXAl/xO7Gh0Ni/l8SlZ8Nsyc3nuB86EWcy/GmJu0FUHc9NS4KcS5M9IVTnJcpl92LwL4ZmszUYreQNggGtbzwx5J0ko9E= X-Forefront-Antispam-Report: CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(4636009)(39860400002)(376002)(396003)(346002)(136003)(46966005)(4326008)(8936002)(336012)(316002)(44832011)(82310400003)(966005)(83380400001)(54906003)(6916009)(2616005)(83080400001)(47076004)(81166007)(70586007)(2906002)(86362001)(8676002)(186003)(7696005)(26005)(36756003)(478600001)(70206006)(6666004)(5660300002)(1076003)(36906005)(82740400003)(426003)(19627235002);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Oct 2020 21:14:27.0807 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 9115111f-a18f-4a9c-bbed-08d867182514 X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-AuthSource: VE1EUR03FT030.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0801MB1935 Content-Type: text/plain The BaseSerialPortLib16550 library does not implement a constructor. This prevents the correct constructor invocation order for dependent libraries. e.g. A PlatformHookLib (for the Serial Port) may have a dependency on retrieving data from a Hob. A Hob library implementation may configure its initial state in the HobLib constructor. Since BaseSerialPortLib16550 does not implement a constructor, the Basetools do not resolve the correct order for constructor invocation. To fix this, add an empty constructor to the serial port library BaseSerialPortLib16550. Signed-off-by: Sami Mujawar Acked-by: Ard Biesheuvel --- Notes: v5: - Fix function documentation to match doxygen style. [Sami] Ref: https://edk2.groups.io/g/devel/message/62148 v4: - No code change, resending patch with v4 series. [Sami] Ref: https://edk2.groups.io/g/devel/topic/75081484 MdeModulePkg/Library/BaseSerialPortLib16550/BaseSerialPortLib16550.c | 17 +++++++++++++++++ MdeModulePkg/Library/BaseSerialPortLib16550/BaseSerialPortLib16550.inf | 3 +++ 2 files changed, 20 insertions(+) diff --git a/MdeModulePkg/Library/BaseSerialPortLib16550/BaseSerialPortLib16550.c b/MdeModulePkg/Library/BaseSerialPortLib16550/BaseSerialPortLib16550.c index 9cb50dd80d5634ab2aa6d68bf5ca7fb891463eef..f10b5894663a979873427cffa84a37b3064c623e 100644 --- a/MdeModulePkg/Library/BaseSerialPortLib16550/BaseSerialPortLib16550.c +++ b/MdeModulePkg/Library/BaseSerialPortLib16550/BaseSerialPortLib16550.c @@ -4,6 +4,7 @@ (C) Copyright 2014 Hewlett-Packard Development Company, L.P.
Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.
Copyright (c) 2018, AMD Incorporated. All rights reserved.
+ Copyright (c) 2020, ARM Limited. All rights reserved. SPDX-License-Identifier: BSD-2-Clause-Patent @@ -1102,3 +1103,19 @@ SerialPortSetAttributes ( return RETURN_SUCCESS; } +/** Base Serial Port 16550 Library Constructor + + @retval RETURN_SUCCESS Success. +**/ +EFI_STATUS +EFIAPI +BaseSerialPortLib16550 ( + VOID + ) +{ + // Nothing to do here. This constructor is added to + // enable the chain of constructor invocation for + // dependent libraries. + return RETURN_SUCCESS; +} + diff --git a/MdeModulePkg/Library/BaseSerialPortLib16550/BaseSerialPortLib16550.inf b/MdeModulePkg/Library/BaseSerialPortLib16550/BaseSerialPortLib16550.inf index 8b4ae3f1d4ee1e2e9a8b81eab4c900541ce8cfb6..92b7a8b7896a305d2ce22589f8a9593618d37bb7 100644 --- a/MdeModulePkg/Library/BaseSerialPortLib16550/BaseSerialPortLib16550.inf +++ b/MdeModulePkg/Library/BaseSerialPortLib16550/BaseSerialPortLib16550.inf @@ -2,6 +2,8 @@ # SerialPortLib instance for 16550 UART. # # Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.
+# Copyright (c) 2020, ARM Limited. All rights reserved. +# # SPDX-License-Identifier: BSD-2-Clause-Patent # ## @@ -14,6 +16,7 @@ [Defines] MODULE_TYPE = BASE VERSION_STRING = 1.1 LIBRARY_CLASS = SerialPortLib + CONSTRUCTOR = BaseSerialPortLib16550 [Packages] MdePkg/MdePkg.dec -- 'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)'