]> git.proxmox.com Git - mirror_edk2.git/commitdiff
EmbeddedPkg: introduce PlatformHasAcpiLib
authorLaszlo Ersek <lersek@redhat.com>
Fri, 17 Mar 2017 12:47:35 +0000 (13:47 +0100)
committerLaszlo Ersek <lersek@redhat.com>
Tue, 28 Mar 2017 12:07:38 +0000 (14:07 +0200)
Add the shorter-term library instance outlined in the previous patch to
EmbeddedPkg, so that we can imbue AcpiTableDxe with a protocol dependency
on EDKII_PLATFORM_HAS_ACPI_GUID.

Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Leif Lindholm <leif.lindholm@linaro.org>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
EmbeddedPkg/Library/PlatformHasAcpiLib/PlatformHasAcpiLib.c [new file with mode: 0644]
EmbeddedPkg/Library/PlatformHasAcpiLib/PlatformHasAcpiLib.inf [new file with mode: 0644]

diff --git a/EmbeddedPkg/Library/PlatformHasAcpiLib/PlatformHasAcpiLib.c b/EmbeddedPkg/Library/PlatformHasAcpiLib/PlatformHasAcpiLib.c
new file mode 100644 (file)
index 0000000..2c73e71
--- /dev/null
@@ -0,0 +1,36 @@
+/** @file\r
+  A hook-in library for MdeModulePkg/Universal/Acpi/AcpiTableDxe.\r
+\r
+  Plugging this library instance into AcpiTableDxe makes\r
+  EFI_ACPI_TABLE_PROTOCOL and (if enabled) EFI_ACPI_SDT_PROTOCOL depend on the\r
+  platform's dynamic decision whether to expose an ACPI-based hardware\r
+  description to the operating system.\r
+\r
+  Universal and platform specific DXE drivers that produce ACPI tables depend\r
+  on EFI_ACPI_TABLE_PROTOCOL / EFI_ACPI_SDT_PROTOCOL in turn.\r
+\r
+  Copyright (C) 2017, Red Hat, Inc.\r
+\r
+  This program and the accompanying materials are licensed and made available\r
+  under the terms and conditions of the BSD License which accompanies this\r
+  distribution. The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT\r
+  WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+**/\r
+\r
+#include <Base.h>\r
+\r
+RETURN_STATUS\r
+EFIAPI\r
+PlatformHasAcpiInitialize (\r
+  VOID\r
+  )\r
+{\r
+  //\r
+  // Do nothing, just imbue AcpiTableDxe with a protocol dependency on\r
+  // EDKII_PLATFORM_HAS_ACPI_GUID.\r
+  //\r
+  return RETURN_SUCCESS;\r
+}\r
diff --git a/EmbeddedPkg/Library/PlatformHasAcpiLib/PlatformHasAcpiLib.inf b/EmbeddedPkg/Library/PlatformHasAcpiLib/PlatformHasAcpiLib.inf
new file mode 100644 (file)
index 0000000..6268293
--- /dev/null
@@ -0,0 +1,40 @@
+## @file\r
+# A hook-in library for MdeModulePkg/Universal/Acpi/AcpiTableDxe.\r
+#\r
+# Plugging this library instance into AcpiTableDxe makes\r
+# EFI_ACPI_TABLE_PROTOCOL and (if enabled) EFI_ACPI_SDT_PROTOCOL depend on the\r
+# platform's dynamic decision whether to expose an ACPI-based hardware\r
+# description to the operating system.\r
+#\r
+# Universal and platform specific DXE drivers that produce ACPI tables depend\r
+# on EFI_ACPI_TABLE_PROTOCOL / EFI_ACPI_SDT_PROTOCOL in turn.\r
+#\r
+# Copyright (C) 2017, Red Hat, Inc.\r
+#\r
+# This program and the accompanying materials are licensed and made available\r
+# under the terms and conditions of the BSD License which accompanies this\r
+# distribution. The full text of the license may be found at\r
+# http://opensource.org/licenses/bsd-license.php\r
+#\r
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT\r
+# WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+##\r
+\r
+[Defines]\r
+  INF_VERSION                    = 1.25\r
+  BASE_NAME                      = PlatformHasAcpiLib\r
+  FILE_GUID                      = 29beb028-0958-447b-be0a-12229235d77d\r
+  MODULE_TYPE                    = BASE\r
+  VERSION_STRING                 = 1.0\r
+  LIBRARY_CLASS                  = PlatformHasAcpiLib|DXE_DRIVER\r
+  CONSTRUCTOR                    = PlatformHasAcpiInitialize\r
+\r
+[Sources]\r
+  PlatformHasAcpiLib.c\r
+\r
+[Packages]\r
+  EmbeddedPkg/EmbeddedPkg.dec\r
+  MdePkg/MdePkg.dec\r
+\r
+[Depex]\r
+  gEdkiiPlatformHasAcpiGuid\r