cregit-Linux how code gets into the kernel

Release 4.16 lib/iommu-helper.c

Directory: lib
// SPDX-License-Identifier: GPL-2.0
/*
 * 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 Tomonori9481.03%250.00%
Akinobu Mita1311.21%125.00%
Sebastian Ott97.76%125.00%
Total116100.00%4100.00%

EXPORT_SYMBOL(iommu_area_alloc);

Overall Contributors

PersonTokensPropCommitsCommitProp
FUJITA Tomonori15484.15%228.57%
Akinobu Mita158.20%114.29%
Sebastian Ott94.92%114.29%
Paul Gortmaker42.19%228.57%
Greg Kroah-Hartman10.55%114.29%
Total183100.00%7100.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.