summaryrefslogtreecommitdiff
path: root/include/linux/generic_pt
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/generic_pt')
-rw-r--r--include/linux/generic_pt/iommu.h19
1 files changed, 14 insertions, 5 deletions
diff --git a/include/linux/generic_pt/iommu.h b/include/linux/generic_pt/iommu.h
index dc731fe003d1..5622856e1998 100644
--- a/include/linux/generic_pt/iommu.h
+++ b/include/linux/generic_pt/iommu.h
@@ -116,11 +116,13 @@ struct pt_iommu_cfg {
};
/* Generate the exported function signatures from iommu_pt.h */
-#define IOMMU_PROTOTYPES(fmt) \
- int pt_iommu_##fmt##_init(struct pt_iommu_##fmt *table, \
- const struct pt_iommu_##fmt##_cfg *cfg, \
- gfp_t gfp); \
- void pt_iommu_##fmt##_hw_info(struct pt_iommu_##fmt *table, \
+#define IOMMU_PROTOTYPES(fmt) \
+ phys_addr_t pt_iommu_##fmt##_iova_to_phys(struct iommu_domain *domain, \
+ dma_addr_t iova); \
+ int pt_iommu_##fmt##_init(struct pt_iommu_##fmt *table, \
+ const struct pt_iommu_##fmt##_cfg *cfg, \
+ gfp_t gfp); \
+ void pt_iommu_##fmt##_hw_info(struct pt_iommu_##fmt *table, \
struct pt_iommu_##fmt##_hw_info *info)
#define IOMMU_FORMAT(fmt, member) \
struct pt_iommu_##fmt { \
@@ -130,6 +132,13 @@ struct pt_iommu_cfg {
IOMMU_PROTOTYPES(fmt)
/*
+ * A driver uses IOMMU_PT_DOMAIN_OPS to populate the iommu_domain_ops for the
+ * iommu_pt
+ */
+#define IOMMU_PT_DOMAIN_OPS(fmt) \
+ .iova_to_phys = &pt_iommu_##fmt##_iova_to_phys,
+
+/*
* The driver should setup its domain struct like
* union {
* struct iommu_domain domain;