cregit-Linux how code gets into the kernel

Release 4.13 lib/iommu-helper.c

Directory: lib
/*
 * IOMMU helper functions for the free area management
 */

#include <linux/export.h>
#include <linux/bitmap.h>
#include <linux/bug.h>


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; }

Contributors

PersonTokensPropCommitsCommitProp
FUJITA Tomonori51100.00%2100.00%
Total51100.00%2100.00%


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; }

Contributors

PersonTokensPropCommitsCommitProp
FUJITA Tomonori9380.17%250.00%
Akinobu Mita1412.07%125.00%
Sebastian Ott97.76%125.00%
Total116100.00%4100.00%

EXPORT_SYMBOL(iommu_area_alloc);

Overall Contributors

PersonTokensPropCommitsCommitProp
FUJITA Tomonori15484.62%233.33%
Akinobu Mita158.24%116.67%
Sebastian Ott94.95%116.67%
Paul Gortmaker42.20%233.33%
Total182100.00%6100.00%
Directory: lib
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.
Created with cregit.