projects
/
cascardo
/
linux.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'cpufreq' into release
[cascardo/linux.git]
/
lib
/
iommu-helper.c
diff --git
a/lib/iommu-helper.c
b/lib/iommu-helper.c
index
a3b8d4c
..
75dbda0
100644
(file)
--- a/
lib/iommu-helper.c
+++ b/
lib/iommu-helper.c
@@
-30,8
+30,7
@@
again:
return index;
}
return index;
}
-static inline void set_bit_area(unsigned long *map, unsigned long i,
- int len)
+void iommu_area_reserve(unsigned long *map, unsigned long i, int len)
{
unsigned long end = i + len;
while (i < end) {
{
unsigned long end = i + len;
while (i < end) {
@@
-64,7
+63,7
@@
again:
start = index + 1;
goto again;
}
start = index + 1;
goto again;
}
-
set_bit_area
(map, index, nr);
+
iommu_area_reserve
(map, index, nr);
}
return index;
}
}
return index;
}
@@
-80,3
+79,12
@@
void iommu_area_free(unsigned long *map, unsigned long start, unsigned int nr)
}
}
EXPORT_SYMBOL(iommu_area_free);
}
}
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);