git.openpandora.org
/
pandora-kernel.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
DSS2: Small VRFB context allocation bug fixed
[pandora-kernel.git]
/
lib
/
iommu-helper.c
diff --git
a/lib/iommu-helper.c
b/lib/iommu-helper.c
index
495575a
..
a3b8d4c
100644
(file)
--- a/
lib/iommu-helper.c
+++ b/
lib/iommu-helper.c
@@
-40,10
+40,12
@@
static inline void set_bit_area(unsigned long *map, unsigned long i,
}
}
}
}
-
static inline int
is_span_boundary(unsigned int index, unsigned int nr,
-
unsigned long shift,
-
unsigned long boundary_size)
+
int iommu_
is_span_boundary(unsigned int index, unsigned int nr,
+ unsigned long shift,
+ unsigned long boundary_size)
{
{
+ BUG_ON(!is_power_of_2(boundary_size));
+
shift = (shift + index) & (boundary_size - 1);
return shift + nr > boundary_size;
}
shift = (shift + index) & (boundary_size - 1);
return shift + nr > boundary_size;
}
@@
-57,7
+59,7
@@
unsigned long iommu_area_alloc(unsigned long *map, unsigned long size,
again:
index = find_next_zero_area(map, size, start, nr, align_mask);
if (index != -1) {
again:
index = find_next_zero_area(map, size, start, nr, align_mask);
if (index != -1) {
- if (is_span_boundary(index, nr, shift, boundary_size)) {
+ if (i
ommu_i
s_span_boundary(index, nr, shift, boundary_size)) {
/* we could do more effectively */
start = index + 1;
goto again;
/* we could do more effectively */
start = index + 1;
goto again;