summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJesse Barnes <jbarnes@hobbes.lan>2008-07-28 14:31:10 -0700
committerJesse Barnes <jbarnes@virtuousgeek.org>2008-07-28 14:31:10 -0700
commit29111f579f4f3f2a07385f931854ab0527ae7ea5 (patch)
tree0271f20b0c954fa364be8627e0d6065544de0534 /lib
parentcc5499c3a607a392e8a7adb934aaf14b2c6a3519 (diff)
parent87e39ea5714dd59ba31e36c25833d2b20255a29d (diff)
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);