Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
Kernel
提交
5040a918
K
Kernel
项目概览
openeuler
/
Kernel
1 年多 前同步成功
通知
8
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
K
Kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
5040a918
编写于
3月 09, 2014
作者:
D
David Woodhouse
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
iommu/vt-d: Rename 'hwdev' variables to 'dev' now that that's the norm
Signed-off-by:
N
David Woodhouse
<
David.Woodhouse@intel.com
>
上级
207e3592
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
22 addition
and
22 deletion
+22
-22
drivers/iommu/intel-iommu.c
drivers/iommu/intel-iommu.c
+22
-22
未找到文件。
drivers/iommu/intel-iommu.c
浏览文件 @
5040a918
...
...
@@ -2955,7 +2955,7 @@ static int iommu_no_mapping(struct device *dev)
return
0
;
}
static
dma_addr_t
__intel_map_single
(
struct
device
*
hw
dev
,
phys_addr_t
paddr
,
static
dma_addr_t
__intel_map_single
(
struct
device
*
dev
,
phys_addr_t
paddr
,
size_t
size
,
int
dir
,
u64
dma_mask
)
{
struct
dmar_domain
*
domain
;
...
...
@@ -2968,17 +2968,17 @@ static dma_addr_t __intel_map_single(struct device *hwdev, phys_addr_t paddr,
BUG_ON
(
dir
==
DMA_NONE
);
if
(
iommu_no_mapping
(
hw
dev
))
if
(
iommu_no_mapping
(
dev
))
return
paddr
;
domain
=
get_valid_domain_for_dev
(
hw
dev
);
domain
=
get_valid_domain_for_dev
(
dev
);
if
(
!
domain
)
return
0
;
iommu
=
domain_get_iommu
(
domain
);
size
=
aligned_nrpages
(
paddr
,
size
);
iova
=
intel_alloc_iova
(
hw
dev
,
domain
,
dma_to_mm_pfn
(
size
),
dma_mask
);
iova
=
intel_alloc_iova
(
dev
,
domain
,
dma_to_mm_pfn
(
size
),
dma_mask
);
if
(
!
iova
)
goto
error
;
...
...
@@ -3016,7 +3016,7 @@ static dma_addr_t __intel_map_single(struct device *hwdev, phys_addr_t paddr,
if
(
iova
)
__free_iova
(
&
domain
->
iovad
,
iova
);
printk
(
KERN_ERR
"Device %s request: %zx@%llx dir %d --- failed
\n
"
,
dev_name
(
hw
dev
),
size
,
(
unsigned
long
long
)
paddr
,
dir
);
dev_name
(
dev
),
size
,
(
unsigned
long
long
)
paddr
,
dir
);
return
0
;
}
...
...
@@ -3155,7 +3155,7 @@ static void intel_unmap_page(struct device *dev, dma_addr_t dev_addr,
}
}
static
void
*
intel_alloc_coherent
(
struct
device
*
hw
dev
,
size_t
size
,
static
void
*
intel_alloc_coherent
(
struct
device
*
dev
,
size_t
size
,
dma_addr_t
*
dma_handle
,
gfp_t
flags
,
struct
dma_attrs
*
attrs
)
{
...
...
@@ -3165,10 +3165,10 @@ static void *intel_alloc_coherent(struct device *hwdev, size_t size,
size
=
PAGE_ALIGN
(
size
);
order
=
get_order
(
size
);
if
(
!
iommu_no_mapping
(
hw
dev
))
if
(
!
iommu_no_mapping
(
dev
))
flags
&=
~
(
GFP_DMA
|
GFP_DMA32
);
else
if
(
hwdev
->
coherent_dma_mask
<
dma_get_required_mask
(
hw
dev
))
{
if
(
hw
dev
->
coherent_dma_mask
<
DMA_BIT_MASK
(
32
))
else
if
(
dev
->
coherent_dma_mask
<
dma_get_required_mask
(
dev
))
{
if
(
dev
->
coherent_dma_mask
<
DMA_BIT_MASK
(
32
))
flags
|=
GFP_DMA
;
else
flags
|=
GFP_DMA32
;
...
...
@@ -3179,16 +3179,16 @@ static void *intel_alloc_coherent(struct device *hwdev, size_t size,
return
NULL
;
memset
(
vaddr
,
0
,
size
);
*
dma_handle
=
__intel_map_single
(
hw
dev
,
virt_to_bus
(
vaddr
),
size
,
*
dma_handle
=
__intel_map_single
(
dev
,
virt_to_bus
(
vaddr
),
size
,
DMA_BIDIRECTIONAL
,
hw
dev
->
coherent_dma_mask
);
dev
->
coherent_dma_mask
);
if
(
*
dma_handle
)
return
vaddr
;
free_pages
((
unsigned
long
)
vaddr
,
order
);
return
NULL
;
}
static
void
intel_free_coherent
(
struct
device
*
hw
dev
,
size_t
size
,
void
*
vaddr
,
static
void
intel_free_coherent
(
struct
device
*
dev
,
size_t
size
,
void
*
vaddr
,
dma_addr_t
dma_handle
,
struct
dma_attrs
*
attrs
)
{
int
order
;
...
...
@@ -3196,11 +3196,11 @@ static void intel_free_coherent(struct device *hwdev, size_t size, void *vaddr,
size
=
PAGE_ALIGN
(
size
);
order
=
get_order
(
size
);
intel_unmap_page
(
hw
dev
,
dma_handle
,
size
,
DMA_BIDIRECTIONAL
,
NULL
);
intel_unmap_page
(
dev
,
dma_handle
,
size
,
DMA_BIDIRECTIONAL
,
NULL
);
free_pages
((
unsigned
long
)
vaddr
,
order
);
}
static
void
intel_unmap_sg
(
struct
device
*
hw
dev
,
struct
scatterlist
*
sglist
,
static
void
intel_unmap_sg
(
struct
device
*
dev
,
struct
scatterlist
*
sglist
,
int
nelems
,
enum
dma_data_direction
dir
,
struct
dma_attrs
*
attrs
)
{
...
...
@@ -3210,10 +3210,10 @@ static void intel_unmap_sg(struct device *hwdev, struct scatterlist *sglist,
struct
intel_iommu
*
iommu
;
struct
page
*
freelist
;
if
(
iommu_no_mapping
(
hw
dev
))
if
(
iommu_no_mapping
(
dev
))
return
;
domain
=
find_domain
(
hw
dev
);
domain
=
find_domain
(
dev
);
BUG_ON
(
!
domain
);
iommu
=
domain_get_iommu
(
domain
);
...
...
@@ -3257,7 +3257,7 @@ static int intel_nontranslate_map_sg(struct device *hddev,
return
nelems
;
}
static
int
intel_map_sg
(
struct
device
*
hw
dev
,
struct
scatterlist
*
sglist
,
int
nelems
,
static
int
intel_map_sg
(
struct
device
*
dev
,
struct
scatterlist
*
sglist
,
int
nelems
,
enum
dma_data_direction
dir
,
struct
dma_attrs
*
attrs
)
{
int
i
;
...
...
@@ -3271,10 +3271,10 @@ static int intel_map_sg(struct device *hwdev, struct scatterlist *sglist, int ne
struct
intel_iommu
*
iommu
;
BUG_ON
(
dir
==
DMA_NONE
);
if
(
iommu_no_mapping
(
hw
dev
))
return
intel_nontranslate_map_sg
(
hw
dev
,
sglist
,
nelems
,
dir
);
if
(
iommu_no_mapping
(
dev
))
return
intel_nontranslate_map_sg
(
dev
,
sglist
,
nelems
,
dir
);
domain
=
get_valid_domain_for_dev
(
hw
dev
);
domain
=
get_valid_domain_for_dev
(
dev
);
if
(
!
domain
)
return
0
;
...
...
@@ -3283,8 +3283,8 @@ static int intel_map_sg(struct device *hwdev, struct scatterlist *sglist, int ne
for_each_sg
(
sglist
,
sg
,
nelems
,
i
)
size
+=
aligned_nrpages
(
sg
->
offset
,
sg
->
length
);
iova
=
intel_alloc_iova
(
hw
dev
,
domain
,
dma_to_mm_pfn
(
size
),
*
hw
dev
->
dma_mask
);
iova
=
intel_alloc_iova
(
dev
,
domain
,
dma_to_mm_pfn
(
size
),
*
dev
->
dma_mask
);
if
(
!
iova
)
{
sglist
->
dma_length
=
0
;
return
0
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录