summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorJesse Barnes <jbarnes@hobbes.lan>2008-07-28 23:31:10 +0200
committerJesse Barnes <jbarnes@virtuousgeek.org>2008-07-28 23:31:10 +0200
commit29111f579f4f3f2a07385f931854ab0527ae7ea5 (patch)
tree0271f20b0c954fa364be8627e0d6065544de0534 /lib
parentPCI: handle 64-bit resources better on 32-bit machines (diff)
parentx86 gart: replace to_pages macro with iommu_num_pages (diff)
downloadlinux-29111f579f4f3f2a07385f931854ab0527ae7ea5.tar.xz
linux-29111f579f4f3f2a07385f931854ab0527ae7ea5.zip
Merge branch 'x86/iommu' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip into for-linus
Diffstat (limited to 'lib')
-rw-r--r--lib/iommu-helper.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/iommu-helper.c b/lib/iommu-helper.c
index a3b8d4c3f77a..889ddce2021e 100644
--- a/lib/iommu-helper.c
+++ b/lib/iommu-helper.c
@@ -80,3 +80,11 @@ void iommu_area_free(unsigned long *map, unsigned long start, unsigned int nr)
}
}
EXPORT_SYMBOL(iommu_area_free);
+
+unsigned long iommu_num_pages(unsigned long addr, unsigned long len)
+{
+ unsigned long size = roundup((addr & ~PAGE_MASK) + len, PAGE_SIZE);
+
+ return size >> PAGE_SHIFT;
+}
+EXPORT_SYMBOL(iommu_num_pages);