Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
cloud-kernel
提交
2638b4db
cloud-kernel
项目概览
openanolis
/
cloud-kernel
1 年多 前同步成功
通知
160
Star
36
Fork
7
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
10
列表
看板
标记
里程碑
合并请求
2
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
cloud-kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
10
Issue
10
列表
看板
标记
里程碑
合并请求
2
合并请求
2
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
2638b4db
编写于
9月 25, 2008
作者:
R
Russell King
提交者:
Russell King
9月 29, 2008
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[ARM] dma: Reduce to one dma_sync_sg_* implementation
Signed-off-by:
N
Russell King
<
rmk+kernel@arm.linux.org.uk
>
上级
01135d92
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
31 addition
and
38 deletion
+31
-38
arch/arm/common/dmabounce.c
arch/arm/common/dmabounce.c
+12
-36
arch/arm/include/asm/dma-mapping.h
arch/arm/include/asm/dma-mapping.h
+11
-0
arch/arm/mm/dma-mapping.c
arch/arm/mm/dma-mapping.c
+8
-2
未找到文件。
arch/arm/common/dmabounce.c
浏览文件 @
2638b4db
...
...
@@ -468,45 +468,23 @@ void dma_sync_single_range_for_device(struct device *dev, dma_addr_t dma_addr,
}
EXPORT_SYMBOL
(
dma_sync_single_range_for_device
);
void
dma_sync_sg_for_cpu
(
struct
device
*
dev
,
struct
scatterlist
*
sg
,
int
nents
,
enum
dma_data_direction
dir
)
int
dmabounce_sync_for_cpu
(
struct
device
*
dev
,
dma_addr_t
addr
,
unsigned
long
off
,
size_t
sz
,
enum
dma_data_direction
dir
)
{
struct
scatterlist
*
s
;
int
i
;
dev_dbg
(
dev
,
"%s(sg=%p,nents=%d,dir=%x)
\n
"
,
__func__
,
sg
,
nents
,
dir
);
BUG_ON
(
dir
==
DMA_NONE
);
for_each_sg
(
sg
,
s
,
nents
,
i
)
{
dma_addr_t
dma_addr
=
s
->
dma_address
;
unsigned
int
length
=
s
->
length
;
sync_single
(
dev
,
dma_addr
,
length
,
dir
);
}
dev_dbg
(
dev
,
"%s(dma=%#lx,off=%#lx,sz=%zx,dir=%x)
\n
"
,
__func__
,
addr
,
off
,
sz
,
dir
);
return
sync_single
(
dev
,
addr
,
off
+
sz
,
dir
);
}
EXPORT_SYMBOL
(
dmabounce_sync_for_cpu
);
void
dma_sync_sg_for_device
(
struct
device
*
dev
,
struct
scatterlist
*
sg
,
int
nents
,
enum
dma_data_direction
dir
)
int
dmabounce_sync_for_device
(
struct
device
*
dev
,
dma_addr_t
addr
,
unsigned
long
off
,
size_t
sz
,
enum
dma_data_direction
dir
)
{
struct
scatterlist
*
s
;
int
i
;
dev_dbg
(
dev
,
"%s(sg=%p,nents=%d,dir=%x)
\n
"
,
__func__
,
sg
,
nents
,
dir
);
BUG_ON
(
dir
==
DMA_NONE
);
for_each_sg
(
sg
,
s
,
nents
,
i
)
{
dma_addr_t
dma_addr
=
s
->
dma_address
;
unsigned
int
length
=
s
->
length
;
sync_single
(
dev
,
dma_addr
,
length
,
dir
);
}
dev_dbg
(
dev
,
"%s(dma=%#lx,off=%#lx,sz=%zx,dir=%x)
\n
"
,
__func__
,
addr
,
off
,
sz
,
dir
);
return
sync_single
(
dev
,
addr
,
off
+
sz
,
dir
);
}
EXPORT_SYMBOL
(
dmabounce_sync_for_device
);
static
int
dmabounce_init_pool
(
struct
dmabounce_pool
*
pool
,
struct
device
*
dev
,
const
char
*
name
,
...
...
@@ -618,8 +596,6 @@ dmabounce_unregister_dev(struct device *dev)
EXPORT_SYMBOL
(
dma_map_single
);
EXPORT_SYMBOL
(
dma_unmap_single
);
EXPORT_SYMBOL
(
dma_sync_sg_for_cpu
);
EXPORT_SYMBOL
(
dma_sync_sg_for_device
);
EXPORT_SYMBOL
(
dmabounce_register_dev
);
EXPORT_SYMBOL
(
dmabounce_unregister_dev
);
...
...
arch/arm/include/asm/dma-mapping.h
浏览文件 @
2638b4db
...
...
@@ -410,6 +410,17 @@ extern void dmabounce_unregister_dev(struct device *);
*
*/
extern
int
dma_needs_bounce
(
struct
device
*
,
dma_addr_t
,
size_t
);
/*
* Private functions
*/
int
dmabounce_sync_for_cpu
(
struct
device
*
,
dma_addr_t
,
unsigned
long
,
size_t
,
enum
dma_data_direction
);
int
dmabounce_sync_for_device
(
struct
device
*
,
dma_addr_t
,
unsigned
long
,
size_t
,
enum
dma_data_direction
);
#else
#define dmabounce_sync_for_cpu(dev,dma,off,sz,dir) (1)
#define dmabounce_sync_for_device(dev,dma,off,sz,dir) (1)
#endif
/* CONFIG_DMABOUNCE */
#endif
/* __KERNEL__ */
...
...
arch/arm/mm/dma-mapping.c
浏览文件 @
2638b4db
...
...
@@ -571,7 +571,6 @@ void dma_unmap_sg(struct device *dev, struct scatterlist *sg, int nents,
}
EXPORT_SYMBOL
(
dma_unmap_sg
);
#ifndef CONFIG_DMABOUNCE
/**
* dma_sync_sg_for_cpu
* @dev: valid struct device pointer, or NULL for ISA and EISA-like devices
...
...
@@ -586,6 +585,10 @@ void dma_sync_sg_for_cpu(struct device *dev, struct scatterlist *sg,
int
i
;
for_each_sg
(
sg
,
s
,
nents
,
i
)
{
if
(
!
dmabounce_sync_for_cpu
(
dev
,
sg_dma_address
(
s
),
0
,
sg_dma_len
(
s
),
dir
))
continue
;
if
(
!
arch_is_coherent
())
dma_cache_maint
(
sg_virt
(
s
),
s
->
length
,
dir
);
}
...
...
@@ -606,9 +609,12 @@ void dma_sync_sg_for_device(struct device *dev, struct scatterlist *sg,
int
i
;
for_each_sg
(
sg
,
s
,
nents
,
i
)
{
if
(
!
dmabounce_sync_for_device
(
dev
,
sg_dma_address
(
s
),
0
,
sg_dma_len
(
s
),
dir
))
continue
;
if
(
!
arch_is_coherent
())
dma_cache_maint
(
sg_virt
(
s
),
s
->
length
,
dir
);
}
}
EXPORT_SYMBOL
(
dma_sync_sg_for_device
);
#endif
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录