From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from EUR03-VE1-obe.outbound.protection.outlook.com (EUR03-VE1-obe.outbound.protection.outlook.com [40.107.5.52]) by mx.groups.io with SMTP id smtpd.web12.13752.1593005731005744500 for ; Wed, 24 Jun 2020 06:35:31 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=XilpclkQ; spf=pass (domain: arm.com, ip: 40.107.5.52, 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=shfiLEntyhtQBdaTQLq7G19vps6RckGkof8ca/pX6cs=; b=XilpclkQqsqBQktLbKa/LHT6WoXDp9oJ07KaGAkGIlWptUl3rG1kWVB5g0q4isS6Y95oskd9NCBNKSdCxKYy8e3KI+SA/wSOZUpODJzVftEda0GfezXDe9752C22G8J9X1yvTqTORHXf9GmUlxuF3TL++E6rLkYtSemK12vzr98= Received: from DB6PR0601CA0007.eurprd06.prod.outlook.com (2603:10a6:4:7b::17) by AM5PR0801MB1650.eurprd08.prod.outlook.com (2603:10a6:203:2f::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3109.22; Wed, 24 Jun 2020 13:35:27 +0000 Received: from DB5EUR03FT008.eop-EUR03.prod.protection.outlook.com (2603:10a6:4:7b:cafe::53) by DB6PR0601CA0007.outlook.office365.com (2603:10a6:4:7b::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3109.22 via Frontend Transport; Wed, 24 Jun 2020 13:35: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=bestguesspass 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 DB5EUR03FT008.mail.protection.outlook.com (10.152.20.98) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3109.22 via Frontend Transport; Wed, 24 Jun 2020 13:35:27 +0000 Received: ("Tessian outbound 8fb20e43acb7:v59"); Wed, 24 Jun 2020 13:35:27 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: d1f75e3d014cd5ed X-CR-MTA-TID: 64aa7808 Received: from 0f71cbf6d0ff.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id DAEC747A-007B-470F-AE79-66A10E7F733D.1; Wed, 24 Jun 2020 13:35:22 +0000 Received: from EUR05-VI1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 0f71cbf6d0ff.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Wed, 24 Jun 2020 13:35:22 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=g0E4mZ8Y1buiR++GhfNmGmrPglo3ejKI7wWsYQcNuuMyXdAYSrReJL8ApZw3nTdnCNtgdWqS5US52eNKdIJYBnsLXzKVfA7sQnqXMT/Zw35o1QMCqMsXWU6hQ0/VPZUmn8tper+r2TmPcqe2ckCOraYNXXKJfjIxoURPee4M6yuQOyGSSpfJACuSKsy9PpPJiDvEEfwisDhLGAAGpU74lEDJ7mq8H8kB05Q6LsJg86VRobN2isRbMYz0wsjoSzZhAArX6Hvg5xm5uAzIZ9+I3U9EKcR0h5f3taOZvwxIemXgDgWsYXjIHPaT+5C0KlhTnohjV+fuQYIAqIWX9ZAwSw== 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=shfiLEntyhtQBdaTQLq7G19vps6RckGkof8ca/pX6cs=; b=jf0c0mAXFpI5T4DqVcEeYi6a3roTnNZ5H5sgcNUMhQMmsXnC++edZpKxiLPjWLED4giNYxlpBgjyEoNxrzjh0TkD6kpSyXSoaZO+odBcUKKtBLMI20mz3sNpuvgRRZ1BVjLfqWCMApfUxFYNLHk7qOQdAGWpSBjhqZ4rRX6LLoi7WuTPscWLg07hv7zhbmsz7tjQqfhA5r+kTUu4df/o3+5TkJsDKBZ5VBAGDf83V85WpkMaH838zN0sUP5ZAW1cATLu8P3T6/qH9I9RW+CXTbIw1wdrxm0LygfJlnOEt1e4ShyeEhedNUK/pSujGeP33erTkbIrmRvVZvqvtBP00A== 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=bestguesspass 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=shfiLEntyhtQBdaTQLq7G19vps6RckGkof8ca/pX6cs=; b=XilpclkQqsqBQktLbKa/LHT6WoXDp9oJ07KaGAkGIlWptUl3rG1kWVB5g0q4isS6Y95oskd9NCBNKSdCxKYy8e3KI+SA/wSOZUpODJzVftEda0GfezXDe9752C22G8J9X1yvTqTORHXf9GmUlxuF3TL++E6rLkYtSemK12vzr98= Received: from AM6PR04CA0068.eurprd04.prod.outlook.com (2603:10a6:20b:f0::45) by AM4PR08MB2642.eurprd08.prod.outlook.com (2603:10a6:205:e::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3109.22; Wed, 24 Jun 2020 13:35:20 +0000 Received: from AM5EUR03FT042.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:f0:cafe::51) by AM6PR04CA0068.outlook.office365.com (2603:10a6:20b:f0::45) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3109.27 via Frontend Transport; Wed, 24 Jun 2020 13:35:19 +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=bestguesspass 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 AM5EUR03FT042.mail.protection.outlook.com (10.152.17.168) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.3131.20 via Frontend Transport; Wed, 24 Jun 2020 13:35:19 +0000 Received: from AZ-NEU-EX03.Arm.com (10.251.24.31) 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.1415.2; Wed, 24 Jun 2020 13:35:09 +0000 Received: from E107187.Arm.com (10.57.22.181) by mail.arm.com (10.251.24.31) with Microsoft SMTP Server id 15.1.1415.2 via Frontend Transport; Wed, 24 Jun 2020 13:35:08 +0000 From: "Sami Mujawar" To: CC: Sami Mujawar , , , , , , , , , , Subject: [PATCH v3 08/15] MdeModulePkg: Fix constructor invocation ordering Date: Wed, 24 Jun 2020 14:34:51 +0100 Message-ID: <20200624133458.61920-9-sami.mujawar@arm.com> X-Mailer: git-send-email 2.11.0.windows.3 In-Reply-To: <20200624133458.61920-1-sami.mujawar@arm.com> References: <20200624133458.61920-1-sami.mujawar@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-Office365-Filtering-HT: Tenant 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;SFTY:;SFS:(4636009)(39860400002)(346002)(136003)(396003)(376002)(46966005)(8936002)(426003)(36756003)(47076004)(336012)(2616005)(8676002)(7696005)(44832011)(86362001)(54906003)(356005)(186003)(4326008)(316002)(26005)(5660300002)(478600001)(1076003)(81166007)(19627235002)(82740400003)(70206006)(70586007)(6916009)(2906002)(82310400002)(83380400001)(6666004);DIR:OUT;SFP:1101; X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 52e2480d-5a48-45af-97a3-08d8184374e6 X-MS-TrafficTypeDiagnostic: AM4PR08MB2642:|AM5PR0801MB1650: X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Oob-TLC-OOBClassifiers: OLM:7219;OLM:7219; X-Forefront-PRVS: 0444EB1997 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: 4QuA6U1oOSq1kyzq9nauq+qkRTnQiuTSAZD1NT9mNWzFTJQBWGSEq0g1VQS3ye0tosQ3npBXiMuqXwo/DYiKuwKeh/r9RxluCVQj907PJsBrtyf6zgCA7DlSrs9BZ+VW+zNT+16pGLEww4QrNJjFZmoQe+KGoHNZu9gSitVck563zqJN6qtNHN1zs36WfMxa4LBKINOEIsRJSGHps2FC8xEFwBuQCvhNwMAMCj0u0nWCZmvB1G71dqHQBZxT+G5BNfHP6PO8p0YWUj5exopPAYNEt/SXpNHXV96K3dIA/E2odFPKitQT64gb3EuR3gyKOfK4j4qC+23LPuF7I6wVQUMoFfLrjDlAWM+fjtWobThD8omMheh4+sAs2PAdH6ekB3aAWpt5mHsGlc8oLIpe0g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM4PR08MB2642 Return-Path: Sami.Mujawar@arm.com X-MS-Exchange-Transport-CrossTenantHeadersStripped: DB5EUR03FT008.eop-EUR03.prod.protection.outlook.com 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;SFTY:;SFS:(4636009)(39860400002)(136003)(396003)(376002)(346002)(46966005)(316002)(336012)(81166007)(82310400002)(2906002)(478600001)(426003)(6666004)(47076004)(2616005)(186003)(44832011)(26005)(1076003)(82740400003)(4326008)(8936002)(83380400001)(8676002)(5660300002)(70206006)(7696005)(19627235002)(70586007)(86362001)(36756003)(54906003)(6916009);DIR:OUT;SFP:1101; X-MS-Office365-Filtering-Correlation-Id-Prvs: 5a68ae7a-c016-4a3b-2be1-08d818437056 X-Forefront-PRVS: 0444EB1997 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: rcnaNhDIU7peH2YiYUWs3oQoNG8RaSdfd/kUcBOmmDnJDrCgSE4Bmjr89uCTUEqvQhfjxnUqL5tjSlmKmHezOuOe/WaW3kmO/30TlO83ItGIpdsSvMh5npsUNMO+Z3z8RHdkXcXrL4HtlmOC1gUXJN8oba7C8StKtnMNwuWEM+jSoFo06IPF/qDRZC2YSxH6dp5obUWjOiINxJxahhkrG/Aaev58dfym4sc66QoH5w6krrE+v2713VaHzWM1KR0b2GyhzSlcc52U7ZCHy8kGGkUK5Rn9C18DNGVXB6YiPmCfjEULFSZjw9w0lrHl40sRWmIZwDvnSrmuwspel2v1Pvk6A3ys1yexh4WWxRxh4bRNm/v9qQ3buFFN4zYLlE0drskmTMxY2OK7eF9j88LNsQ== X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Jun 2020 13:35:27.5989 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 52e2480d-5a48-45af-97a3-08d8184374e6 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-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM5PR0801MB1650 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 --- 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..0fd1382ee83c9de09d8250830bd9569056fcee2f 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)'