Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
cloud-kernel
提交
202d0388
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看板
提交
202d0388
编写于
4月 01, 2005
作者:
M
Maciej W. Rozycki
提交者:
Ralf Baechle
10月 29, 2005
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Remove useless casts. Fix formatting.
Signed-off-by:
N
Ralf Baechle
<
ralf@linux-mips.org
>
上级
1b3a6e97
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
19 addition
and
12 deletion
+19
-12
arch/mips/mm/pg-sb1.c
arch/mips/mm/pg-sb1.c
+19
-12
未找到文件。
arch/mips/mm/pg-sb1.c
浏览文件 @
202d0388
...
@@ -60,7 +60,8 @@ static inline void clear_page_cpu(void *page)
...
@@ -60,7 +60,8 @@ static inline void clear_page_cpu(void *page)
" .set noreorder
\n
"
" .set noreorder
\n
"
#ifdef CONFIG_CPU_HAS_PREFETCH
#ifdef CONFIG_CPU_HAS_PREFETCH
" daddiu %0, %0, 128
\n
"
" daddiu %0, %0, 128
\n
"
" pref "
SB1_PREF_STORE_STREAMED_HINT
", -128(%0)
\n
"
/* Prefetch the first 4 lines */
" pref "
SB1_PREF_STORE_STREAMED_HINT
", -128(%0)
\n
"
/* Prefetch the first 4 lines */
" pref "
SB1_PREF_STORE_STREAMED_HINT
", -96(%0)
\n
"
" pref "
SB1_PREF_STORE_STREAMED_HINT
", -96(%0)
\n
"
" pref "
SB1_PREF_STORE_STREAMED_HINT
", -64(%0)
\n
"
" pref "
SB1_PREF_STORE_STREAMED_HINT
", -64(%0)
\n
"
" pref "
SB1_PREF_STORE_STREAMED_HINT
", -32(%0)
\n
"
" pref "
SB1_PREF_STORE_STREAMED_HINT
", -32(%0)
\n
"
...
@@ -106,7 +107,8 @@ static inline void copy_page_cpu(void *to, void *from)
...
@@ -106,7 +107,8 @@ static inline void copy_page_cpu(void *to, void *from)
#ifdef CONFIG_CPU_HAS_PREFETCH
#ifdef CONFIG_CPU_HAS_PREFETCH
" daddiu %0, %0, 128
\n
"
" daddiu %0, %0, 128
\n
"
" daddiu %1, %1, 128
\n
"
" daddiu %1, %1, 128
\n
"
" pref "
SB1_PREF_LOAD_STREAMED_HINT
", -128(%0)
\n
"
/* Prefetch the first 4 lines */
" pref "
SB1_PREF_LOAD_STREAMED_HINT
", -128(%0)
\n
"
/* Prefetch the first 4 lines */
" pref "
SB1_PREF_STORE_STREAMED_HINT
", -128(%1)
\n
"
" pref "
SB1_PREF_STORE_STREAMED_HINT
", -128(%1)
\n
"
" pref "
SB1_PREF_LOAD_STREAMED_HINT
", -96(%0)
\n
"
" pref "
SB1_PREF_LOAD_STREAMED_HINT
", -96(%0)
\n
"
" pref "
SB1_PREF_STORE_STREAMED_HINT
", -96(%1)
\n
"
" pref "
SB1_PREF_STORE_STREAMED_HINT
", -96(%1)
\n
"
...
@@ -207,15 +209,18 @@ typedef struct dmadscr_s {
...
@@ -207,15 +209,18 @@ typedef struct dmadscr_s {
u64
pad_b
;
u64
pad_b
;
}
dmadscr_t
;
}
dmadscr_t
;
static
dmadscr_t
page_descr
[
DM_NUM_CHANNELS
]
__attribute__
((
aligned
(
SMP_CACHE_BYTES
)));
static
dmadscr_t
page_descr
[
DM_NUM_CHANNELS
]
__attribute__
((
aligned
(
SMP_CACHE_BYTES
)));
void
sb1_dma_init
(
void
)
void
sb1_dma_init
(
void
)
{
{
int
i
;
int
i
;
for
(
i
=
0
;
i
<
DM_NUM_CHANNELS
;
i
++
)
{
for
(
i
=
0
;
i
<
DM_NUM_CHANNELS
;
i
++
)
{
u64
base_val
=
(
u64
)
CPHYSADDR
(
&
page_descr
[
i
])
|
V_DM_DSCR_BASE_RINGSZ
(
1
);
const
u64
base_val
=
CPHYSADDR
(
&
page_descr
[
i
])
|
void
*
base_reg
=
(
void
*
)
IOADDR
(
A_DM_REGISTER
(
i
,
R_DM_DSCR_BASE
));
V_DM_DSCR_BASE_RINGSZ
(
1
);
volatile
void
*
base_reg
=
IOADDR
(
A_DM_REGISTER
(
i
,
R_DM_DSCR_BASE
));
__raw_writeq
(
base_val
,
base_reg
);
__raw_writeq
(
base_val
,
base_reg
);
__raw_writeq
(
base_val
|
M_DM_DSCR_BASE_RESET
,
base_reg
);
__raw_writeq
(
base_val
|
M_DM_DSCR_BASE_RESET
,
base_reg
);
...
@@ -225,14 +230,15 @@ void sb1_dma_init(void)
...
@@ -225,14 +230,15 @@ void sb1_dma_init(void)
void
clear_page
(
void
*
page
)
void
clear_page
(
void
*
page
)
{
{
u64
to_phys
=
(
u64
)
CPHYSADDR
(
page
);
u64
to_phys
=
CPHYSADDR
(
page
);
unsigned
int
cpu
=
smp_processor_id
();
unsigned
int
cpu
=
smp_processor_id
();
/* if the page is not in KSEG0, use old way */
/* if the page is not in KSEG0, use old way */
if
((
long
)
KSEGX
(
page
)
!=
(
long
)
CKSEG0
)
if
((
long
)
KSEGX
(
page
)
!=
(
long
)
CKSEG0
)
return
clear_page_cpu
(
page
);
return
clear_page_cpu
(
page
);
page_descr
[
cpu
].
dscr_a
=
to_phys
|
M_DM_DSCRA_ZERO_MEM
|
M_DM_DSCRA_L2C_DEST
|
M_DM_DSCRA_INTERRUPT
;
page_descr
[
cpu
].
dscr_a
=
to_phys
|
M_DM_DSCRA_ZERO_MEM
|
M_DM_DSCRA_L2C_DEST
|
M_DM_DSCRA_INTERRUPT
;
page_descr
[
cpu
].
dscr_b
=
V_DM_DSCRB_SRC_LENGTH
(
PAGE_SIZE
);
page_descr
[
cpu
].
dscr_b
=
V_DM_DSCRB_SRC_LENGTH
(
PAGE_SIZE
);
__raw_writeq
(
1
,
IOADDR
(
A_DM_REGISTER
(
cpu
,
R_DM_DSCR_COUNT
)));
__raw_writeq
(
1
,
IOADDR
(
A_DM_REGISTER
(
cpu
,
R_DM_DSCR_COUNT
)));
...
@@ -248,8 +254,8 @@ void clear_page(void *page)
...
@@ -248,8 +254,8 @@ void clear_page(void *page)
void
copy_page
(
void
*
to
,
void
*
from
)
void
copy_page
(
void
*
to
,
void
*
from
)
{
{
u64
from_phys
=
(
u64
)
CPHYSADDR
(
from
);
u64
from_phys
=
CPHYSADDR
(
from
);
u64
to_phys
=
(
u64
)
CPHYSADDR
(
to
);
u64
to_phys
=
CPHYSADDR
(
to
);
unsigned
int
cpu
=
smp_processor_id
();
unsigned
int
cpu
=
smp_processor_id
();
/* if any page is not in KSEG0, use old way */
/* if any page is not in KSEG0, use old way */
...
@@ -257,15 +263,16 @@ void copy_page(void *to, void *from)
...
@@ -257,15 +263,16 @@ void copy_page(void *to, void *from)
||
(
long
)
KSEGX
(
from
)
!=
(
long
)
CKSEG0
)
||
(
long
)
KSEGX
(
from
)
!=
(
long
)
CKSEG0
)
return
copy_page_cpu
(
to
,
from
);
return
copy_page_cpu
(
to
,
from
);
page_descr
[
cpu
].
dscr_a
=
to_phys
|
M_DM_DSCRA_L2C_DEST
|
M_DM_DSCRA_INTERRUPT
;
page_descr
[
cpu
].
dscr_a
=
to_phys
|
M_DM_DSCRA_L2C_DEST
|
M_DM_DSCRA_INTERRUPT
;
page_descr
[
cpu
].
dscr_b
=
from_phys
|
V_DM_DSCRB_SRC_LENGTH
(
PAGE_SIZE
);
page_descr
[
cpu
].
dscr_b
=
from_phys
|
V_DM_DSCRB_SRC_LENGTH
(
PAGE_SIZE
);
__raw_writeq
(
1
,
(
void
*
)
IOADDR
(
A_DM_REGISTER
(
cpu
,
R_DM_DSCR_COUNT
)));
__raw_writeq
(
1
,
IOADDR
(
A_DM_REGISTER
(
cpu
,
R_DM_DSCR_COUNT
)));
/*
/*
* Don't really want to do it this way, but there's no
* Don't really want to do it this way, but there's no
* reliable way to delay completion detection.
* reliable way to delay completion detection.
*/
*/
while
(
!
(
__raw_readq
(
(
void
*
)
IOADDR
(
A_DM_REGISTER
(
cpu
,
R_DM_DSCR_BASE_DEBUG
)))
while
(
!
(
__raw_readq
(
IOADDR
(
A_DM_REGISTER
(
cpu
,
R_DM_DSCR_BASE_DEBUG
)))
&
M_DM_DSCR_BASE_INTERRUPT
))
&
M_DM_DSCR_BASE_INTERRUPT
))
;
;
__raw_readq
(
IOADDR
(
A_DM_REGISTER
(
cpu
,
R_DM_DSCR_BASE
)));
__raw_readq
(
IOADDR
(
A_DM_REGISTER
(
cpu
,
R_DM_DSCR_BASE
)));
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录