OvmfPkg: Add PlatformHasIoMmuLib
authorBrijesh Singh <brijesh.singh@amd.com>
Thu, 6 Jul 2017 13:27:58 +0000 (09:27 -0400)
committerJordan Justen <jordan.l.justen@intel.com>
Tue, 11 Jul 2017 04:17:28 +0000 (21:17 -0700)
Add the shorter-term library instance outlined in the previous patch to
OvmfPkg, so that we can imbue PciHostBridgeDxe with a protocol dependency
on gEdkiiIoMmuProtocolGuid OR gIoMmuAbsentProtocolGuid.

Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Suggested-by: Laszlo Ersek <lersek@redhat.com>
Signed-off-by: Brijesh Singh <brijesh.singh@amd.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
OvmfPkg/Library/PlatformHasIoMmuLib/PlatformHasIoMmuLib.c [new file with mode: 0644]
OvmfPkg/Library/PlatformHasIoMmuLib/PlatformHasIoMmuLib.inf [new file with mode: 0644]

diff --git a/OvmfPkg/Library/PlatformHasIoMmuLib/PlatformHasIoMmuLib.c b/OvmfPkg/Library/PlatformHasIoMmuLib/PlatformHasIoMmuLib.c
new file mode 100644 (file)
index 0000000..a271be3
--- /dev/null
@@ -0,0 +1,33 @@
+/** @file\r
+  A hook-in library for MdeModulePkg/Bus/Pci/PciHostBridgeDxe.\r
+  Plugging this library instance into PciHostBridgeDxe makes\r
+  PciHostBridgeDxe depend on the platform's dynamic decision whether\r
+  to provide IOMMU implementation (usually through IoMmuDxe driver).\r
+  Copyright (C) 2017, Red Hat, Inc.\r
+  Copyright (C) 2017, AMD, Inc.\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
+#include <Base.h>\r
+PlatformHasIoMmuInitialize (\r
+  VOID\r
+  )\r
+  //\r
+  // Do nothing, just imbue PciHostBridgeDxe with a protocol dependency on\r
+  // gIoMmuAbsentProtocolGuid OR gEdkiiIoMmuProtocolGuid.\r
+  //\r
+  return RETURN_SUCCESS;\r
diff --git a/OvmfPkg/Library/PlatformHasIoMmuLib/PlatformHasIoMmuLib.inf b/OvmfPkg/Library/PlatformHasIoMmuLib/PlatformHasIoMmuLib.inf
new file mode 100644 (file)
index 0000000..f8151cf
--- /dev/null
@@ -0,0 +1,38 @@
+## @file\r
+# A hook-in library for MdeModulePkg/Bus/Pci/PciHostBridgeDxe.\r
+#  Plugging this library instance into PciHostBridgeDxe makes\r
+#  PciHostBridgeDxe depend on the platform's dynamic decision whether\r
+#  to provide IOMMU implementation (usually through IoMmuDxe driver).\r
+# Copyright (C) 2017, Red Hat, Inc.\r
+# Copyright (C) 2017, AMD, Inc.\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
+  INF_VERSION                    = 1.25\r
+  BASE_NAME                      = PlatformHasIoMmuLib\r
+  FILE_GUID                      = 49b4b018-0558-448b-1e1a-12226342877d\r
+  MODULE_TYPE                    = BASE\r
+  VERSION_STRING                 = 1.0\r
+  LIBRARY_CLASS                  = PlatformHasIoMmuLib|DXE_DRIVER\r
+  CONSTRUCTOR                    = PlatformHasIoMmuInitialize\r
+  PlatformHasIoMmuLib.c\r
+  MdeModulePkg/MdeModulePkg.dec\r
+  MdePkg/MdePkg.dec\r
+  OvmfPkg/OvmfPkg.dec\r
+  gEdkiiIoMmuProtocolGuid OR gIoMmuAbsentProtocolGuid\r