blob: 58f41107e4ae05327330710ce11c15979d3e114f [file] [log] [blame]
FUJITA Tomonorieecfffc2008-09-12 19:42:33 +09001static inline unsigned long iommu_device_max_index(unsigned long size,
2 unsigned long offset,
3 u64 dma_mask)
4{
5 if (size + offset > dma_mask)
6 return dma_mask - offset + 1;
7 else
8 return size;
9}
10
FUJITA Tomonori37158632008-03-04 14:29:27 -080011extern int iommu_is_span_boundary(unsigned int index, unsigned int nr,
12 unsigned long shift,
13 unsigned long boundary_size);
FUJITA Tomonori0291df82008-02-04 22:28:07 -080014extern unsigned long iommu_area_alloc(unsigned long *map, unsigned long size,
15 unsigned long start, unsigned int nr,
16 unsigned long shift,
17 unsigned long boundary_size,
18 unsigned long align_mask);
19extern void iommu_area_free(unsigned long *map, unsigned long start,
20 unsigned int nr);