blob: 2d3ef88d64559145ae74b209e498ec6dc9a8fc9e [file] [log] [blame]
--- /dev/null
+++ b/backport-include/linux/iommu.h
@@ -0,0 +1,23 @@
+#ifndef __BACKPORT_LINUX_IOMMU_H
+#define __BACKPORT_LINUX_IOMMU_H
+
+#include_next <linux/iommu.h>
+#include <linux/version.h>
+
+#if LINUX_VERSION_IS_LESS(6,3,0)
+
+static inline int LINUX_BACKPORT(iommu_map)(struct iommu_domain *domain,
+ unsigned long iova,
+ phys_addr_t paddr, size_t size,
+ int prot, gfp_t gfp)
+{
+ if (gfp == GFP_ATOMIC)
+ return iommu_map_atomic(domain, iova, paddr, size, prot);
+
+ return iommu_map(domain, iova, paddr, size, prot);
+}
+#define iommu_map LINUX_BACKPORT(iommu_map)
+
+#endif /* < 6.3 */
+
+#endif