1 Star 0 Fork 613

denggang/cloud-kernel

forked from anolis/cloud-kernel 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
iommu-helper.c 755 Bytes
一键复制 编辑 原始数据 按行查看 历史
// SPDX-License-Identifier: GPL-2.0
/*
* IOMMU helper functions for the free area management
*/
#include <linux/bitmap.h>
#include <linux/iommu-helper.h>
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;
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C
1
https://gitee.com/gangdev/cloud-kernel.git
[email protected]:gangdev/cloud-kernel.git
gangdev
cloud-kernel
cloud-kernel
devel-4.19

搜索帮助