git: eef905a85907 - main - linuxkpi: Add <linux/iommu.h>

From: Jean-Sébastien Pédron <dumbbell_at_FreeBSD.org>
Date: Mon, 20 Mar 2023 20:47:49 UTC
The branch main has been updated by dumbbell:

URL: https://cgit.FreeBSD.org/src/commit/?id=eef905a85907102bc00b76b5b135c24cabe0456a

commit eef905a85907102bc00b76b5b135c24cabe0456a
Author:     Jean-Sébastien Pédron <dumbbell@FreeBSD.org>
AuthorDate: 2023-02-20 20:48:06 +0000
Commit:     Jean-Sébastien Pédron <dumbbell@FreeBSD.org>
CommitDate: 2023-03-20 20:47:36 +0000

    linuxkpi: Add <linux/iommu.h>
    
    It defines a small part of the IOMMU API of Linux. We don't implement
    that yet.
    
    Reviewed by:    manu
    Approved by:    manu
    Differential Revision:  https://reviews.freebsd.org/D39054
---
 sys/compat/linuxkpi/common/include/linux/iommu.h | 29 ++++++++++++++++++++++++
 1 file changed, 29 insertions(+)

diff --git a/sys/compat/linuxkpi/common/include/linux/iommu.h b/sys/compat/linuxkpi/common/include/linux/iommu.h
new file mode 100644
index 000000000000..391d9778a0c8
--- /dev/null
+++ b/sys/compat/linuxkpi/common/include/linux/iommu.h
@@ -0,0 +1,29 @@
+/* Public domain. */
+
+#ifndef _LINUXKPI_LINUX_IOMMU_H_
+#define	_LINUXKPI_LINUX_IOMMU_H_
+
+#include <linux/device.h>
+
+#define	__IOMMU_DOMAIN_PAGING	(1U << 0)
+#define	__IOMMU_DOMAIN_DMA_API	(1U << 1)
+#define	__IOMMU_DOMAIN_PT	(1U << 2)
+#define	__IOMMU_DOMAIN_DMA_FQ	(1U << 3)
+
+#define	IOMMU_DOMAIN_BLOCKED	(0U)
+#define	IOMMU_DOMAIN_IDENTITY	(__IOMMU_DOMAIN_PT)
+#define	IOMMU_DOMAIN_UNMANAGED	(__IOMMU_DOMAIN_PAGING)
+#define	IOMMU_DOMAIN_DMA	(__IOMMU_DOMAIN_PAGING | __IOMMU_DOMAIN_DMA_API)
+#define	IOMMU_DOMAIN_DMA_FQ	(__IOMMU_DOMAIN_PAGING | __IOMMU_DOMAIN_DMA_API | __IOMMU_DOMAIN_DMA_FQ)
+
+struct iommu_domain {
+	unsigned int type;
+};
+
+static inline struct iommu_domain *
+iommu_get_domain_for_dev(struct device *dev __unused)
+{
+	return (NULL);
+}
+
+#endif /* _LINUXKPI_LINUX_IOMMU_H_ */