mirror of
https://github.com/openwrt/openwrt.git
synced 2024-12-29 10:08:59 +00:00
e648e3ccf9
Signed-off-by: Felix Fietkau <nbd@nbd.name>
27 lines
636 B
Diff
27 lines
636 B
Diff
--- /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
|