--- /dev/null
+/** @file\r
+ A hook-in library for MdeModulePkg/Bus/Pci/PciHostBridgeDxe.\r
+\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
+\r
+ Copyright (C) 2017, Red Hat, Inc.\r
+ Copyright (C) 2017, AMD, 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
+PlatformHasIoMmuInitialize (\r
+ VOID\r
+ )\r
+{\r
+ //\r
+ // Do nothing, just imbue PciHostBridgeDxe with a protocol dependency on\r
+ // gIoMmuAbsentProtocolGuid OR gEdkiiIoMmuProtocolGuid.\r
+ //\r
+ return RETURN_SUCCESS;\r
+}\r
--- /dev/null
+## @file\r
+# A hook-in library for MdeModulePkg/Bus/Pci/PciHostBridgeDxe.\r
+#\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
+#\r
+# Copyright (C) 2017, Red Hat, Inc.\r
+# Copyright (C) 2017, AMD, 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 = 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
+\r
+[Sources]\r
+ PlatformHasIoMmuLib.c\r
+\r
+[Packages]\r
+ MdeModulePkg/MdeModulePkg.dec\r
+ MdePkg/MdePkg.dec\r
+ OvmfPkg/OvmfPkg.dec\r
+\r
+[Depex]\r
+ gEdkiiIoMmuProtocolGuid OR gIoMmuAbsentProtocolGuid\r