6 #ifndef _IOMMU_COMMON_H
7 #define _IOMMU_COMMON_H
9 #include <linux/kernel.h>
10 #include <linux/types.h>
11 #include <linux/sched.h>
14 #include <linux/device.h>
17 #include <asm/iommu.h>
18 #include <asm/scatterlist.h>
23 #define IO_PAGE_SHIFT 13
24 #define IO_PAGE_SIZE (1UL << IO_PAGE_SHIFT)
25 #define IO_PAGE_MASK (~(IO_PAGE_SIZE-1))
26 #define IO_PAGE_ALIGN(addr) ALIGN(addr, IO_PAGE_SIZE)
28 #define IO_TSB_ENTRIES (128*1024)
29 #define IO_TSB_SIZE (IO_TSB_ENTRIES * 8)
34 #define IOMMU_PAGE_SHIFT 13
36 #define SG_ENT_PHYS_ADDRESS(SG) (__pa(sg_virt((SG))))
38 static inline int is_span_boundary(
unsigned long entry,
40 unsigned long boundary_size,
45 int nr = iommu_num_pages(paddr, outs->dma_length + sg->
length,
57 unsigned long npages);