Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 114742
b: refs/heads/master
c: 56d9366
h: refs/heads/master
v: v3
  • Loading branch information
Joerg Roedel authored and Linus Torvalds committed Oct 16, 2008
1 parent de1ae80 commit fbf550f
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 3400001c531d283068a60e9f884f7de6f22314be
refs/heads/master: 56d936607408d71c4141b2ed501410b072f1e211
3 changes: 3 additions & 0 deletions trunk/include/linux/iommu-helper.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,7 @@ extern unsigned long iommu_area_alloc(unsigned long *map, unsigned long size,
extern void iommu_area_free(unsigned long *map, unsigned long start,
unsigned int nr);

extern unsigned long iommu_num_pages(unsigned long addr, unsigned long len,
unsigned long io_page_size);

#endif
9 changes: 9 additions & 0 deletions trunk/lib/iommu-helper.c
Original file line number Diff line number Diff line change
Expand Up @@ -79,3 +79,12 @@ 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 io_page_size)
{
unsigned long size = (addr & (io_page_size - 1)) + len;

return DIV_ROUND_UP(size, io_page_size);
}
EXPORT_SYMBOL(iommu_num_pages);

0 comments on commit fbf550f

Please sign in to comment.