]> git.proxmox.com Git - mirror_edk2.git/commitdiff
OvmfPkg/AcpiPlatformDxe: consolidate #includes and [LibraryClasses]
authorLaszlo Ersek <lersek@redhat.com>
Wed, 26 May 2021 20:14:13 +0000 (22:14 +0200)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Fri, 4 Jun 2021 16:01:50 +0000 (16:01 +0000)
- #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 <ardb+tianocore@kernel.org>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Philippe Mathieu-Daudé <philmd@redhat.com>
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=2122
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Message-Id: <20210526201446.12554-11-lersek@redhat.com>
Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
OvmfPkg/AcpiPlatformDxe/AcpiPlatform.c
OvmfPkg/AcpiPlatformDxe/AcpiPlatform.h
OvmfPkg/AcpiPlatformDxe/AcpiPlatformDxe.inf
OvmfPkg/AcpiPlatformDxe/BootScript.c
OvmfPkg/AcpiPlatformDxe/EntryPoint.c
OvmfPkg/AcpiPlatformDxe/PciDecoding.c
OvmfPkg/AcpiPlatformDxe/Qemu.c
OvmfPkg/AcpiPlatformDxe/QemuFwCfgAcpi.c
OvmfPkg/AcpiPlatformDxe/QemuFwCfgAcpiPlatformDxe.inf
OvmfPkg/AcpiPlatformDxe/Xen.c

index f872d91aea720862ecf2353344c36e15eacd7cd3..efbbfab89d2b2f2c53097b0c2e5750eac9f8078b 100644 (file)
@@ -6,6 +6,11 @@
 \r
 **/\r
 \r
+#include <Library/DebugLib.h>                 // ASSERT_EFI_ERROR()\r
+#include <Library/UefiBootServicesTableLib.h> // gBS\r
+#include <Library/XenPlatformLib.h>           // XenDetected()\r
+#include <Protocol/FirmwareVolume2.h>         // gEfiFirmwareVolume2Protocol...\r
+\r
 #include "AcpiPlatform.h"\r
 \r
 EFI_STATUS\r
index 511a30782f6d8235d5fccc7c7234c4ad25a30c33..d98b79baab403cf07926cd5b22127d54aadb34e3 100644 (file)
@@ -9,16 +9,8 @@
 #ifndef ACPI_PLATFORM_H_\r
 #define ACPI_PLATFORM_H_\r
 \r
-#include <IndustryStandard/Acpi.h>\r
-#include <Library/BaseLib.h>\r
-#include <Library/DebugLib.h>\r
-#include <Library/PcdLib.h>\r
-#include <Library/UefiBootServicesTableLib.h>\r
-#include <Library/XenPlatformLib.h>\r
-#include <PiDxe.h>\r
-#include <Protocol/AcpiTable.h>\r
-#include <Protocol/FirmwareVolume2.h>\r
-#include <Protocol/PciIo.h>\r
+#include <Protocol/AcpiTable.h> // EFI_ACPI_TABLE_PROTOCOL\r
+#include <Protocol/PciIo.h>     // EFI_PCI_IO_PROTOCOL\r
 \r
 typedef struct {\r
   EFI_PCI_IO_PROTOCOL *PciIo;\r
index 3daeb2ee42d225427b0a57a39051218878150873..77607298cbea3e339eefddf02a0d6eee95a0eb0f 100644 (file)
@@ -48,7 +48,6 @@
   QemuFwCfgS3Lib\r
   UefiBootServicesTableLib\r
   UefiDriverEntryPoint\r
-  UefiLib\r
   XenPlatformLib\r
 \r
 [Protocols]\r
index 7b1b9586da41cde8024fcca118749eb0ebc2cc93..f2d1089e91ce31301e6b4522810a4ae3f17a59b5 100644 (file)
@@ -7,9 +7,10 @@
   SPDX-License-Identifier: BSD-2-Clause-Patent\r
 **/\r
 \r
-#include <Library/MemoryAllocationLib.h>\r
-#include <Library/QemuFwCfgLib.h>\r
-#include <Library/QemuFwCfgS3Lib.h>\r
+#include <Library/BaseLib.h>             // CpuDeadLoop()\r
+#include <Library/DebugLib.h>            // DEBUG()\r
+#include <Library/MemoryAllocationLib.h> // AllocatePool()\r
+#include <Library/QemuFwCfgS3Lib.h>      // QemuFwCfgS3ScriptSkipBytes()\r
 \r
 #include "AcpiPlatform.h"\r
 \r
index fb07ed85373d0d2fb108786dd99a5e3161619a05..bb5fe82c18d4b44fd9203705e20dbc986fc4c8b3 100644 (file)
@@ -7,7 +7,11 @@
   SPDX-License-Identifier: BSD-2-Clause-Patent\r
 **/\r
 \r
-#include <Guid/RootBridgesConnectedEventGroup.h>\r
+#include <Guid/RootBridgesConnectedEventGroup.h> // gRootBridgesConnectedEve...\r
+#include <Library/DebugLib.h>                    // DEBUG()\r
+#include <Library/PcdLib.h>                      // PcdGetBool()\r
+#include <Library/UefiBootServicesTableLib.h>    // gBS\r
+#include <Protocol/AcpiTable.h>                  // EFI_ACPI_TABLE_PROTOCOL\r
 \r
 #include "AcpiPlatform.h"\r
 \r
index 73894106c9ec4a4feb91223df6542b194a5d4e2e..6ba4c936ad8e3ff068e85809706820f0254cf0ca 100644 (file)
@@ -7,7 +7,9 @@
   SPDX-License-Identifier: BSD-2-Clause-Patent\r
 **/\r
 \r
-#include <Library/MemoryAllocationLib.h>\r
+#include <Library/DebugLib.h>                  // DEBUG()\r
+#include <Library/MemoryAllocationLib.h>       // AllocatePool()\r
+#include <Library/UefiBootServicesTableLib.h>  // gBS\r
 \r
 #include "AcpiPlatform.h"\r
 \r
index bed3b16159a6508afeaca8506aa02d267572b9e3..bdcc46b7186a4a187b3f535c96fe481be7f7b3f8 100644 (file)
@@ -9,13 +9,13 @@
 \r
 **/\r
 \r
-#include <IndustryStandard/Acpi.h>\r
-#include <Library/BaseMemoryLib.h>\r
-#include <Library/DxeServicesTableLib.h>\r
-#include <Library/MemoryAllocationLib.h>\r
-#include <Library/OrderedCollectionLib.h>\r
-#include <Library/PcdLib.h>\r
-#include <Library/QemuFwCfgLib.h>\r
+#include <IndustryStandard/Acpi.h>        // EFI_ACPI_1_0_IO_APIC_STRUCTURE\r
+#include <Library/BaseMemoryLib.h>        // CopyMem()\r
+#include <Library/DebugLib.h>             // DEBUG()\r
+#include <Library/DxeServicesTableLib.h>  // gDS\r
+#include <Library/MemoryAllocationLib.h>  // AllocatePool()\r
+#include <Library/PcdLib.h>               // PcdGet16()\r
+#include <Library/QemuFwCfgLib.h>         // QemuFwCfgIsAvailable()\r
 \r
 #include "AcpiPlatform.h"\r
 \r
index 621e69410da9ba8924da788f89c8fa9ab4ef38e2..df800b149275e0fb16d0d5605640134537c7e2f7 100644 (file)
@@ -8,15 +8,16 @@
 \r
 **/\r
 \r
-#include <IndustryStandard/Acpi.h>\r
-#include <IndustryStandard/QemuLoader.h>\r
-#include <Library/BaseMemoryLib.h>\r
-#include <Library/DxeServicesTableLib.h>\r
-#include <Library/MemoryAllocationLib.h>\r
-#include <Library/OrderedCollectionLib.h>\r
-#include <Library/PcdLib.h>\r
-#include <Library/QemuFwCfgLib.h>\r
-#include <Library/QemuFwCfgS3Lib.h>\r
+#include <IndustryStandard/Acpi.h>            // EFI_ACPI_DESCRIPTION_HEADER\r
+#include <IndustryStandard/QemuLoader.h>      // QEMU_LOADER_FNAME_SIZE\r
+#include <Library/BaseLib.h>                  // AsciiStrCmp()\r
+#include <Library/BaseMemoryLib.h>            // CopyMem()\r
+#include <Library/DebugLib.h>                 // DEBUG()\r
+#include <Library/MemoryAllocationLib.h>      // AllocatePool()\r
+#include <Library/OrderedCollectionLib.h>     // OrderedCollectionMin()\r
+#include <Library/QemuFwCfgLib.h>             // QemuFwCfgFindFile()\r
+#include <Library/QemuFwCfgS3Lib.h>           // QemuFwCfgS3Enabled()\r
+#include <Library/UefiBootServicesTableLib.h> // gBS\r
 \r
 #include "AcpiPlatform.h"\r
 \r
index 48c8269a8b6f02762b5d55ee82fd0423308c1088..dac25d1505beb67914ee2aed25bd2455d88462fd 100644 (file)
 \r
 [LibraryClasses]\r
   BaseLib\r
+  BaseMemoryLib\r
   DebugLib\r
   MemoryAllocationLib\r
   OrderedCollectionLib\r
+  PcdLib\r
   QemuFwCfgLib\r
   QemuFwCfgS3Lib\r
   UefiBootServicesTableLib\r
index 1d69989042c6c63c9bb2161e1053331fe4059da8..be2c5d6958460bae3a080211d39e1f35e9e49c9e 100644 (file)
@@ -8,7 +8,9 @@
 \r
 **/\r
 \r
-#include <Library/BaseLib.h>\r
+#include <Library/BaseLib.h>        // CpuDeadLoop()\r
+#include <Library/DebugLib.h>       // DEBUG()\r
+#include <Library/XenPlatformLib.h> // XenGetInfoHOB()\r
 \r
 #include "AcpiPlatform.h"\r
 \r