From nobody Mon Feb 9 08:56:47 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+75679+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+75679+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1622060732; cv=none; d=zohomail.com; s=zohoarc; b=XY6Y4e3KKxI5tWvcLvY80Onif2Rs2z82DDSNNvO8m8F3X8MIdHI1v87j2ueUArx1yKynEtnDtbL3l5DzicnN7qi+0s2UT8EeoSCOw+8sYKbj2bN/wvcx2p0upmrRJIwgsIDME+NlqTlhZ2z3+5LsFnxqMZtocfzzmjim+a3nZpM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1622060732; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=ZTE2+mg3uRQMayI6sQ/aIZoxsB7DZuPrXCnusZKuqxQ=; b=hZxvN6G1qpqkzcos1DeFRF0e2r8weR+vkOwr61eM9tVIjyQ7kyuzd0zjNa6sY5xbUwP/y+eBRq/y1OChjyeFmeSIZU7e0DuXQ8wYXLg56P5ZT9/EyhNJZd9uMmW63TUqnSQiRLXndGKC7j/IsllwqRuggj3QY5RI1ZGlNnH4WGk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+75679+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 162206073214820.688212990640636; Wed, 26 May 2021 13:25:32 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id g0KsYY1788612xrHD16M3E9K; Wed, 26 May 2021 13:25:31 -0700 X-Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.groups.io with SMTP id smtpd.web11.2888.1622060726029045450 for ; Wed, 26 May 2021 13:25:26 -0700 X-Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-473-QJzUSLphOWy7v5tSMTliRQ-1; Wed, 26 May 2021 16:25:22 -0400 X-MC-Unique: QJzUSLphOWy7v5tSMTliRQ-1 X-Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id DB0536415F; Wed, 26 May 2021 20:25:21 +0000 (UTC) X-Received: from lacos-laptop-7.usersys.redhat.com (ovpn-114-61.ams2.redhat.com [10.36.114.61]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9BB1810023AF; Wed, 26 May 2021 20:25:20 +0000 (UTC) From: "Laszlo Ersek" To: devel@edk2.groups.io Cc: Ard Biesheuvel , Jordan Justen , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [edk2-devel] [PATCH 10/43] OvmfPkg/AcpiPlatformDxe: consolidate #includes and [LibraryClasses] Date: Wed, 26 May 2021 22:14:13 +0200 Message-Id: <20210526201446.12554-11-lersek@redhat.com> In-Reply-To: <20210526201446.12554-1-lersek@redhat.com> References: <20210526201446.12554-1-lersek@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Precedence: Bulk List-Unsubscribe: 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,lersek@redhat.com X-Gm-Message-State: dHnkkg6gi1PAznCwB16e9UbGx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1622060731; bh=ZTE2+mg3uRQMayI6sQ/aIZoxsB7DZuPrXCnusZKuqxQ=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=ZNsfKOGSmkkcxD2VIAAZ4VSabxpaH2J5lSpkw2zZyPIeQBr03fSy9WaFBuIpUBbpt7k 31K+HPFk1g878NwQpKsxhTDuSjI4lGAOyJKuwwd7MAbe+BKMSiXHV2yay7nrJSQSPr2g3 ux9TRiZuDvgOy8rSxVf9V4M3RX5k/VgctiE= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" - #include only such public headers in "AcpiPlatform.h" that are required by the function declarations and type definitions introduced in "AcpiPlatform.h". Don't use "AcpiPlatform.h" as a convenience #include file. - In every file, list every necessary public #include individually, with an example identifier that's actually consumed. - Remove unnecessary lib classes, add unlisted lib classes. - Remove unnecessary #include directives, add unlisted #include directives. Cc: Ard Biesheuvel Cc: Jordan Justen Cc: Philippe Mathieu-Daud=C3=A9 Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3D2122 Signed-off-by: Laszlo Ersek Reviewed-by: Philippe Mathieu-Daude --- OvmfPkg/AcpiPlatformDxe/AcpiPlatformDxe.inf | 1 - OvmfPkg/AcpiPlatformDxe/QemuFwCfgAcpiPlatformDxe.inf | 2 ++ OvmfPkg/AcpiPlatformDxe/AcpiPlatform.h | 12 ++---------- OvmfPkg/AcpiPlatformDxe/AcpiPlatform.c | 5 +++++ OvmfPkg/AcpiPlatformDxe/BootScript.c | 7 ++++--- OvmfPkg/AcpiPlatformDxe/EntryPoint.c | 6 +++++- OvmfPkg/AcpiPlatformDxe/PciDecoding.c | 4 +++- OvmfPkg/AcpiPlatformDxe/Qemu.c | 14 +++++++------- OvmfPkg/AcpiPlatformDxe/QemuFwCfgAcpi.c | 19 ++++++++++------= --- OvmfPkg/AcpiPlatformDxe/Xen.c | 4 +++- 10 files changed, 41 insertions(+), 33 deletions(-) diff --git a/OvmfPkg/AcpiPlatformDxe/AcpiPlatformDxe.inf b/OvmfPkg/AcpiPlat= formDxe/AcpiPlatformDxe.inf index 3daeb2ee42d2..77607298cbea 100644 --- a/OvmfPkg/AcpiPlatformDxe/AcpiPlatformDxe.inf +++ b/OvmfPkg/AcpiPlatformDxe/AcpiPlatformDxe.inf @@ -45,13 +45,12 @@ [LibraryClasses] OrderedCollectionLib PcdLib QemuFwCfgLib QemuFwCfgS3Lib UefiBootServicesTableLib UefiDriverEntryPoint - UefiLib XenPlatformLib =20 [Protocols] gEfiAcpiTableProtocolGuid # PROTOCOL ALWAYS_CONSUMED gEfiFirmwareVolume2ProtocolGuid # PROTOCOL SOMETIMES_CONSU= MED gEfiPciIoProtocolGuid # PROTOCOL SOMETIMES_CONSU= MED diff --git a/OvmfPkg/AcpiPlatformDxe/QemuFwCfgAcpiPlatformDxe.inf b/OvmfPkg= /AcpiPlatformDxe/QemuFwCfgAcpiPlatformDxe.inf index 48c8269a8b6f..dac25d1505be 100644 --- a/OvmfPkg/AcpiPlatformDxe/QemuFwCfgAcpiPlatformDxe.inf +++ b/OvmfPkg/AcpiPlatformDxe/QemuFwCfgAcpiPlatformDxe.inf @@ -32,15 +32,17 @@ [Packages] MdeModulePkg/MdeModulePkg.dec MdePkg/MdePkg.dec OvmfPkg/OvmfPkg.dec =20 [LibraryClasses] BaseLib + BaseMemoryLib DebugLib MemoryAllocationLib OrderedCollectionLib + PcdLib QemuFwCfgLib QemuFwCfgS3Lib UefiBootServicesTableLib UefiDriverEntryPoint =20 [Protocols] diff --git a/OvmfPkg/AcpiPlatformDxe/AcpiPlatform.h b/OvmfPkg/AcpiPlatformD= xe/AcpiPlatform.h index 511a30782f6d..d98b79baab40 100644 --- a/OvmfPkg/AcpiPlatformDxe/AcpiPlatform.h +++ b/OvmfPkg/AcpiPlatformDxe/AcpiPlatform.h @@ -6,22 +6,14 @@ =20 **/ =20 #ifndef ACPI_PLATFORM_H_ #define ACPI_PLATFORM_H_ =20 -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include // EFI_ACPI_TABLE_PROTOCOL +#include // EFI_PCI_IO_PROTOCOL =20 typedef struct { EFI_PCI_IO_PROTOCOL *PciIo; UINT64 PciAttributes; } ORIGINAL_ATTRIBUTES; =20 diff --git a/OvmfPkg/AcpiPlatformDxe/AcpiPlatform.c b/OvmfPkg/AcpiPlatformD= xe/AcpiPlatform.c index f872d91aea72..efbbfab89d2b 100644 --- a/OvmfPkg/AcpiPlatformDxe/AcpiPlatform.c +++ b/OvmfPkg/AcpiPlatformDxe/AcpiPlatform.c @@ -3,12 +3,17 @@ =20 Copyright (c) 2008 - 2012, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent =20 **/ =20 +#include // ASSERT_EFI_ERROR() +#include // gBS +#include // XenDetected() +#include // gEfiFirmwareVolume2Protoc= ol... + #include "AcpiPlatform.h" =20 EFI_STATUS EFIAPI InstallAcpiTable ( IN EFI_ACPI_TABLE_PROTOCOL *AcpiProtocol, diff --git a/OvmfPkg/AcpiPlatformDxe/BootScript.c b/OvmfPkg/AcpiPlatformDxe= /BootScript.c index 7b1b9586da41..f2d1089e91ce 100644 --- a/OvmfPkg/AcpiPlatformDxe/BootScript.c +++ b/OvmfPkg/AcpiPlatformDxe/BootScript.c @@ -4,15 +4,16 @@ =20 Copyright (C) 2017, Red Hat, Inc. =20 SPDX-License-Identifier: BSD-2-Clause-Patent **/ =20 -#include -#include -#include +#include // CpuDeadLoop() +#include // DEBUG() +#include // AllocatePool() +#include // QemuFwCfgS3ScriptSkipBytes() =20 #include "AcpiPlatform.h" =20 =20 // // Condensed structure for capturing the fw_cfg operations -- select, skip, diff --git a/OvmfPkg/AcpiPlatformDxe/EntryPoint.c b/OvmfPkg/AcpiPlatformDxe= /EntryPoint.c index fb07ed85373d..bb5fe82c18d4 100644 --- a/OvmfPkg/AcpiPlatformDxe/EntryPoint.c +++ b/OvmfPkg/AcpiPlatformDxe/EntryPoint.c @@ -4,13 +4,17 @@ Copyright (C) 2015, Red Hat, Inc. Copyright (c) 2008 - 2015, Intel Corporation. All rights reserved.
=20 SPDX-License-Identifier: BSD-2-Clause-Patent **/ =20 -#include +#include // gRootBridgesConnectedE= ve... +#include // DEBUG() +#include // PcdGetBool() +#include // gBS +#include // EFI_ACPI_TABLE_PROTOCOL =20 #include "AcpiPlatform.h" =20 STATIC EFI_ACPI_TABLE_PROTOCOL * FindAcpiTableProtocol ( diff --git a/OvmfPkg/AcpiPlatformDxe/PciDecoding.c b/OvmfPkg/AcpiPlatformDx= e/PciDecoding.c index 73894106c9ec..6ba4c936ad8e 100644 --- a/OvmfPkg/AcpiPlatformDxe/PciDecoding.c +++ b/OvmfPkg/AcpiPlatformDxe/PciDecoding.c @@ -4,13 +4,15 @@ =20 Copyright (C) 2016, Red Hat, Inc. =20 SPDX-License-Identifier: BSD-2-Clause-Patent **/ =20 -#include +#include // DEBUG() +#include // AllocatePool() +#include // gBS =20 #include "AcpiPlatform.h" =20 =20 /** Collect all PciIo protocol instances in the system. Save their original diff --git a/OvmfPkg/AcpiPlatformDxe/Qemu.c b/OvmfPkg/AcpiPlatformDxe/Qemu.c index bed3b16159a6..bdcc46b7186a 100644 --- a/OvmfPkg/AcpiPlatformDxe/Qemu.c +++ b/OvmfPkg/AcpiPlatformDxe/Qemu.c @@ -6,19 +6,19 @@ Copyright (C) 2012-2014, Red Hat, Inc. =20 SPDX-License-Identifier: BSD-2-Clause-Patent =20 **/ =20 -#include -#include -#include -#include -#include -#include -#include +#include // EFI_ACPI_1_0_IO_APIC_STRUCTURE +#include // CopyMem() +#include // DEBUG() +#include // gDS +#include // AllocatePool() +#include // PcdGet16() +#include // QemuFwCfgIsAvailable() =20 #include "AcpiPlatform.h" =20 BOOLEAN QemuDetected ( VOID diff --git a/OvmfPkg/AcpiPlatformDxe/QemuFwCfgAcpi.c b/OvmfPkg/AcpiPlatform= Dxe/QemuFwCfgAcpi.c index 621e69410da9..df800b149275 100644 --- a/OvmfPkg/AcpiPlatformDxe/QemuFwCfgAcpi.c +++ b/OvmfPkg/AcpiPlatformDxe/QemuFwCfgAcpi.c @@ -5,21 +5,22 @@ Copyright (C) 2012-2014, Red Hat, Inc. =20 SPDX-License-Identifier: BSD-2-Clause-Patent =20 **/ =20 -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include // EFI_ACPI_DESCRIPTION_HEAD= ER +#include // QEMU_LOADER_FNAME_SIZE +#include // AsciiStrCmp() +#include // CopyMem() +#include // DEBUG() +#include // AllocatePool() +#include // OrderedCollectionMin() +#include // QemuFwCfgFindFile() +#include // QemuFwCfgS3Enabled() +#include // gBS =20 #include "AcpiPlatform.h" =20 // // The user structure for the ordered collection that will track the fw_cfg // blobs under processing. diff --git a/OvmfPkg/AcpiPlatformDxe/Xen.c b/OvmfPkg/AcpiPlatformDxe/Xen.c index 1d69989042c6..be2c5d695846 100644 --- a/OvmfPkg/AcpiPlatformDxe/Xen.c +++ b/OvmfPkg/AcpiPlatformDxe/Xen.c @@ -5,13 +5,15 @@ Copyright (c) 2012, Bei Guan =20 SPDX-License-Identifier: BSD-2-Clause-Patent =20 **/ =20 -#include +#include // CpuDeadLoop() +#include // DEBUG() +#include // XenGetInfoHOB() =20 #include "AcpiPlatform.h" =20 #define XEN_ACPI_PHYSICAL_ADDRESS 0x000EA020 #define XEN_BIOS_PHYSICAL_END 0x000FFFFF =20 --=20 2.19.1.3.g30247aa5d201 -=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 (#75679): https://edk2.groups.io/g/devel/message/75679 Mute This Topic: https://groups.io/mt/83110470/1787277 Mute #includes:https://edk2.groups.io/g/devel/mutehashtag/includes Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-