- #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>
\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
#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
QemuFwCfgS3Lib\r
UefiBootServicesTableLib\r
UefiDriverEntryPoint\r
- UefiLib\r
XenPlatformLib\r
\r
[Protocols]\r
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
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
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
\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
\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
\r
[LibraryClasses]\r
BaseLib\r
+ BaseMemoryLib\r
DebugLib\r
MemoryAllocationLib\r
OrderedCollectionLib\r
+ PcdLib\r
QemuFwCfgLib\r
QemuFwCfgS3Lib\r
UefiBootServicesTableLib\r
\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