FUJITA Tomonori | eecfffc | 2008-09-12 19:42:33 +0900 | [diff] [blame^] | 1 | static 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 Tomonori | 3715863 | 2008-03-04 14:29:27 -0800 | [diff] [blame] | 11 | extern int iommu_is_span_boundary(unsigned int index, unsigned int nr, |
| 12 | unsigned long shift, |
| 13 | unsigned long boundary_size); |
FUJITA Tomonori | 0291df8 | 2008-02-04 22:28:07 -0800 | [diff] [blame] | 14 | extern 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); |
| 19 | extern void iommu_area_free(unsigned long *map, unsigned long start, |
| 20 | unsigned int nr); |