diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2008-04-02 07:46:41 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-04-02 07:46:41 -0700 |
commit | 4c61f72c72e0e1181f91831f106c5f7306238706 (patch) | |
tree | 448350a5bf4a8b53417cfa97ad234be05c2a4590 /arch/sparc64/kernel/iommu_common.h | |
parent | 2f819ae8816990aaad46dd6d1748a096d136df68 (diff) | |
parent | c819914e0d5cc85cccf5fe7542fcb9586286bc28 (diff) | |
download | linux-4c61f72c72e0e1181f91831f106c5f7306238706.tar.bz2 |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-2.6:
sparc64: remove unused calc_npages() in iommu_common.h
sparc64: add the segment boundary checking to IOMMUs while merging SG entries
[SPARC64]: Don't open-code {get,put}_cpu_var() in flush_tlb_pending().
Diffstat (limited to 'arch/sparc64/kernel/iommu_common.h')
-rw-r--r-- | arch/sparc64/kernel/iommu_common.h | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/arch/sparc64/kernel/iommu_common.h b/arch/sparc64/kernel/iommu_common.h index 0713bd58499c..f3575a614fa2 100644 --- a/arch/sparc64/kernel/iommu_common.h +++ b/arch/sparc64/kernel/iommu_common.h @@ -12,6 +12,7 @@ #include <linux/mm.h> #include <linux/scatterlist.h> #include <linux/device.h> +#include <linux/iommu-helper.h> #include <asm/iommu.h> #include <asm/scatterlist.h> @@ -45,17 +46,16 @@ static inline unsigned long iommu_num_pages(unsigned long vaddr, return npages; } -static inline unsigned long calc_npages(struct scatterlist *sglist, int nelems) +static inline int is_span_boundary(unsigned long entry, + unsigned long shift, + unsigned long boundary_size, + struct scatterlist *outs, + struct scatterlist *sg) { - unsigned long i, npages = 0; - struct scatterlist *sg; + unsigned long paddr = SG_ENT_PHYS_ADDRESS(outs); + int nr = iommu_num_pages(paddr, outs->dma_length + sg->length); - for_each_sg(sglist, sg, nelems, i) { - unsigned long paddr = SG_ENT_PHYS_ADDRESS(sg); - npages += iommu_num_pages(paddr, sg->length); - } - - return npages; + return iommu_is_span_boundary(entry, nr, shift, boundary_size); } extern unsigned long iommu_range_alloc(struct device *dev, |