/* * IOMMU helper functions for the free area management */ #include #include #include 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; } unsigned long iommu_area_alloc(unsigned long *map, unsigned long size, unsigned long start, unsigned int nr, unsigned long shift, unsigned long boundary_size, unsigned long align_mask) { unsigned long index; /* We don't want the last of the limit */ size -= 1; again: index = bitmap_find_next_zero_area(map, size, start, nr, align_mask); if (index < size) { if (iommu_is_span_boundary(index, nr, shift, boundary_size)) { start = ALIGN(shift + index, boundary_size) - shift; goto again; } bitmap_set(map, index, nr); return index; } return -1; } EXPORT_SYMBOL(iommu_area_alloc); -cleanup net-next plumbingsTobias Klauser
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2016-12-04 12:50:51 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2016-12-04 12:50:51 -0800
commit3e5de27e940d00d8d504dfb96625fb654f641509 (patch)
treeb38dbbb5c36de40798435623d8db8736d9a26bb0 /net/wireless/db.txt
parent0cb65c83304a341b9d09678448d7c8b550689531 (diff)
Linux 4.9-rc8
Diffstat (limited to 'net/wireless/db.txt')