Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 86837
b: refs/heads/master
c: 3715863
h: refs/heads/master
i:
  86835: fcacaa9
v: v3
  • Loading branch information
FUJITA Tomonori authored and Linus Torvalds committed Mar 5, 2008
1 parent c09e271 commit 5e2a1b8
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 7eb701dc7779794d46e02a7fa1380289cb730d46
refs/heads/master: 3715863aa142c4f4c5208f5f3e5e9bac06006d2f
3 changes: 3 additions & 0 deletions trunk/include/linux/iommu-helper.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
extern int iommu_is_span_boundary(unsigned int index, unsigned int nr,
unsigned long shift,
unsigned long boundary_size);
extern unsigned long iommu_area_alloc(unsigned long *map, unsigned long size,
unsigned long start, unsigned int nr,
unsigned long shift,
Expand Down
10 changes: 6 additions & 4 deletions trunk/lib/iommu-helper.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand All @@ -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) {
if (is_span_boundary(index, nr, shift, boundary_size)) {
if (iommu_is_span_boundary(index, nr, shift, boundary_size)) {
/* we could do more effectively */
start = index + 1;
goto again;
Expand Down

0 comments on commit 5e2a1b8

Please sign in to comment.