summaryrefslogtreecommitdiff
path: root/drivers/iommu/io-pgtable.h
diff options
context:
space:
mode:
authorRobin Murphy <robin.murphy@arm.com>2016-01-26 17:13:14 +0000
committerWill Deacon <will.deacon@arm.com>2016-02-17 14:15:08 +0000
commit507e4c9d194360d07f9cc9ca689a17eb14e370a2 (patch)
treebcd65b5ec363e0b7214f25d677dacb0e128d29b9 /drivers/iommu/io-pgtable.h
parente5fc9753b1a831466be9b45d0bf926eeaa8b84a0 (diff)
iommu/io-pgtable: Add helper functions for TLB ops
Add some simple wrappers to avoid having the guts of the TLB operations spilled all over the page table implementations, and to provide a point to implement extra common functionality. Acked-by: Will Deacon <will.deacon@arm.com> Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Robin Murphy <robin.murphy@arm.com> Signed-off-by: Will Deacon <will.deacon@arm.com>
Diffstat (limited to 'drivers/iommu/io-pgtable.h')
-rw-r--r--drivers/iommu/io-pgtable.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/drivers/iommu/io-pgtable.h b/drivers/iommu/io-pgtable.h
index aa57073b1d8d..95c5565b6669 100644
--- a/drivers/iommu/io-pgtable.h
+++ b/drivers/iommu/io-pgtable.h
@@ -144,6 +144,22 @@ struct io_pgtable {
#define io_pgtable_ops_to_pgtable(x) container_of((x), struct io_pgtable, ops)
+static inline void io_pgtable_tlb_flush_all(struct io_pgtable *iop)
+{
+ iop->cfg.tlb->tlb_flush_all(iop->cookie);
+}
+
+static inline void io_pgtable_tlb_add_flush(struct io_pgtable *iop,
+ unsigned long iova, size_t size, size_t granule, bool leaf)
+{
+ iop->cfg.tlb->tlb_add_flush(iova, size, granule, leaf, iop->cookie);
+}
+
+static inline void io_pgtable_tlb_sync(struct io_pgtable *iop)
+{
+ iop->cfg.tlb->tlb_sync(iop->cookie);
+}
+
/**
* struct io_pgtable_init_fns - Alloc/free a set of page tables for a
* particular format.