Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
raspberrypi-kernel
提交
541c5477
R
raspberrypi-kernel
项目概览
openeuler
/
raspberrypi-kernel
通知
13
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
raspberrypi-kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
541c5477
编写于
11月 08, 2007
作者:
P
Paul Mundt
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'page_colouring_despair'
上级
6d1c76d4
af39c16b
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
73 addition
and
137 deletion
+73
-137
arch/sh/mm/clear_page.S
arch/sh/mm/clear_page.S
+0
-45
arch/sh/mm/copy_page.S
arch/sh/mm/copy_page.S
+0
-61
arch/sh/mm/pg-sh4.c
arch/sh/mm/pg-sh4.c
+52
-23
include/asm-sh/cacheflush.h
include/asm-sh/cacheflush.h
+14
-4
include/asm-sh/page.h
include/asm-sh/page.h
+7
-4
未找到文件。
arch/sh/mm/clear_page.S
浏览文件 @
541c5477
...
...
@@ -150,48 +150,3 @@ ENTRY(__clear_user)
.
long
8
b
,
.
Lbad_clear_user
.
long
9
b
,
.
Lbad_clear_user
.
previous
#if defined(CONFIG_CPU_SH4)
/*
*
__clear_user_page
*
@
to
:
P3
address
(
with
same
color
)
*
@
orig_to
:
P1
address
*
*
void
__clear_user_page
(
void
*
to
,
void
*
orig_to
)
*/
/*
*
r0
---
scratch
*
r4
---
to
*
r5
---
orig_to
*
r6
---
to
+
PAGE_SIZE
*/
ENTRY
(
__clear_user_page
)
mov.l
.
Lpsz
,
r0
mov
r4
,
r6
add
r0
,
r6
mov
#
0
,
r0
!
1
:
ocbi
@
r5
add
#
32
,
r5
movca.l
r0
,
@
r4
mov
r4
,
r1
add
#
32
,
r4
mov.l
r0
,
@
-
r4
mov.l
r0
,
@
-
r4
mov.l
r0
,
@
-
r4
mov.l
r0
,
@
-
r4
mov.l
r0
,
@
-
r4
mov.l
r0
,
@
-
r4
mov.l
r0
,
@
-
r4
add
#
28
,
r4
cmp
/
eq
r6
,
r4
bf
/
s
1
b
ocbwb
@
r1
!
rts
nop
.
Lpsz
:
.
long
PAGE_SIZE
#endif
arch/sh/mm/copy_page.S
浏览文件 @
541c5477
...
...
@@ -68,67 +68,6 @@ ENTRY(copy_page_slow)
rts
nop
#if defined(CONFIG_CPU_SH4)
/*
*
__copy_user_page
*
@
to
:
P1
address
(
with
same
color
)
*
@
from
:
P1
address
*
@
orig_to
:
P1
address
*
*
void
__copy_user_page
(
void
*
to
,
void
*
from
,
void
*
orig_to
)
*/
/*
*
r0
,
r1
,
r2
,
r3
,
r4
,
r5
,
r6
,
r7
---
scratch
*
r8
---
from
+
PAGE_SIZE
*
r9
---
orig_to
*
r10
---
to
*
r11
---
from
*/
ENTRY
(
__copy_user_page
)
mov.l
r8
,
@
-
r15
mov.l
r9
,
@
-
r15
mov.l
r10
,
@
-
r15
mov.l
r11
,
@
-
r15
mov
r4
,
r10
mov
r5
,
r11
mov
r6
,
r9
mov
r5
,
r8
mov.l
.
Lpsz
,
r0
add
r0
,
r8
!
1
:
ocbi
@
r9
add
#
32
,
r9
mov.l
@
r11
+,
r0
mov.l
@
r11
+,
r1
mov.l
@
r11
+,
r2
mov.l
@
r11
+,
r3
mov.l
@
r11
+,
r4
mov.l
@
r11
+,
r5
mov.l
@
r11
+,
r6
mov.l
@
r11
+,
r7
movca.l
r0
,
@
r10
mov
r10
,
r0
add
#
32
,
r10
mov.l
r7
,
@
-
r10
mov.l
r6
,
@
-
r10
mov.l
r5
,
@
-
r10
mov.l
r4
,
@
-
r10
mov.l
r3
,
@
-
r10
mov.l
r2
,
@
-
r10
mov.l
r1
,
@
-
r10
ocbwb
@
r0
cmp
/
eq
r11
,
r8
bf
/
s
1
b
add
#
28
,
r10
!
mov.l
@
r15
+,
r11
mov.l
@
r15
+,
r10
mov.l
@
r15
+,
r9
mov.l
@
r15
+,
r8
rts
nop
#endif
.
align
2
.
Lpsz
:
.
long
PAGE_SIZE
/*
...
...
arch/sh/mm/pg-sh4.c
浏览文件 @
541c5477
...
...
@@ -9,6 +9,8 @@
#include <linux/mm.h>
#include <linux/mutex.h>
#include <linux/fs.h>
#include <linux/highmem.h>
#include <linux/module.h>
#include <asm/mmu_context.h>
#include <asm/cacheflush.h>
...
...
@@ -50,34 +52,61 @@ static inline void kunmap_coherent(struct page *page)
void
clear_user_page
(
void
*
to
,
unsigned
long
address
,
struct
page
*
page
)
{
__set_bit
(
PG_mapped
,
&
page
->
flags
);
if
(((
address
^
(
unsigned
long
)
to
)
&
CACHE_ALIAS
)
==
0
)
clear_page
(
to
);
else
{
void
*
vto
=
kmap_coherent
(
page
,
address
);
__clear_user_page
(
vto
,
to
);
kunmap_coherent
(
vto
);
}
clear_page
(
to
);
if
((((
address
&
PAGE_MASK
)
^
(
unsigned
long
)
to
)
&
CACHE_ALIAS
))
__flush_wback_region
(
to
,
PAGE_SIZE
);
}
/*
* copy_user_page
* @to: P1 address
* @from: P1 address
* @address: U0 address to be mapped
* @page: page (virt_to_page(to))
*/
void
copy_user_page
(
void
*
to
,
void
*
from
,
unsigned
long
address
,
struct
page
*
page
)
void
copy_to_user_page
(
struct
vm_area_struct
*
vma
,
struct
page
*
page
,
unsigned
long
vaddr
,
void
*
dst
,
const
void
*
src
,
unsigned
long
len
)
{
void
*
vto
;
__set_bit
(
PG_mapped
,
&
page
->
flags
);
if
(((
address
^
(
unsigned
long
)
to
)
&
CACHE_ALIAS
)
==
0
)
copy_page
(
to
,
from
);
else
{
void
*
vfrom
=
kmap_coherent
(
page
,
address
);
__copy_user_page
(
vfrom
,
from
,
to
);
kunmap_coherent
(
vfrom
);
}
vto
=
kmap_coherent
(
page
,
vaddr
)
+
(
vaddr
&
~
PAGE_MASK
);
memcpy
(
vto
,
src
,
len
);
kunmap_coherent
(
vto
);
if
(
vma
->
vm_flags
&
VM_EXEC
)
flush_cache_page
(
vma
,
vaddr
,
page_to_pfn
(
page
));
}
void
copy_from_user_page
(
struct
vm_area_struct
*
vma
,
struct
page
*
page
,
unsigned
long
vaddr
,
void
*
dst
,
const
void
*
src
,
unsigned
long
len
)
{
void
*
vfrom
;
__set_bit
(
PG_mapped
,
&
page
->
flags
);
vfrom
=
kmap_coherent
(
page
,
vaddr
)
+
(
vaddr
&
~
PAGE_MASK
);
memcpy
(
dst
,
vfrom
,
len
);
kunmap_coherent
(
vfrom
);
}
void
copy_user_highpage
(
struct
page
*
to
,
struct
page
*
from
,
unsigned
long
vaddr
,
struct
vm_area_struct
*
vma
)
{
void
*
vfrom
,
*
vto
;
__set_bit
(
PG_mapped
,
&
to
->
flags
);
vto
=
kmap_atomic
(
to
,
KM_USER1
);
vfrom
=
kmap_coherent
(
from
,
vaddr
);
copy_page
(
vto
,
vfrom
);
kunmap_coherent
(
vfrom
);
if
(((
vaddr
^
(
unsigned
long
)
vto
)
&
CACHE_ALIAS
))
__flush_wback_region
(
vto
,
PAGE_SIZE
);
kunmap_atomic
(
vto
,
KM_USER1
);
/* Make sure this page is cleared on other CPU's too before using it */
smp_wmb
();
}
EXPORT_SYMBOL
(
copy_user_highpage
);
/*
* For SH-4, we have our own implementation for ptep_get_and_clear
...
...
include/asm-sh/cacheflush.h
浏览文件 @
541c5477
...
...
@@ -43,21 +43,31 @@ extern void __flush_purge_region(void *start, int size);
extern
void
__flush_invalidate_region
(
void
*
start
,
int
size
);
#endif
#define flush_cache_vmap(start, end) flush_cache_all()
#define flush_cache_vunmap(start, end) flush_cache_all()
#ifdef CONFIG_CPU_SH4
extern
void
copy_to_user_page
(
struct
vm_area_struct
*
vma
,
struct
page
*
page
,
unsigned
long
vaddr
,
void
*
dst
,
const
void
*
src
,
unsigned
long
len
);
#define copy_to_user_page(vma, page, vaddr, dst, src, len) \
extern
void
copy_from_user_page
(
struct
vm_area_struct
*
vma
,
struct
page
*
page
,
unsigned
long
vaddr
,
void
*
dst
,
const
void
*
src
,
unsigned
long
len
);
#else
#define copy_to_user_page(vma, page, vaddr, dst, src, len) \
do { \
flush_cache_page(vma, vaddr, page_to_pfn(page));\
memcpy(dst, src, len); \
flush_icache_user_range(vma, page, vaddr, len); \
} while (0)
#define copy_from_user_page(vma, page, vaddr, dst, src, len)
\
#define copy_from_user_page(vma, page, vaddr, dst, src, len)
\
do { \
flush_cache_page(vma, vaddr, page_to_pfn(page));\
memcpy(dst, src, len); \
} while (0)
#endif
#define flush_cache_vmap(start, end) flush_cache_all()
#define flush_cache_vunmap(start, end) flush_cache_all()
#define HAVE_ARCH_UNMAPPED_AREA
...
...
include/asm-sh/page.h
浏览文件 @
541c5477
...
...
@@ -73,10 +73,13 @@ extern void copy_page_nommu(void *to, void *from);
#if !defined(CONFIG_CACHE_OFF) && defined(CONFIG_MMU) && \
(defined(CONFIG_CPU_SH4) || defined(CONFIG_SH7705_CACHE_32KB))
struct
page
;
extern
void
clear_user_page
(
void
*
to
,
unsigned
long
address
,
struct
page
*
pg
);
extern
void
copy_user_page
(
void
*
to
,
void
*
from
,
unsigned
long
address
,
struct
page
*
pg
);
extern
void
__clear_user_page
(
void
*
to
,
void
*
orig_to
);
extern
void
__copy_user_page
(
void
*
to
,
void
*
from
,
void
*
orig_to
);
struct
vm_area_struct
;
extern
void
clear_user_page
(
void
*
to
,
unsigned
long
address
,
struct
page
*
page
);
#ifdef CONFIG_CPU_SH4
extern
void
copy_user_highpage
(
struct
page
*
to
,
struct
page
*
from
,
unsigned
long
vaddr
,
struct
vm_area_struct
*
vma
);
#define __HAVE_ARCH_COPY_USER_HIGHPAGE
#endif
#else
#define clear_user_page(page, vaddr, pg) clear_page(page)
#define copy_user_page(to, from, vaddr, pg) copy_page(to, from)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录