From patchwork Tue Apr 19 07:49:32 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 66080 Delivered-To: patch@linaro.org Received: by 10.140.93.198 with SMTP id d64csp1705635qge; Tue, 19 Apr 2016 00:51:20 -0700 (PDT) X-Received: by 10.140.40.231 with SMTP id x94mr1573961qgx.83.1461052276101; Tue, 19 Apr 2016 00:51:16 -0700 (PDT) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id r85si39770830qki.30.2016.04.19.00.51.15; Tue, 19 Apr 2016 00:51:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linaro-uefi-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) client-ip=54.225.227.206; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linaro-uefi-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) smtp.mailfrom=linaro-uefi-bounces@lists.linaro.org; dmarc=pass (p=NONE dis=NONE) header.from=linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id A8B6B684AF; Tue, 19 Apr 2016 07:51:15 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252 X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from [127.0.0.1] (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id 6899761617; Tue, 19 Apr 2016 07:51:09 +0000 (UTC) X-Original-To: linaro-uefi@lists.linaro.org Delivered-To: linaro-uefi@lists.linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 2859367517; Tue, 19 Apr 2016 07:51:06 +0000 (UTC) Received: from mail-wm0-f41.google.com (mail-wm0-f41.google.com [74.125.82.41]) by lists.linaro.org (Postfix) with ESMTPS id 34DBA6837E for ; Tue, 19 Apr 2016 07:49:38 +0000 (UTC) Received: by mail-wm0-f41.google.com with SMTP id u206so14590137wme.1 for ; Tue, 19 Apr 2016 00:49:38 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=C5tV/eaiZbHJjrqWRwx0NVHRLW71+o1S44qHgoK0G8Y=; b=mUyqbVpnkAOIq55G1U4K0LHfEjKHAl+SX2f1m5D3oc60Ozq06xIg4PGzP07EHr7ehJ sXOOfYJldKpzrbY6Jn0oMe13LQ9vzxrKMXmrgtlvmJV9ypm+acHI/PHjXjtxCpUjoiqL vVwDr6yYbahdgrmEV1yazYaJCWrA1Dy2VAxhNVaEU2WwbjK1hMxfLGT5ZBgFAO2agz0l hQz5k+KphghY9DnxKpP1m0VD6kvlOanGi6fXCWtKh4uP2FMfjKbLuf1h+nUz9e5uq/Ly T29ygPTg6GC38/8iaikzXawdvUvaTk96ITzbMQ2HhC7Bq06Ydq8ul8kuyz0jIXvmXouI IpoA== X-Gm-Message-State: AOPr4FURIc8K/HVMkKXIO5Zm9upjMYibDwD0tmM1HuG83nn3r9Y0sjfwXDfz90/V+pGNXYuWogs= X-Received: by 10.28.169.196 with SMTP id s187mr23535037wme.63.1461052177203; Tue, 19 Apr 2016 00:49:37 -0700 (PDT) Received: from localhost.localdomain ([195.55.142.58]) by smtp.gmail.com with ESMTPSA id b2sm2834125wmb.9.2016.04.19.00.49.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 19 Apr 2016 00:49:36 -0700 (PDT) From: Ard Biesheuvel To: linaro-uefi@lists.linaro.org, leif.lindholm@linaro.org, ryan.harkin@linaro.org Date: Tue, 19 Apr 2016 09:49:32 +0200 Message-Id: <1461052172-17196-1-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.5.0 Subject: [Linaro-uefi] [PATCH] Platforms/ARM: get rid of A PRIORI declaration for Dxe/Pcd.inf X-BeenThere: linaro-uefi@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: linaro-uefi-bounces@lists.linaro.org Sender: "Linaro-uefi" APRIORI declarations are evil. They force a driver to be dispatched before any other drivers, while completely ignoring normal precedence rules or protocol dependencies. In this particular case, the DXE version of Pcd.inf is loaded a priori to work around the problem that the default PcdLib resolution introduces a a protocol dependency on gPcdProtocolGuid, which provides dynamic PCD handling for other drivers, and is implemented by Pcd.inf. Since Pcd.inf depends on PcdLib as well, it can never be dispatched in the ordinary way if it inherits the default PcdLib resolution (since that will make it depend on itself), and so it must be made to depend on the Null implementation of PcdLib explicitly. So add this explicit override, and drop the A PRIORI declarations. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel Tested-by: Ryan Harkin --- Note that the same reasoning applies to the PEI version of Pcd.inf, but we don't normally use that, and in fact, it already has a similar Null library class override in ArmVExpress-FVP-AArch64.dsc Platforms/ARM/Juno/ArmJuno.fdf | 4 ---- Platforms/ARM/VExpress/ArmVExpress-FVP-AArch64.fdf | 4 ---- Platforms/ARM/VExpress/ArmVExpress.dsc.inc | 5 ++++- 3 files changed, 4 insertions(+), 9 deletions(-) diff --git a/Platforms/ARM/Juno/ArmJuno.fdf b/Platforms/ARM/Juno/ArmJuno.fdf index a05151086910..3983c20de8e0 100644 --- a/Platforms/ARM/Juno/ArmJuno.fdf +++ b/Platforms/ARM/Juno/ArmJuno.fdf @@ -86,10 +86,6 @@ READ_LOCK_CAP = TRUE READ_LOCK_STATUS = TRUE FvNameGuid = B73FE497-B92E-416e-8326-45AD0D270092 - APRIORI DXE { - INF MdeModulePkg/Universal/PCD/Dxe/Pcd.inf - } - INF MdeModulePkg/Core/Dxe/DxeMain.inf INF MdeModulePkg/Universal/PCD/Dxe/Pcd.inf diff --git a/Platforms/ARM/VExpress/ArmVExpress-FVP-AArch64.fdf b/Platforms/ARM/VExpress/ArmVExpress-FVP-AArch64.fdf index 79c074c834d8..3bcdb1ca43f1 100644 --- a/Platforms/ARM/VExpress/ArmVExpress-FVP-AArch64.fdf +++ b/Platforms/ARM/VExpress/ArmVExpress-FVP-AArch64.fdf @@ -73,10 +73,6 @@ READ_LOCK_CAP = TRUE READ_LOCK_STATUS = TRUE FvNameGuid = 87940482-fc81-41c3-87e6-399cf85ac8a0 - APRIORI DXE { - INF MdeModulePkg/Universal/PCD/Dxe/Pcd.inf - } - INF MdeModulePkg/Core/Dxe/DxeMain.inf INF MdeModulePkg/Universal/PCD/Dxe/Pcd.inf diff --git a/Platforms/ARM/VExpress/ArmVExpress.dsc.inc b/Platforms/ARM/VExpress/ArmVExpress.dsc.inc index 9bb45c82a5e9..d898aef490f9 100644 --- a/Platforms/ARM/VExpress/ArmVExpress.dsc.inc +++ b/Platforms/ARM/VExpress/ArmVExpress.dsc.inc @@ -443,7 +443,10 @@ !endif [Components.common] - MdeModulePkg/Universal/PCD/Dxe/Pcd.inf + MdeModulePkg/Universal/PCD/Dxe/Pcd.inf { + + PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf + } # Versatile Express FileSystem ArmPlatformPkg/FileSystem/BootMonFs/BootMonFs.inf