Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
kernel_linux
提交
2fc42814
K
kernel_linux
项目概览
OpenHarmony
/
kernel_linux
上一次同步 4 年多
通知
15
Star
8
Fork
2
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
K
kernel_linux
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
2fc42814
编写于
12月 04, 2009
作者:
R
Russell King
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'pending-dma-streaming' (early part) into devel
上级
c6baa196
29cb8d0d
变更
6
显示空白变更内容
内联
并排
Showing
6 changed file
with
56 addition
and
21 deletion
+56
-21
arch/arm/common/dmabounce.c
arch/arm/common/dmabounce.c
+18
-3
arch/arm/include/asm/dma-mapping.h
arch/arm/include/asm/dma-mapping.h
+14
-12
arch/arm/include/asm/memory.h
arch/arm/include/asm/memory.h
+8
-6
arch/arm/mach-iop13xx/include/mach/memory.h
arch/arm/mach-iop13xx/include/mach/memory.h
+2
-0
arch/arm/mach-ks8695/include/mach/memory.h
arch/arm/mach-ks8695/include/mach/memory.h
+7
-0
arch/arm/plat-omap/include/mach/memory.h
arch/arm/plat-omap/include/mach/memory.h
+7
-0
未找到文件。
arch/arm/common/dmabounce.c
浏览文件 @
2fc42814
...
@@ -342,6 +342,22 @@ dma_addr_t dma_map_single(struct device *dev, void *ptr, size_t size,
...
@@ -342,6 +342,22 @@ dma_addr_t dma_map_single(struct device *dev, void *ptr, size_t size,
}
}
EXPORT_SYMBOL
(
dma_map_single
);
EXPORT_SYMBOL
(
dma_map_single
);
/*
* see if a mapped address was really a "safe" buffer and if so, copy
* the data from the safe buffer back to the unsafe buffer and free up
* the safe buffer. (basically return things back to the way they
* should be)
*/
void
dma_unmap_single
(
struct
device
*
dev
,
dma_addr_t
dma_addr
,
size_t
size
,
enum
dma_data_direction
dir
)
{
dev_dbg
(
dev
,
"%s(ptr=%p,size=%d,dir=%x)
\n
"
,
__func__
,
(
void
*
)
dma_addr
,
size
,
dir
);
unmap_single
(
dev
,
dma_addr
,
size
,
dir
);
}
EXPORT_SYMBOL
(
dma_unmap_single
);
dma_addr_t
dma_map_page
(
struct
device
*
dev
,
struct
page
*
page
,
dma_addr_t
dma_map_page
(
struct
device
*
dev
,
struct
page
*
page
,
unsigned
long
offset
,
size_t
size
,
enum
dma_data_direction
dir
)
unsigned
long
offset
,
size_t
size
,
enum
dma_data_direction
dir
)
{
{
...
@@ -366,8 +382,7 @@ EXPORT_SYMBOL(dma_map_page);
...
@@ -366,8 +382,7 @@ EXPORT_SYMBOL(dma_map_page);
* the safe buffer. (basically return things back to the way they
* the safe buffer. (basically return things back to the way they
* should be)
* should be)
*/
*/
void
dma_unmap_page
(
struct
device
*
dev
,
dma_addr_t
dma_addr
,
size_t
size
,
void
dma_unmap_single
(
struct
device
*
dev
,
dma_addr_t
dma_addr
,
size_t
size
,
enum
dma_data_direction
dir
)
enum
dma_data_direction
dir
)
{
{
dev_dbg
(
dev
,
"%s(ptr=%p,size=%d,dir=%x)
\n
"
,
dev_dbg
(
dev
,
"%s(ptr=%p,size=%d,dir=%x)
\n
"
,
...
@@ -375,7 +390,7 @@ void dma_unmap_single(struct device *dev, dma_addr_t dma_addr, size_t size,
...
@@ -375,7 +390,7 @@ void dma_unmap_single(struct device *dev, dma_addr_t dma_addr, size_t size,
unmap_single
(
dev
,
dma_addr
,
size
,
dir
);
unmap_single
(
dev
,
dma_addr
,
size
,
dir
);
}
}
EXPORT_SYMBOL
(
dma_unmap_
singl
e
);
EXPORT_SYMBOL
(
dma_unmap_
pag
e
);
int
dmabounce_sync_for_cpu
(
struct
device
*
dev
,
dma_addr_t
addr
,
int
dmabounce_sync_for_cpu
(
struct
device
*
dev
,
dma_addr_t
addr
,
unsigned
long
off
,
size_t
sz
,
enum
dma_data_direction
dir
)
unsigned
long
off
,
size_t
sz
,
enum
dma_data_direction
dir
)
...
...
arch/arm/include/asm/dma-mapping.h
浏览文件 @
2fc42814
...
@@ -15,20 +15,15 @@
...
@@ -15,20 +15,15 @@
* must not be used by drivers.
* must not be used by drivers.
*/
*/
#ifndef __arch_page_to_dma
#ifndef __arch_page_to_dma
#if !defined(CONFIG_HIGHMEM)
static
inline
dma_addr_t
page_to_dma
(
struct
device
*
dev
,
struct
page
*
page
)
static
inline
dma_addr_t
page_to_dma
(
struct
device
*
dev
,
struct
page
*
page
)
{
{
return
(
dma_addr_t
)
__
virt_to_bus
((
unsigned
long
)
page_address
(
page
));
return
(
dma_addr_t
)
__
pfn_to_bus
(
page_to_pfn
(
page
));
}
}
#elif defined(__pfn_to_bus)
static
inline
dma_addr_t
page_to_dma
(
struct
device
*
dev
,
struct
page
*
page
)
static
inline
struct
page
*
dma_to_page
(
struct
device
*
dev
,
dma_addr_t
addr
)
{
{
return
(
dma_addr_t
)
__pfn_to_bus
(
page_to_pfn
(
page
));
return
pfn_to_page
(
__bus_to_pfn
(
addr
));
}
}
#else
#error "this machine class needs to define __arch_page_to_dma to use HIGHMEM"
#endif
static
inline
void
*
dma_to_virt
(
struct
device
*
dev
,
dma_addr_t
addr
)
static
inline
void
*
dma_to_virt
(
struct
device
*
dev
,
dma_addr_t
addr
)
{
{
...
@@ -45,6 +40,11 @@ static inline dma_addr_t page_to_dma(struct device *dev, struct page *page)
...
@@ -45,6 +40,11 @@ static inline dma_addr_t page_to_dma(struct device *dev, struct page *page)
return
__arch_page_to_dma
(
dev
,
page
);
return
__arch_page_to_dma
(
dev
,
page
);
}
}
static
inline
struct
page
*
dma_to_page
(
struct
device
*
dev
,
dma_addr_t
addr
)
{
return
__arch_dma_to_page
(
dev
,
addr
);
}
static
inline
void
*
dma_to_virt
(
struct
device
*
dev
,
dma_addr_t
addr
)
static
inline
void
*
dma_to_virt
(
struct
device
*
dev
,
dma_addr_t
addr
)
{
{
return
__arch_dma_to_virt
(
dev
,
addr
);
return
__arch_dma_to_virt
(
dev
,
addr
);
...
@@ -257,9 +257,11 @@ extern int dma_needs_bounce(struct device*, dma_addr_t, size_t);
...
@@ -257,9 +257,11 @@ extern int dma_needs_bounce(struct device*, dma_addr_t, size_t);
*/
*/
extern
dma_addr_t
dma_map_single
(
struct
device
*
,
void
*
,
size_t
,
extern
dma_addr_t
dma_map_single
(
struct
device
*
,
void
*
,
size_t
,
enum
dma_data_direction
);
enum
dma_data_direction
);
extern
void
dma_unmap_single
(
struct
device
*
,
dma_addr_t
,
size_t
,
enum
dma_data_direction
);
extern
dma_addr_t
dma_map_page
(
struct
device
*
,
struct
page
*
,
extern
dma_addr_t
dma_map_page
(
struct
device
*
,
struct
page
*
,
unsigned
long
,
size_t
,
enum
dma_data_direction
);
unsigned
long
,
size_t
,
enum
dma_data_direction
);
extern
void
dma_unmap_
singl
e
(
struct
device
*
,
dma_addr_t
,
size_t
,
extern
void
dma_unmap_
pag
e
(
struct
device
*
,
dma_addr_t
,
size_t
,
enum
dma_data_direction
);
enum
dma_data_direction
);
/*
/*
...
@@ -352,7 +354,6 @@ static inline void dma_unmap_single(struct device *dev, dma_addr_t handle,
...
@@ -352,7 +354,6 @@ static inline void dma_unmap_single(struct device *dev, dma_addr_t handle,
{
{
/* nothing to do */
/* nothing to do */
}
}
#endif
/* CONFIG_DMABOUNCE */
/**
/**
* dma_unmap_page - unmap a buffer previously mapped through dma_map_page()
* dma_unmap_page - unmap a buffer previously mapped through dma_map_page()
...
@@ -371,8 +372,9 @@ static inline void dma_unmap_single(struct device *dev, dma_addr_t handle,
...
@@ -371,8 +372,9 @@ static inline void dma_unmap_single(struct device *dev, dma_addr_t handle,
static
inline
void
dma_unmap_page
(
struct
device
*
dev
,
dma_addr_t
handle
,
static
inline
void
dma_unmap_page
(
struct
device
*
dev
,
dma_addr_t
handle
,
size_t
size
,
enum
dma_data_direction
dir
)
size_t
size
,
enum
dma_data_direction
dir
)
{
{
dma_unmap_single
(
dev
,
handle
,
size
,
dir
);
/* nothing to do */
}
}
#endif
/* CONFIG_DMABOUNCE */
/**
/**
* dma_sync_single_range_for_cpu
* dma_sync_single_range_for_cpu
...
...
arch/arm/include/asm/memory.h
浏览文件 @
2fc42814
...
@@ -136,6 +136,12 @@
...
@@ -136,6 +136,12 @@
#define __phys_to_pfn(paddr) ((paddr) >> PAGE_SHIFT)
#define __phys_to_pfn(paddr) ((paddr) >> PAGE_SHIFT)
#define __pfn_to_phys(pfn) ((pfn) << PAGE_SHIFT)
#define __pfn_to_phys(pfn) ((pfn) << PAGE_SHIFT)
/*
* Convert a page to/from a physical address
*/
#define page_to_phys(page) (__pfn_to_phys(page_to_pfn(page)))
#define phys_to_page(phys) (pfn_to_page(__phys_to_pfn(phys)))
#ifndef __ASSEMBLY__
#ifndef __ASSEMBLY__
/*
/*
...
@@ -196,7 +202,8 @@ static inline void *phys_to_virt(unsigned long x)
...
@@ -196,7 +202,8 @@ static inline void *phys_to_virt(unsigned long x)
#ifndef __virt_to_bus
#ifndef __virt_to_bus
#define __virt_to_bus __virt_to_phys
#define __virt_to_bus __virt_to_phys
#define __bus_to_virt __phys_to_virt
#define __bus_to_virt __phys_to_virt
#define __pfn_to_bus(x) ((x) << PAGE_SHIFT)
#define __pfn_to_bus(x) __pfn_to_phys(x)
#define __bus_to_pfn(x) __phys_to_pfn(x)
#endif
#endif
static
inline
__deprecated
unsigned
long
virt_to_bus
(
void
*
x
)
static
inline
__deprecated
unsigned
long
virt_to_bus
(
void
*
x
)
...
@@ -294,11 +301,6 @@ static inline __deprecated void *bus_to_virt(unsigned long x)
...
@@ -294,11 +301,6 @@ static inline __deprecated void *bus_to_virt(unsigned long x)
#endif
/* !CONFIG_DISCONTIGMEM */
#endif
/* !CONFIG_DISCONTIGMEM */
/*
* For BIO. "will die". Kill me when bio_to_phys() and bvec_to_phys() die.
*/
#define page_to_phys(page) (page_to_pfn(page) << PAGE_SHIFT)
/*
/*
* Optional coherency support. Currently used only by selected
* Optional coherency support. Currently used only by selected
* Intel XSC3-based systems.
* Intel XSC3-based systems.
...
...
arch/arm/mach-iop13xx/include/mach/memory.h
浏览文件 @
2fc42814
...
@@ -64,6 +64,8 @@ static inline unsigned long __lbus_to_virt(dma_addr_t x)
...
@@ -64,6 +64,8 @@ static inline unsigned long __lbus_to_virt(dma_addr_t x)
(dma_addr_t)page_to_phys(page); \
(dma_addr_t)page_to_phys(page); \
})
})
#define __arch_dma_to_page(dev, addr) phys_to_page(addr)
#endif
/* CONFIG_ARCH_IOP13XX */
#endif
/* CONFIG_ARCH_IOP13XX */
#endif
/* !ASSEMBLY */
#endif
/* !ASSEMBLY */
...
...
arch/arm/mach-ks8695/include/mach/memory.h
浏览文件 @
2fc42814
...
@@ -41,6 +41,13 @@ extern struct bus_type platform_bus_type;
...
@@ -41,6 +41,13 @@ extern struct bus_type platform_bus_type;
__dma = __dma - PHYS_OFFSET + KS8695_PCIMEM_PA; \
__dma = __dma - PHYS_OFFSET + KS8695_PCIMEM_PA; \
__dma; })
__dma; })
#define __arch_dma_to_page(dev, x) \
({ dma_addr_t __dma = x; \
if (!is_lbus_device(dev)) \
__dma += PHYS_OFFSET - KS8695_PCIMEM_PA; \
phys_to_page(__dma); \
})
#endif
#endif
#endif
#endif
...
...
arch/arm/plat-omap/include/mach/memory.h
浏览文件 @
2fc42814
...
@@ -68,6 +68,13 @@
...
@@ -68,6 +68,13 @@
__dma = __dma - PHYS_OFFSET + OMAP1510_LB_OFFSET; \
__dma = __dma - PHYS_OFFSET + OMAP1510_LB_OFFSET; \
__dma; })
__dma; })
#define __arch_dma_to_page(dev, addr) \
({ dma_addr_t __dma = addr; \
if (is_lbus_device(dev)) \
__dma += PHYS_OFFSET - OMAP1510_LB_OFFSET; \
phys_to_page(__dma); \
})
#define __arch_dma_to_virt(dev, addr) ({ (void *) (is_lbus_device(dev) ? \
#define __arch_dma_to_virt(dev, addr) ({ (void *) (is_lbus_device(dev) ? \
lbus_to_virt(addr) : \
lbus_to_virt(addr) : \
__phys_to_virt(addr)); })
__phys_to_virt(addr)); })
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录