linux-4.4.1/iommu_unmap()
をテンプレートにして作成
[
トップ
] [
新規
|
一覧
|
検索
|
最終更新
|
ヘルプ
|
ログイン
]
開始行:
*参照元 [#cc849f98]
#backlinks
*説明 [#fc12557e]
-パス: 複数あり
--CONFIG_IOMMU_API 有効: [[linux-4.4.1/drivers/iommu/iomm...
--CONFIG_IOMMU_API 無効: [[linux-4.4.1/include/linux/iomm...
-FIXME: これは何?
--説明
**引数 [#m3ce1a8f]
-struct iommu_domain *domain
--
--[[linux-4.4.1/iommu_domain]]
-unsigned long iova
--
-size_t size
--
**返り値 [#c0c5f8d8]
-size_t
--
**参考 [#ob674011]
map
-[[linux-4.4.1/iommu_map()]]
*実装 [#vfa8a87c]
**CONFIG_IOMMU_API 有効: [[linux-4.4.1/drivers/iommu/iomm...
size_t iommu_unmap(struct iommu_domain *domain, unsigned...
{
size_t unmapped_page, unmapped = 0;
unsigned int min_pagesz;
unsigned long orig_iova = iova;
if (unlikely(domain->ops->unmap == NULL ||
domain->ops->pgsize_bitmap == 0UL))
return -ENODEV;
if (unlikely(!(domain->type & __IOMMU_DOMAIN_PAGING)))
return -EINVAL;
-
--domain->ops は const struct iommu_ops * 型
--[[linux-4.4.1/iommu_ops]]
--[[linux-4.4.1/unlikely()]]
/* find out the minimum page size supported */
min_pagesz = 1 << __ffs(domain->ops->pgsize_bitmap);
-
--[[linux-4.4.1/__ffs()]]
/*
* The virtual address, as well as the size of the mapp...
* aligned (at least) to the size of the smallest page ...
* by the hardware
*/
if (!IS_ALIGNED(iova | size, min_pagesz)) {
pr_err("unaligned: iova 0x%lx size 0x%zx min_pagesz 0x...
iova, size, min_pagesz);
return -EINVAL;
}
pr_debug("unmap this: iova 0x%lx size 0x%zx\n", iova, s...
-
--[[linux-4.4.1/IS_ALIGNED()]]
--[[linux-4.4.1/pr_err()]]
--[[linux-4.4.1/pr_debug()]]
/*
* Keep iterating until we either unmap 'size' bytes (o...
* or we hit an area that isn't mapped.
*/
while (unmapped < size) {
size_t pgsize = iommu_pgsize(domain, iova, size - unma...
unmapped_page = domain->ops->unmap(domain, iova, pgsiz...
if (!unmapped_page)
break;
-
--domain->ops は const struct iommu_ops * 型
--[[linux-4.4.1/iommu_ops]]
--[[linux-4.4.1/iommu_pgsize()]]
pr_debug("unmapped: iova 0x%lx size 0x%zx\n",
iova, unmapped_page);
iova += unmapped_page;
unmapped += unmapped_page;
}
trace_unmap(orig_iova, size, unmapped);
return unmapped;
-
--[[linux-4.4.1/trace_unmap()]]
}
EXPORT_SYMBOL_GPL(iommu_unmap);
-
--[[linux-4.4.1/EXPORT_SYMBOL_GPL()]]
**CONFIG_IOMMU_API 無効: [[linux-4.4.1/include/linux/iomm...
static inline int iommu_unmap(struct iommu_domain *domai...
int gfp_order)
{
return -ENODEV;
}
*コメント [#a2d0d857]
終了行:
*参照元 [#cc849f98]
#backlinks
*説明 [#fc12557e]
-パス: 複数あり
--CONFIG_IOMMU_API 有効: [[linux-4.4.1/drivers/iommu/iomm...
--CONFIG_IOMMU_API 無効: [[linux-4.4.1/include/linux/iomm...
-FIXME: これは何?
--説明
**引数 [#m3ce1a8f]
-struct iommu_domain *domain
--
--[[linux-4.4.1/iommu_domain]]
-unsigned long iova
--
-size_t size
--
**返り値 [#c0c5f8d8]
-size_t
--
**参考 [#ob674011]
map
-[[linux-4.4.1/iommu_map()]]
*実装 [#vfa8a87c]
**CONFIG_IOMMU_API 有効: [[linux-4.4.1/drivers/iommu/iomm...
size_t iommu_unmap(struct iommu_domain *domain, unsigned...
{
size_t unmapped_page, unmapped = 0;
unsigned int min_pagesz;
unsigned long orig_iova = iova;
if (unlikely(domain->ops->unmap == NULL ||
domain->ops->pgsize_bitmap == 0UL))
return -ENODEV;
if (unlikely(!(domain->type & __IOMMU_DOMAIN_PAGING)))
return -EINVAL;
-
--domain->ops は const struct iommu_ops * 型
--[[linux-4.4.1/iommu_ops]]
--[[linux-4.4.1/unlikely()]]
/* find out the minimum page size supported */
min_pagesz = 1 << __ffs(domain->ops->pgsize_bitmap);
-
--[[linux-4.4.1/__ffs()]]
/*
* The virtual address, as well as the size of the mapp...
* aligned (at least) to the size of the smallest page ...
* by the hardware
*/
if (!IS_ALIGNED(iova | size, min_pagesz)) {
pr_err("unaligned: iova 0x%lx size 0x%zx min_pagesz 0x...
iova, size, min_pagesz);
return -EINVAL;
}
pr_debug("unmap this: iova 0x%lx size 0x%zx\n", iova, s...
-
--[[linux-4.4.1/IS_ALIGNED()]]
--[[linux-4.4.1/pr_err()]]
--[[linux-4.4.1/pr_debug()]]
/*
* Keep iterating until we either unmap 'size' bytes (o...
* or we hit an area that isn't mapped.
*/
while (unmapped < size) {
size_t pgsize = iommu_pgsize(domain, iova, size - unma...
unmapped_page = domain->ops->unmap(domain, iova, pgsiz...
if (!unmapped_page)
break;
-
--domain->ops は const struct iommu_ops * 型
--[[linux-4.4.1/iommu_ops]]
--[[linux-4.4.1/iommu_pgsize()]]
pr_debug("unmapped: iova 0x%lx size 0x%zx\n",
iova, unmapped_page);
iova += unmapped_page;
unmapped += unmapped_page;
}
trace_unmap(orig_iova, size, unmapped);
return unmapped;
-
--[[linux-4.4.1/trace_unmap()]]
}
EXPORT_SYMBOL_GPL(iommu_unmap);
-
--[[linux-4.4.1/EXPORT_SYMBOL_GPL()]]
**CONFIG_IOMMU_API 無効: [[linux-4.4.1/include/linux/iomm...
static inline int iommu_unmap(struct iommu_domain *domai...
int gfp_order)
{
return -ENODEV;
}
*コメント [#a2d0d857]
ページ名: