aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/include/asm/iommu.h
diff options
context:
space:
mode:
Diffstat (limited to 'arch/powerpc/include/asm/iommu.h')
-rw-r--r--arch/powerpc/include/asm/iommu.h11
1 files changed, 7 insertions, 4 deletions
diff --git a/arch/powerpc/include/asm/iommu.h b/arch/powerpc/include/asm/iommu.h
index 20febe0b7f32..daa3ee5d7ad2 100644
--- a/arch/powerpc/include/asm/iommu.h
+++ b/arch/powerpc/include/asm/iommu.h
@@ -69,6 +69,8 @@ struct iommu_table_ops {
69 long index, 69 long index,
70 unsigned long *hpa, 70 unsigned long *hpa,
71 enum dma_data_direction *direction); 71 enum dma_data_direction *direction);
72
73 __be64 *(*useraddrptr)(struct iommu_table *tbl, long index, bool alloc);
72#endif 74#endif
73 void (*clear)(struct iommu_table *tbl, 75 void (*clear)(struct iommu_table *tbl,
74 long index, long npages); 76 long index, long npages);
@@ -117,15 +119,16 @@ struct iommu_table {
117 unsigned long *it_map; /* A simple allocation bitmap for now */ 119 unsigned long *it_map; /* A simple allocation bitmap for now */
118 unsigned long it_page_shift;/* table iommu page size */ 120 unsigned long it_page_shift;/* table iommu page size */
119 struct list_head it_group_list;/* List of iommu_table_group_link */ 121 struct list_head it_group_list;/* List of iommu_table_group_link */
120 unsigned long *it_userspace; /* userspace view of the table */ 122 __be64 *it_userspace; /* userspace view of the table */
121 struct iommu_table_ops *it_ops; 123 struct iommu_table_ops *it_ops;
122 struct kref it_kref; 124 struct kref it_kref;
125 int it_nid;
123}; 126};
124 127
128#define IOMMU_TABLE_USERSPACE_ENTRY_RM(tbl, entry) \
129 ((tbl)->it_ops->useraddrptr((tbl), (entry), false))
125#define IOMMU_TABLE_USERSPACE_ENTRY(tbl, entry) \ 130#define IOMMU_TABLE_USERSPACE_ENTRY(tbl, entry) \
126 ((tbl)->it_userspace ? \ 131 ((tbl)->it_ops->useraddrptr((tbl), (entry), true))
127 &((tbl)->it_userspace[(entry) - (tbl)->it_offset]) : \
128 NULL)
129 132
130/* Pure 2^n version of get_order */ 133/* Pure 2^n version of get_order */
131static inline __attribute_const__ 134static inline __attribute_const__