dma-iommu.h 927 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. #ifndef ASMARM_DMA_IOMMU_H
  2. #define ASMARM_DMA_IOMMU_H
  3. #ifdef __KERNEL__
  4. #include <linux/mm_types.h>
  5. #include <linux/scatterlist.h>
  6. #include <linux/dma-debug.h>
  7. #include <linux/kmemcheck.h>
  8. #include <linux/kref.h>
  9. struct dma_iommu_mapping {
  10. /* iommu specific data */
  11. struct iommu_domain *domain;
  12. unsigned long **bitmaps; /* array of bitmaps */
  13. unsigned int nr_bitmaps; /* nr of elements in array */
  14. unsigned int extensions;
  15. size_t bitmap_size; /* size of a single bitmap */
  16. size_t bits; /* per bitmap */
  17. dma_addr_t base;
  18. spinlock_t lock;
  19. struct kref kref;
  20. };
  21. struct dma_iommu_mapping *
  22. arm_iommu_create_mapping(struct bus_type *bus, dma_addr_t base, u64 size);
  23. void arm_iommu_release_mapping(struct dma_iommu_mapping *mapping);
  24. int arm_iommu_attach_device(struct device *dev,
  25. struct dma_iommu_mapping *mapping);
  26. void arm_iommu_detach_device(struct device *dev);
  27. #endif /* __KERNEL__ */
  28. #endif