mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 03:27:44 -04:00
introduce generic iommu_num_pages function
This patch introduces the generic iommu_num_pages function. It can be used by a given memory area. Signed-off-by: Joerg Roedel <[email protected]> Cc: "David S. Miller" <[email protected]> Cc: Richard Henderson <[email protected]> Cc: Ivan Kokshaysky <[email protected]> Cc: Benjamin Herrenschmidt <[email protected]> Cc: Paul Mackerras <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Thomas Gleixner <[email protected]> Cc: FUJITA Tomonori <[email protected]> Cc: Muli Ben-Yehuda <[email protected]> Cc: Dave Airlie <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
3400001c53
commit
56d9366074
2 changed files with 12 additions and 0 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in a new issue