Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
BaiXuePrincess
rt-thread
提交
a3a0bda9
R
rt-thread
项目概览
BaiXuePrincess
/
rt-thread
与 Fork 源项目一致
Fork自
RT-Thread / rt-thread
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
rt-thread
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
未验证
提交
a3a0bda9
编写于
11月 22, 2017
作者:
B
Bernard Xiong
提交者:
GitHub
11月 22, 2017
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #1025 from SummerGGift/1122_patch
[libcpu] add volatile for asm (" mcr ") or asm (" mrc ") instruct.
上级
3be8cfa2
eb72d191
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
166 addition
and
166 deletion
+166
-166
libcpu/arm/am335x/mmu.c
libcpu/arm/am335x/mmu.c
+42
-42
libcpu/arm/armv6/mmu.c
libcpu/arm/armv6/mmu.c
+45
-45
libcpu/arm/dm36x/mmu.c
libcpu/arm/dm36x/mmu.c
+45
-45
libcpu/arm/s3c24x0/mmu.c
libcpu/arm/s3c24x0/mmu.c
+34
-34
未找到文件。
libcpu/arm/am335x/mmu.c
浏览文件 @
a3a0bda9
...
...
@@ -48,13 +48,13 @@ void mmu_setttbase(rt_uint32_t i)
* set by page table entry
*/
value
=
0
;
__asm
__asm
volatile
{
mcr
p15
,
0
,
value
,
c8
,
c7
,
0
}
value
=
0x55555555
;
__asm
__asm
volatile
{
mcr
p15
,
0
,
value
,
c3
,
c0
,
0
mcr
p15
,
0
,
i
,
c2
,
c0
,
0
...
...
@@ -63,7 +63,7 @@ void mmu_setttbase(rt_uint32_t i)
void
mmu_set_domain
(
rt_uint32_t
i
)
{
__asm
__asm
volatile
{
mcr
p15
,
0
,
i
,
c3
,
c0
,
0
}
...
...
@@ -73,7 +73,7 @@ void mmu_enable()
{
register
rt_uint32_t
value
;
__asm
__asm
volatile
{
mrc
p15
,
0
,
value
,
c1
,
c0
,
0
orr
value
,
value
,
#
0x01
...
...
@@ -85,7 +85,7 @@ void mmu_disable()
{
register
rt_uint32_t
value
;
__asm
__asm
volatile
{
mrc
p15
,
0
,
value
,
c1
,
c0
,
0
bic
value
,
value
,
#
0x01
...
...
@@ -97,7 +97,7 @@ void mmu_enable_icache()
{
register
rt_uint32_t
value
;
__asm
__asm
volatile
{
mrc
p15
,
0
,
value
,
c1
,
c0
,
0
orr
value
,
value
,
#
0x1000
...
...
@@ -109,7 +109,7 @@ void mmu_enable_dcache()
{
register
rt_uint32_t
value
;
__asm
__asm
volatile
{
mrc
p15
,
0
,
value
,
c1
,
c0
,
0
orr
value
,
value
,
#
0x04
...
...
@@ -121,7 +121,7 @@ void mmu_disable_icache()
{
register
rt_uint32_t
value
;
__asm
__asm
volatile
{
mrc
p15
,
0
,
value
,
c1
,
c0
,
0
bic
value
,
value
,
#
0x1000
...
...
@@ -133,7 +133,7 @@ void mmu_disable_dcache()
{
register
rt_uint32_t
value
;
__asm
__asm
volatile
{
mrc
p15
,
0
,
value
,
c1
,
c0
,
0
bic
value
,
value
,
#
0x04
...
...
@@ -145,7 +145,7 @@ void mmu_enable_alignfault()
{
register
rt_uint32_t
value
;
__asm
__asm
volatile
{
mrc
p15
,
0
,
value
,
c1
,
c0
,
0
orr
value
,
value
,
#
0x02
...
...
@@ -157,7 +157,7 @@ void mmu_disable_alignfault()
{
register
rt_uint32_t
value
;
__asm
__asm
volatile
{
mrc
p15
,
0
,
value
,
c1
,
c0
,
0
bic
value
,
value
,
#
0x02
...
...
@@ -167,7 +167,7 @@ void mmu_disable_alignfault()
void
mmu_clean_invalidated_cache_index
(
int
index
)
{
__asm
__asm
volatile
{
mcr
p15
,
0
,
index
,
c7
,
c14
,
2
}
...
...
@@ -181,7 +181,7 @@ void mmu_clean_invalidated_dcache(rt_uint32_t buffer, rt_uint32_t size)
while
(
ptr
<
buffer
+
size
)
{
__asm
__asm
volatile
{
MCR
p15
,
0
,
ptr
,
c7
,
c14
,
1
}
...
...
@@ -197,7 +197,7 @@ void mmu_clean_dcache(rt_uint32_t buffer, rt_uint32_t size)
while
(
ptr
<
buffer
+
size
)
{
__asm
__asm
volatile
{
MCR
p15
,
0
,
ptr
,
c7
,
c10
,
1
}
...
...
@@ -213,7 +213,7 @@ void mmu_invalidate_dcache(rt_uint32_t buffer, rt_uint32_t size)
while
(
ptr
<
buffer
+
size
)
{
__asm
__asm
volatile
{
MCR
p15
,
0
,
ptr
,
c7
,
c6
,
1
}
...
...
@@ -226,7 +226,7 @@ void mmu_invalidate_tlb()
register
rt_uint32_t
value
;
value
=
0
;
__asm
__asm
volatile
{
mcr
p15
,
0
,
value
,
c8
,
c7
,
0
}
...
...
@@ -238,7 +238,7 @@ void mmu_invalidate_icache()
value
=
0
;
__asm
__asm
volatile
{
mcr
p15
,
0
,
value
,
c7
,
c5
,
0
}
...
...
@@ -255,16 +255,16 @@ void mmu_setttbase(register rt_uint32_t i)
* set by page table entry
*/
value
=
0
;
asm
(
"mcr p15, 0, %0, c8, c7, 0"
::
"r"
(
value
));
asm
volatile
(
"mcr p15, 0, %0, c8, c7, 0"
::
"r"
(
value
));
value
=
0x55555555
;
asm
(
"mcr p15, 0, %0, c3, c0, 0"
::
"r"
(
value
));
asm
(
"mcr p15, 0, %0, c2, c0, 0"
::
"r"
(
i
));
asm
volatile
(
"mcr p15, 0, %0, c3, c0, 0"
::
"r"
(
value
));
asm
volatile
(
"mcr p15, 0, %0, c2, c0, 0"
::
"r"
(
i
));
}
void
mmu_set_domain
(
register
rt_uint32_t
i
)
{
asm
(
"mcr p15,0, %0, c3, c0, 0"
:
:
"r"
(
i
));
asm
volatile
(
"mcr p15,0, %0, c3, c0, 0"
:
:
"r"
(
i
));
}
void
mmu_enable
()
...
...
@@ -272,12 +272,12 @@ void mmu_enable()
register
rt_uint32_t
i
;
/* read control register */
asm
(
"mrc p15, 0, %0, c1, c0, 0"
:
"=r"
(
i
));
asm
volatile
(
"mrc p15, 0, %0, c1, c0, 0"
:
"=r"
(
i
));
i
|=
0x1
;
/* write back to control register */
asm
(
"mcr p15, 0, %0, c1, c0, 0"
:
:
"r"
(
i
));
asm
volatile
(
"mcr p15, 0, %0, c1, c0, 0"
:
:
"r"
(
i
));
}
void
mmu_disable
()
...
...
@@ -285,12 +285,12 @@ void mmu_disable()
register
rt_uint32_t
i
;
/* read control register */
asm
(
"mrc p15, 0, %0, c1, c0, 0"
:
"=r"
(
i
));
asm
volatile
(
"mrc p15, 0, %0, c1, c0, 0"
:
"=r"
(
i
));
i
&=
~
0x1
;
/* write back to control register */
asm
(
"mcr p15, 0, %0, c1, c0, 0"
:
:
"r"
(
i
));
asm
volatile
(
"mcr p15, 0, %0, c1, c0, 0"
:
:
"r"
(
i
));
}
void
mmu_enable_icache
()
...
...
@@ -298,12 +298,12 @@ void mmu_enable_icache()
register
rt_uint32_t
i
;
/* read control register */
asm
(
"mrc p15, 0, %0, c1, c0, 0"
:
"=r"
(
i
));
asm
volatile
(
"mrc p15, 0, %0, c1, c0, 0"
:
"=r"
(
i
));
i
|=
(
1
<<
12
);
/* write back to control register */
asm
(
"mcr p15, 0, %0, c1, c0, 0"
:
:
"r"
(
i
));
asm
volatile
(
"mcr p15, 0, %0, c1, c0, 0"
:
:
"r"
(
i
));
}
void
mmu_enable_dcache
()
...
...
@@ -311,12 +311,12 @@ void mmu_enable_dcache()
register
rt_uint32_t
i
;
/* read control register */
asm
(
"mrc p15, 0, %0, c1, c0, 0"
:
"=r"
(
i
));
asm
volatile
(
"mrc p15, 0, %0, c1, c0, 0"
:
"=r"
(
i
));
i
|=
(
1
<<
2
);
/* write back to control register */
asm
(
"mcr p15, 0, %0, c1, c0, 0"
:
:
"r"
(
i
));
asm
volatile
(
"mcr p15, 0, %0, c1, c0, 0"
:
:
"r"
(
i
));
}
void
mmu_disable_icache
()
...
...
@@ -324,12 +324,12 @@ void mmu_disable_icache()
register
rt_uint32_t
i
;
/* read control register */
asm
(
"mrc p15, 0, %0, c1, c0, 0"
:
"=r"
(
i
));
asm
volatile
(
"mrc p15, 0, %0, c1, c0, 0"
:
"=r"
(
i
));
i
&=
~
(
1
<<
12
);
/* write back to control register */
asm
(
"mcr p15, 0, %0, c1, c0, 0"
:
:
"r"
(
i
));
asm
volatile
(
"mcr p15, 0, %0, c1, c0, 0"
:
:
"r"
(
i
));
}
void
mmu_disable_dcache
()
...
...
@@ -337,12 +337,12 @@ void mmu_disable_dcache()
register
rt_uint32_t
i
;
/* read control register */
asm
(
"mrc p15, 0, %0, c1, c0, 0"
:
"=r"
(
i
));
asm
volatile
(
"mrc p15, 0, %0, c1, c0, 0"
:
"=r"
(
i
));
i
&=
~
(
1
<<
2
);
/* write back to control register */
asm
(
"mcr p15, 0, %0, c1, c0, 0"
:
:
"r"
(
i
));
asm
volatile
(
"mcr p15, 0, %0, c1, c0, 0"
:
:
"r"
(
i
));
}
void
mmu_enable_alignfault
()
...
...
@@ -350,12 +350,12 @@ void mmu_enable_alignfault()
register
rt_uint32_t
i
;
/* read control register */
asm
(
"mrc p15, 0, %0, c1, c0, 0"
:
"=r"
(
i
));
asm
volatile
(
"mrc p15, 0, %0, c1, c0, 0"
:
"=r"
(
i
));
i
|=
(
1
<<
1
);
/* write back to control register */
asm
(
"mcr p15, 0, %0, c1, c0, 0"
:
:
"r"
(
i
));
asm
volatile
(
"mcr p15, 0, %0, c1, c0, 0"
:
:
"r"
(
i
));
}
void
mmu_disable_alignfault
()
...
...
@@ -363,17 +363,17 @@ void mmu_disable_alignfault()
register
rt_uint32_t
i
;
/* read control register */
asm
(
"mrc p15, 0, %0, c1, c0, 0"
:
"=r"
(
i
));
asm
volatile
(
"mrc p15, 0, %0, c1, c0, 0"
:
"=r"
(
i
));
i
&=
~
(
1
<<
1
);
/* write back to control register */
asm
(
"mcr p15, 0, %0, c1, c0, 0"
:
:
"r"
(
i
));
asm
volatile
(
"mcr p15, 0, %0, c1, c0, 0"
:
:
"r"
(
i
));
}
void
mmu_clean_invalidated_cache_index
(
int
index
)
{
asm
(
"mcr p15, 0, %0, c7, c14, 2"
:
:
"r"
(
index
));
asm
volatile
(
"mcr p15, 0, %0, c7, c14, 2"
:
:
"r"
(
index
));
}
void
mmu_clean_dcache
(
rt_uint32_t
buffer
,
rt_uint32_t
size
)
...
...
@@ -384,7 +384,7 @@ void mmu_clean_dcache(rt_uint32_t buffer, rt_uint32_t size)
while
(
ptr
<
buffer
+
size
)
{
asm
(
"mcr p15, 0, %0, c7, c10, 1"
:
:
"r"
(
ptr
));
asm
volatile
(
"mcr p15, 0, %0, c7, c10, 1"
:
:
"r"
(
ptr
));
ptr
+=
32
;
}
}
...
...
@@ -397,19 +397,19 @@ void mmu_invalidate_dcache(rt_uint32_t buffer, rt_uint32_t size)
while
(
ptr
<
buffer
+
size
)
{
asm
(
"mcr p15, 0, %0, c7, c6, 1"
:
:
"r"
(
ptr
));
asm
volatile
(
"mcr p15, 0, %0, c7, c6, 1"
:
:
"r"
(
ptr
));
ptr
+=
32
;
}
}
void
mmu_invalidate_tlb
()
{
asm
(
"mcr p15, 0, %0, c8, c7, 0"
:
:
"r"
(
0
));
asm
volatile
(
"mcr p15, 0, %0, c8, c7, 0"
:
:
"r"
(
0
));
}
void
mmu_invalidate_icache
()
{
asm
(
"mcr p15, 0, %0, c7, c5, 0"
:
:
"r"
(
0
));
asm
volatile
(
"mcr p15, 0, %0, c7, c5, 0"
:
:
"r"
(
0
));
}
#endif
...
...
libcpu/arm/armv6/mmu.c
浏览文件 @
a3a0bda9
...
...
@@ -34,13 +34,13 @@ void mmu_setttbase(rt_uint32_t i)
* set by page table entry
*/
value
=
0
;
__asm
__asm
volatile
{
mcr
p15
,
0
,
value
,
c8
,
c7
,
0
}
value
=
0x55555555
;
__asm
__asm
volatile
{
mcr
p15
,
0
,
value
,
c3
,
c0
,
0
mcr
p15
,
0
,
i
,
c2
,
c0
,
0
...
...
@@ -49,7 +49,7 @@ void mmu_setttbase(rt_uint32_t i)
void
mmu_set_domain
(
rt_uint32_t
i
)
{
__asm
__asm
volatile
{
mcr
p15
,
0
,
i
,
c3
,
c0
,
0
}
...
...
@@ -59,7 +59,7 @@ void mmu_enable()
{
register
rt_uint32_t
value
;
__asm
__asm
volatile
{
mrc
p15
,
0
,
value
,
c1
,
c0
,
0
orr
value
,
value
,
#
0x01
...
...
@@ -71,7 +71,7 @@ void mmu_disable()
{
register
rt_uint32_t
value
;
__asm
__asm
volatile
{
mrc
p15
,
0
,
value
,
c1
,
c0
,
0
bic
value
,
value
,
#
0x01
...
...
@@ -83,7 +83,7 @@ void mmu_enable_icache()
{
register
rt_uint32_t
value
;
__asm
__asm
volatile
{
mrc
p15
,
0
,
value
,
c1
,
c0
,
0
orr
value
,
value
,
#
0x1000
...
...
@@ -95,7 +95,7 @@ void mmu_enable_dcache()
{
register
rt_uint32_t
value
;
__asm
__asm
volatile
{
mrc
p15
,
0
,
value
,
c1
,
c0
,
0
orr
value
,
value
,
#
0x04
...
...
@@ -107,7 +107,7 @@ void mmu_disable_icache()
{
register
rt_uint32_t
value
;
__asm
__asm
volatile
{
mrc
p15
,
0
,
value
,
c1
,
c0
,
0
bic
value
,
value
,
#
0x1000
...
...
@@ -119,7 +119,7 @@ void mmu_disable_dcache()
{
register
rt_uint32_t
value
;
__asm
__asm
volatile
{
mrc
p15
,
0
,
value
,
c1
,
c0
,
0
bic
value
,
value
,
#
0x04
...
...
@@ -131,7 +131,7 @@ void mmu_enable_alignfault()
{
register
rt_uint32_t
value
;
__asm
__asm
volatile
{
mrc
p15
,
0
,
value
,
c1
,
c0
,
0
orr
value
,
value
,
#
0x02
...
...
@@ -143,7 +143,7 @@ void mmu_disable_alignfault()
{
register
rt_uint32_t
value
;
__asm
__asm
volatile
{
mrc
p15
,
0
,
value
,
c1
,
c0
,
0
bic
value
,
value
,
#
0x02
...
...
@@ -153,7 +153,7 @@ void mmu_disable_alignfault()
void
mmu_clean_invalidated_cache_index
(
int
index
)
{
__asm
__asm
volatile
{
mcr
p15
,
0
,
index
,
c7
,
c14
,
2
}
...
...
@@ -167,7 +167,7 @@ void mmu_clean_invalidated_dcache(rt_uint32_t buffer, rt_uint32_t size)
while
(
ptr
<
buffer
+
size
)
{
__asm
__asm
volatile
{
MCR
p15
,
0
,
ptr
,
c7
,
c14
,
1
}
...
...
@@ -183,7 +183,7 @@ void mmu_clean_dcache(rt_uint32_t buffer, rt_uint32_t size)
while
(
ptr
<
buffer
+
size
)
{
__asm
__asm
volatile
{
MCR
p15
,
0
,
ptr
,
c7
,
c10
,
1
}
...
...
@@ -199,7 +199,7 @@ void mmu_invalidate_dcache(rt_uint32_t buffer, rt_uint32_t size)
while
(
ptr
<
buffer
+
size
)
{
__asm
__asm
volatile
{
MCR
p15
,
0
,
ptr
,
c7
,
c6
,
1
}
...
...
@@ -212,7 +212,7 @@ void mmu_invalidate_tlb()
register
rt_uint32_t
value
;
value
=
0
;
__asm
__asm
volatile
{
mcr
p15
,
0
,
value
,
c8
,
c7
,
0
}
...
...
@@ -224,7 +224,7 @@ void mmu_invalidate_icache()
value
=
0
;
__asm
__asm
volatile
{
mcr
p15
,
0
,
value
,
c7
,
c5
,
0
}
...
...
@@ -237,7 +237,7 @@ void mmu_invalidate_dcache_all()
value
=
0
;
__asm
__asm
volatile
{
mcr
p15
,
0
,
value
,
c7
,
c6
,
0
}
...
...
@@ -253,16 +253,16 @@ void mmu_setttbase(register rt_uint32_t i)
* set by page table entry
*/
value
=
0
;
asm
(
"mcr p15, 0, %0, c8, c7, 0"
::
"r"
(
value
));
asm
volatile
(
"mcr p15, 0, %0, c8, c7, 0"
::
"r"
(
value
));
value
=
0x55555555
;
asm
(
"mcr p15, 0, %0, c3, c0, 0"
::
"r"
(
value
));
asm
(
"mcr p15, 0, %0, c2, c0, 0"
::
"r"
(
i
));
asm
volatile
(
"mcr p15, 0, %0, c3, c0, 0"
::
"r"
(
value
));
asm
volatile
(
"mcr p15, 0, %0, c2, c0, 0"
::
"r"
(
i
));
}
void
mmu_set_domain
(
register
rt_uint32_t
i
)
{
asm
(
"mcr p15,0, %0, c3, c0, 0"
:
:
"r"
(
i
));
asm
volatile
(
"mcr p15,0, %0, c3, c0, 0"
:
:
"r"
(
i
));
}
void
mmu_enable
()
...
...
@@ -270,7 +270,7 @@ void mmu_enable()
register
rt_uint32_t
i
;
/* read control register */
asm
(
"mrc p15, 0, %0, c1, c0, 0"
:
"=r"
(
i
));
asm
volatile
(
"mrc p15, 0, %0, c1, c0, 0"
:
"=r"
(
i
));
i
|=
0x1
;
/* Enables the extended page tables to be configured for
...
...
@@ -279,7 +279,7 @@ void mmu_enable()
i
|=
(
1
<<
13
);
/* High exception vectors selected, address range = 0xFFFF0000-0xFFFF001C */
/* write back to control register */
asm
(
"mcr p15, 0, %0, c1, c0, 0"
:
:
"r"
(
i
));
asm
volatile
(
"mcr p15, 0, %0, c1, c0, 0"
:
:
"r"
(
i
));
}
void
mmu_disable
()
...
...
@@ -287,12 +287,12 @@ void mmu_disable()
register
rt_uint32_t
i
;
/* read control register */
asm
(
"mrc p15, 0, %0, c1, c0, 0"
:
"=r"
(
i
));
asm
volatile
(
"mrc p15, 0, %0, c1, c0, 0"
:
"=r"
(
i
));
i
&=
~
0x1
;
/* write back to control register */
asm
(
"mcr p15, 0, %0, c1, c0, 0"
:
:
"r"
(
i
));
asm
volatile
(
"mcr p15, 0, %0, c1, c0, 0"
:
:
"r"
(
i
));
}
void
mmu_enable_icache
()
...
...
@@ -300,12 +300,12 @@ void mmu_enable_icache()
register
rt_uint32_t
i
;
/* read control register */
asm
(
"mrc p15, 0, %0, c1, c0, 0"
:
"=r"
(
i
));
asm
volatile
(
"mrc p15, 0, %0, c1, c0, 0"
:
"=r"
(
i
));
i
|=
(
1
<<
12
);
/* write back to control register */
asm
(
"mcr p15, 0, %0, c1, c0, 0"
:
:
"r"
(
i
));
asm
volatile
(
"mcr p15, 0, %0, c1, c0, 0"
:
:
"r"
(
i
));
}
void
mmu_enable_dcache
()
...
...
@@ -313,12 +313,12 @@ void mmu_enable_dcache()
register
rt_uint32_t
i
;
/* read control register */
asm
(
"mrc p15, 0, %0, c1, c0, 0"
:
"=r"
(
i
));
asm
volatile
(
"mrc p15, 0, %0, c1, c0, 0"
:
"=r"
(
i
));
i
|=
(
1
<<
2
);
/* write back to control register */
asm
(
"mcr p15, 0, %0, c1, c0, 0"
:
:
"r"
(
i
));
asm
volatile
(
"mcr p15, 0, %0, c1, c0, 0"
:
:
"r"
(
i
));
}
void
mmu_disable_icache
()
...
...
@@ -326,12 +326,12 @@ void mmu_disable_icache()
register
rt_uint32_t
i
;
/* read control register */
asm
(
"mrc p15, 0, %0, c1, c0, 0"
:
"=r"
(
i
));
asm
volatile
(
"mrc p15, 0, %0, c1, c0, 0"
:
"=r"
(
i
));
i
&=
~
(
1
<<
12
);
/* write back to control register */
asm
(
"mcr p15, 0, %0, c1, c0, 0"
:
:
"r"
(
i
));
asm
volatile
(
"mcr p15, 0, %0, c1, c0, 0"
:
:
"r"
(
i
));
}
void
mmu_disable_dcache
()
...
...
@@ -339,12 +339,12 @@ void mmu_disable_dcache()
register
rt_uint32_t
i
;
/* read control register */
asm
(
"mrc p15, 0, %0, c1, c0, 0"
:
"=r"
(
i
));
asm
volatile
(
"mrc p15, 0, %0, c1, c0, 0"
:
"=r"
(
i
));
i
&=
~
(
1
<<
2
);
/* write back to control register */
asm
(
"mcr p15, 0, %0, c1, c0, 0"
:
:
"r"
(
i
));
asm
volatile
(
"mcr p15, 0, %0, c1, c0, 0"
:
:
"r"
(
i
));
}
void
mmu_enable_alignfault
()
...
...
@@ -352,12 +352,12 @@ void mmu_enable_alignfault()
register
rt_uint32_t
i
;
/* read control register */
asm
(
"mrc p15, 0, %0, c1, c0, 0"
:
"=r"
(
i
));
asm
volatile
(
"mrc p15, 0, %0, c1, c0, 0"
:
"=r"
(
i
));
i
|=
(
1
<<
1
);
/* write back to control register */
asm
(
"mcr p15, 0, %0, c1, c0, 0"
:
:
"r"
(
i
));
asm
volatile
(
"mcr p15, 0, %0, c1, c0, 0"
:
:
"r"
(
i
));
}
void
mmu_disable_alignfault
()
...
...
@@ -365,17 +365,17 @@ void mmu_disable_alignfault()
register
rt_uint32_t
i
;
/* read control register */
asm
(
"mrc p15, 0, %0, c1, c0, 0"
:
"=r"
(
i
));
asm
volatile
(
"mrc p15, 0, %0, c1, c0, 0"
:
"=r"
(
i
));
i
&=
~
(
1
<<
1
);
/* write back to control register */
asm
(
"mcr p15, 0, %0, c1, c0, 0"
:
:
"r"
(
i
));
asm
volatile
(
"mcr p15, 0, %0, c1, c0, 0"
:
:
"r"
(
i
));
}
void
mmu_clean_invalidated_cache_index
(
int
index
)
{
asm
(
"mcr p15, 0, %0, c7, c14, 2"
:
:
"r"
(
index
));
asm
volatile
(
"mcr p15, 0, %0, c7, c14, 2"
:
:
"r"
(
index
));
}
void
mmu_clean_invalidated_dcache
(
rt_uint32_t
buffer
,
rt_uint32_t
size
)
...
...
@@ -386,7 +386,7 @@ void mmu_clean_invalidated_dcache(rt_uint32_t buffer, rt_uint32_t size)
while
(
ptr
<
buffer
+
size
)
{
asm
(
"mcr p15, 0, %0, c7, c14, 1"
:
:
"r"
(
ptr
));
asm
volatile
(
"mcr p15, 0, %0, c7, c14, 1"
:
:
"r"
(
ptr
));
ptr
+=
CACHE_LINE_SIZE
;
}
}
...
...
@@ -400,7 +400,7 @@ void mmu_clean_dcache(rt_uint32_t buffer, rt_uint32_t size)
while
(
ptr
<
buffer
+
size
)
{
asm
(
"mcr p15, 0, %0, c7, c10, 1"
:
:
"r"
(
ptr
));
asm
volatile
(
"mcr p15, 0, %0, c7, c10, 1"
:
:
"r"
(
ptr
));
ptr
+=
CACHE_LINE_SIZE
;
}
}
...
...
@@ -413,24 +413,24 @@ void mmu_invalidate_dcache(rt_uint32_t buffer, rt_uint32_t size)
while
(
ptr
<
buffer
+
size
)
{
asm
(
"mcr p15, 0, %0, c7, c6, 1"
:
:
"r"
(
ptr
));
asm
volatile
(
"mcr p15, 0, %0, c7, c6, 1"
:
:
"r"
(
ptr
));
ptr
+=
CACHE_LINE_SIZE
;
}
}
void
mmu_invalidate_tlb
()
{
asm
(
"mcr p15, 0, %0, c8, c7, 0"
:
:
"r"
(
0
));
asm
volatile
(
"mcr p15, 0, %0, c8, c7, 0"
:
:
"r"
(
0
));
}
void
mmu_invalidate_icache
()
{
asm
(
"mcr p15, 0, %0, c7, c5, 0"
:
:
"r"
(
0
));
asm
volatile
(
"mcr p15, 0, %0, c7, c5, 0"
:
:
"r"
(
0
));
}
void
mmu_invalidate_dcache_all
()
{
asm
(
"mcr p15, 0, %0, c7, c6, 0"
:
:
"r"
(
0
));
asm
volatile
(
"mcr p15, 0, %0, c7, c6, 0"
:
:
"r"
(
0
));
}
#endif
...
...
libcpu/arm/dm36x/mmu.c
浏览文件 @
a3a0bda9
...
...
@@ -34,13 +34,13 @@ void mmu_setttbase(rt_uint32_t i)
* set by page table entry
*/
value
=
0
;
__asm
__asm
volatile
{
mcr
p15
,
0
,
value
,
c8
,
c7
,
0
}
value
=
0x55555555
;
__asm
__asm
volatile
{
mcr
p15
,
0
,
value
,
c3
,
c0
,
0
mcr
p15
,
0
,
i
,
c2
,
c0
,
0
...
...
@@ -49,7 +49,7 @@ void mmu_setttbase(rt_uint32_t i)
void
mmu_set_domain
(
rt_uint32_t
i
)
{
__asm
__asm
volatile
{
mcr
p15
,
0
,
i
,
c3
,
c0
,
0
}
...
...
@@ -59,7 +59,7 @@ void mmu_enable()
{
register
rt_uint32_t
value
;
__asm
__asm
volatile
{
mrc
p15
,
0
,
value
,
c1
,
c0
,
0
orr
value
,
value
,
#
0x01
...
...
@@ -71,7 +71,7 @@ void mmu_disable()
{
register
rt_uint32_t
value
;
__asm
__asm
volatile
{
mrc
p15
,
0
,
value
,
c1
,
c0
,
0
bic
value
,
value
,
#
0x01
...
...
@@ -83,7 +83,7 @@ void mmu_enable_icache()
{
register
rt_uint32_t
value
;
__asm
__asm
volatile
{
mrc
p15
,
0
,
value
,
c1
,
c0
,
0
orr
value
,
value
,
#
0x1000
...
...
@@ -95,7 +95,7 @@ void mmu_enable_dcache()
{
register
rt_uint32_t
value
;
__asm
__asm
volatile
{
mrc
p15
,
0
,
value
,
c1
,
c0
,
0
orr
value
,
value
,
#
0x04
...
...
@@ -107,7 +107,7 @@ void mmu_disable_icache()
{
register
rt_uint32_t
value
;
__asm
__asm
volatile
{
mrc
p15
,
0
,
value
,
c1
,
c0
,
0
bic
value
,
value
,
#
0x1000
...
...
@@ -119,7 +119,7 @@ void mmu_disable_dcache()
{
register
rt_uint32_t
value
;
__asm
__asm
volatile
{
mrc
p15
,
0
,
value
,
c1
,
c0
,
0
bic
value
,
value
,
#
0x04
...
...
@@ -131,7 +131,7 @@ void mmu_enable_alignfault()
{
register
rt_uint32_t
value
;
__asm
__asm
volatile
{
mrc
p15
,
0
,
value
,
c1
,
c0
,
0
orr
value
,
value
,
#
0x02
...
...
@@ -143,7 +143,7 @@ void mmu_disable_alignfault()
{
register
rt_uint32_t
value
;
__asm
__asm
volatile
{
mrc
p15
,
0
,
value
,
c1
,
c0
,
0
bic
value
,
value
,
#
0x02
...
...
@@ -153,7 +153,7 @@ void mmu_disable_alignfault()
void
mmu_clean_invalidated_cache_index
(
int
index
)
{
__asm
__asm
volatile
{
mcr
p15
,
0
,
index
,
c7
,
c14
,
2
}
...
...
@@ -167,7 +167,7 @@ void mmu_clean_invalidated_dcache(rt_uint32_t buffer, rt_uint32_t size)
while
(
ptr
<
buffer
+
size
)
{
__asm
__asm
volatile
{
MCR
p15
,
0
,
ptr
,
c7
,
c14
,
1
}
...
...
@@ -183,7 +183,7 @@ void mmu_clean_dcache(rt_uint32_t buffer, rt_uint32_t size)
while
(
ptr
<
buffer
+
size
)
{
__asm
__asm
volatile
{
MCR
p15
,
0
,
ptr
,
c7
,
c10
,
1
}
...
...
@@ -199,7 +199,7 @@ void mmu_invalidate_dcache(rt_uint32_t buffer, rt_uint32_t size)
while
(
ptr
<
buffer
+
size
)
{
__asm
__asm
volatile
{
MCR
p15
,
0
,
ptr
,
c7
,
c6
,
1
}
...
...
@@ -212,7 +212,7 @@ void mmu_invalidate_tlb()
register
rt_uint32_t
value
;
value
=
0
;
__asm
__asm
volatile
{
mcr
p15
,
0
,
value
,
c8
,
c7
,
0
}
...
...
@@ -224,7 +224,7 @@ void mmu_invalidate_icache()
value
=
0
;
__asm
__asm
volatile
{
mcr
p15
,
0
,
value
,
c7
,
c5
,
0
}
...
...
@@ -237,7 +237,7 @@ void mmu_invalidate_dcache_all()
value
=
0
;
__asm
__asm
volatile
{
mcr
p15
,
0
,
value
,
c7
,
c6
,
0
}
...
...
@@ -253,16 +253,16 @@ void mmu_setttbase(register rt_uint32_t i)
* set by page table entry
*/
value
=
0
;
asm
(
"mcr p15, 0, %0, c8, c7, 0"
::
"r"
(
value
));
asm
volatile
(
"mcr p15, 0, %0, c8, c7, 0"
::
"r"
(
value
));
value
=
0x55555555
;
asm
(
"mcr p15, 0, %0, c3, c0, 0"
::
"r"
(
value
));
asm
(
"mcr p15, 0, %0, c2, c0, 0"
::
"r"
(
i
));
asm
volatile
(
"mcr p15, 0, %0, c3, c0, 0"
::
"r"
(
value
));
asm
volatile
(
"mcr p15, 0, %0, c2, c0, 0"
::
"r"
(
i
));
}
void
mmu_set_domain
(
register
rt_uint32_t
i
)
{
asm
(
"mcr p15,0, %0, c3, c0, 0"
:
:
"r"
(
i
));
asm
volatile
(
"mcr p15,0, %0, c3, c0, 0"
:
:
"r"
(
i
));
}
void
mmu_enable
()
...
...
@@ -270,7 +270,7 @@ void mmu_enable()
register
rt_uint32_t
i
;
/* read control register */
asm
(
"mrc p15, 0, %0, c1, c0, 0"
:
"=r"
(
i
));
asm
volatile
(
"mrc p15, 0, %0, c1, c0, 0"
:
"=r"
(
i
));
i
|=
0x1
;
i
|=
(
1
<<
13
);
/* High exception vectors selected, address range = 0xFFFF0000-0xFFFF001C */
...
...
@@ -279,7 +279,7 @@ void mmu_enable()
i
&=
~
(
1
<<
9
);
/* write back to control register */
asm
(
"mcr p15, 0, %0, c1, c0, 0"
:
:
"r"
(
i
));
asm
volatile
(
"mcr p15, 0, %0, c1, c0, 0"
:
:
"r"
(
i
));
}
void
mmu_disable
()
...
...
@@ -287,12 +287,12 @@ void mmu_disable()
register
rt_uint32_t
i
;
/* read control register */
asm
(
"mrc p15, 0, %0, c1, c0, 0"
:
"=r"
(
i
));
asm
volatile
(
"mrc p15, 0, %0, c1, c0, 0"
:
"=r"
(
i
));
i
&=
~
0x1
;
/* write back to control register */
asm
(
"mcr p15, 0, %0, c1, c0, 0"
:
:
"r"
(
i
));
asm
volatile
(
"mcr p15, 0, %0, c1, c0, 0"
:
:
"r"
(
i
));
}
void
mmu_enable_icache
()
...
...
@@ -300,12 +300,12 @@ void mmu_enable_icache()
register
rt_uint32_t
i
;
/* read control register */
asm
(
"mrc p15, 0, %0, c1, c0, 0"
:
"=r"
(
i
));
asm
volatile
(
"mrc p15, 0, %0, c1, c0, 0"
:
"=r"
(
i
));
i
|=
(
1
<<
12
);
/* write back to control register */
asm
(
"mcr p15, 0, %0, c1, c0, 0"
:
:
"r"
(
i
));
asm
volatile
(
"mcr p15, 0, %0, c1, c0, 0"
:
:
"r"
(
i
));
}
void
mmu_enable_dcache
()
...
...
@@ -313,12 +313,12 @@ void mmu_enable_dcache()
register
rt_uint32_t
i
;
/* read control register */
asm
(
"mrc p15, 0, %0, c1, c0, 0"
:
"=r"
(
i
));
asm
volatile
(
"mrc p15, 0, %0, c1, c0, 0"
:
"=r"
(
i
));
i
|=
(
1
<<
2
);
/* write back to control register */
asm
(
"mcr p15, 0, %0, c1, c0, 0"
:
:
"r"
(
i
));
asm
volatile
(
"mcr p15, 0, %0, c1, c0, 0"
:
:
"r"
(
i
));
}
void
mmu_disable_icache
()
...
...
@@ -326,12 +326,12 @@ void mmu_disable_icache()
register
rt_uint32_t
i
;
/* read control register */
asm
(
"mrc p15, 0, %0, c1, c0, 0"
:
"=r"
(
i
));
asm
volatile
(
"mrc p15, 0, %0, c1, c0, 0"
:
"=r"
(
i
));
i
&=
~
(
1
<<
12
);
/* write back to control register */
asm
(
"mcr p15, 0, %0, c1, c0, 0"
:
:
"r"
(
i
));
asm
volatile
(
"mcr p15, 0, %0, c1, c0, 0"
:
:
"r"
(
i
));
}
void
mmu_disable_dcache
()
...
...
@@ -339,12 +339,12 @@ void mmu_disable_dcache()
register
rt_uint32_t
i
;
/* read control register */
asm
(
"mrc p15, 0, %0, c1, c0, 0"
:
"=r"
(
i
));
asm
volatile
(
"mrc p15, 0, %0, c1, c0, 0"
:
"=r"
(
i
));
i
&=
~
(
1
<<
2
);
/* write back to control register */
asm
(
"mcr p15, 0, %0, c1, c0, 0"
:
:
"r"
(
i
));
asm
volatile
(
"mcr p15, 0, %0, c1, c0, 0"
:
:
"r"
(
i
));
}
void
mmu_enable_alignfault
()
...
...
@@ -352,12 +352,12 @@ void mmu_enable_alignfault()
register
rt_uint32_t
i
;
/* read control register */
asm
(
"mrc p15, 0, %0, c1, c0, 0"
:
"=r"
(
i
));
asm
volatile
(
"mrc p15, 0, %0, c1, c0, 0"
:
"=r"
(
i
));
i
|=
(
1
<<
1
);
/* write back to control register */
asm
(
"mcr p15, 0, %0, c1, c0, 0"
:
:
"r"
(
i
));
asm
volatile
(
"mcr p15, 0, %0, c1, c0, 0"
:
:
"r"
(
i
));
}
void
mmu_disable_alignfault
()
...
...
@@ -365,17 +365,17 @@ void mmu_disable_alignfault()
register
rt_uint32_t
i
;
/* read control register */
asm
(
"mrc p15, 0, %0, c1, c0, 0"
:
"=r"
(
i
));
asm
volatile
(
"mrc p15, 0, %0, c1, c0, 0"
:
"=r"
(
i
));
i
&=
~
(
1
<<
1
);
/* write back to control register */
asm
(
"mcr p15, 0, %0, c1, c0, 0"
:
:
"r"
(
i
));
asm
volatile
(
"mcr p15, 0, %0, c1, c0, 0"
:
:
"r"
(
i
));
}
void
mmu_clean_invalidated_cache_index
(
int
index
)
{
asm
(
"mcr p15, 0, %0, c7, c14, 2"
:
:
"r"
(
index
));
asm
volatile
(
"mcr p15, 0, %0, c7, c14, 2"
:
:
"r"
(
index
));
}
void
mmu_clean_invalidated_dcache
(
rt_uint32_t
buffer
,
rt_uint32_t
size
)
...
...
@@ -386,7 +386,7 @@ void mmu_clean_invalidated_dcache(rt_uint32_t buffer, rt_uint32_t size)
while
(
ptr
<
buffer
+
size
)
{
asm
(
"mcr p15, 0, %0, c7, c14, 1"
:
:
"r"
(
ptr
));
asm
volatile
(
"mcr p15, 0, %0, c7, c14, 1"
:
:
"r"
(
ptr
));
ptr
+=
CACHE_LINE_SIZE
;
}
}
...
...
@@ -400,7 +400,7 @@ void mmu_clean_dcache(rt_uint32_t buffer, rt_uint32_t size)
while
(
ptr
<
buffer
+
size
)
{
asm
(
"mcr p15, 0, %0, c7, c10, 1"
:
:
"r"
(
ptr
));
asm
volatile
(
"mcr p15, 0, %0, c7, c10, 1"
:
:
"r"
(
ptr
));
ptr
+=
CACHE_LINE_SIZE
;
}
}
...
...
@@ -413,24 +413,24 @@ void mmu_invalidate_dcache(rt_uint32_t buffer, rt_uint32_t size)
while
(
ptr
<
buffer
+
size
)
{
asm
(
"mcr p15, 0, %0, c7, c6, 1"
:
:
"r"
(
ptr
));
asm
volatile
(
"mcr p15, 0, %0, c7, c6, 1"
:
:
"r"
(
ptr
));
ptr
+=
CACHE_LINE_SIZE
;
}
}
void
mmu_invalidate_tlb
()
{
asm
(
"mcr p15, 0, %0, c8, c7, 0"
:
:
"r"
(
0
));
asm
volatile
(
"mcr p15, 0, %0, c8, c7, 0"
:
:
"r"
(
0
));
}
void
mmu_invalidate_icache
()
{
asm
(
"mcr p15, 0, %0, c7, c5, 0"
:
:
"r"
(
0
));
asm
volatile
(
"mcr p15, 0, %0, c7, c5, 0"
:
:
"r"
(
0
));
}
void
mmu_invalidate_dcache_all
()
{
asm
(
"mcr p15, 0, %0, c7, c6, 0"
:
:
"r"
(
0
));
asm
volatile
(
"mcr p15, 0, %0, c7, c6, 0"
:
:
"r"
(
0
));
}
#endif
...
...
libcpu/arm/s3c24x0/mmu.c
浏览文件 @
a3a0bda9
...
...
@@ -43,12 +43,12 @@
#ifdef __GNUC__
void
mmu_setttbase
(
register
rt_uint32_t
i
)
{
asm
(
"mcr p15, 0, %0, c2, c0, 0"
:
:
"r"
(
i
));
asm
volatile
(
"mcr p15, 0, %0, c2, c0, 0"
:
:
"r"
(
i
));
}
void
mmu_set_domain
(
register
rt_uint32_t
i
)
{
asm
(
"mcr p15,0, %0, c3, c0, 0"
:
:
"r"
(
i
));
asm
volatile
(
"mcr p15,0, %0, c3, c0, 0"
:
:
"r"
(
i
));
}
void
mmu_enable
()
...
...
@@ -56,12 +56,12 @@ void mmu_enable()
register
rt_uint32_t
i
;
/* read control register */
asm
(
"mrc p15, 0, %0, c1, c0, 0"
:
"=r"
(
i
));
asm
volatile
(
"mrc p15, 0, %0, c1, c0, 0"
:
"=r"
(
i
));
i
|=
0x1
;
/* write back to control register */
asm
(
"mcr p15, 0, %0, c1, c0, 0"
:
:
"r"
(
i
));
asm
volatile
(
"mcr p15, 0, %0, c1, c0, 0"
:
:
"r"
(
i
));
}
void
mmu_disable
()
...
...
@@ -69,12 +69,12 @@ void mmu_disable()
register
rt_uint32_t
i
;
/* read control register */
asm
(
"mrc p15, 0, %0, c1, c0, 0"
:
"=r"
(
i
));
asm
volatile
(
"mrc p15, 0, %0, c1, c0, 0"
:
"=r"
(
i
));
i
&=
~
0x1
;
/* write back to control register */
asm
(
"mcr p15, 0, %0, c1, c0, 0"
:
:
"r"
(
i
));
asm
volatile
(
"mcr p15, 0, %0, c1, c0, 0"
:
:
"r"
(
i
));
}
void
mmu_enable_icache
()
...
...
@@ -82,12 +82,12 @@ void mmu_enable_icache()
register
rt_uint32_t
i
;
/* read control register */
asm
(
"mrc p15, 0, %0, c1, c0, 0"
:
"=r"
(
i
));
asm
volatile
(
"mrc p15, 0, %0, c1, c0, 0"
:
"=r"
(
i
));
i
|=
(
1
<<
12
);
/* write back to control register */
asm
(
"mcr p15, 0, %0, c1, c0, 0"
:
:
"r"
(
i
));
asm
volatile
(
"mcr p15, 0, %0, c1, c0, 0"
:
:
"r"
(
i
));
}
void
mmu_enable_dcache
()
...
...
@@ -95,12 +95,12 @@ void mmu_enable_dcache()
register
rt_uint32_t
i
;
/* read control register */
asm
(
"mrc p15, 0, %0, c1, c0, 0"
:
"=r"
(
i
));
asm
volatile
(
"mrc p15, 0, %0, c1, c0, 0"
:
"=r"
(
i
));
i
|=
(
1
<<
2
);
/* write back to control register */
asm
(
"mcr p15, 0, %0, c1, c0, 0"
:
:
"r"
(
i
));
asm
volatile
(
"mcr p15, 0, %0, c1, c0, 0"
:
:
"r"
(
i
));
}
void
mmu_disable_icache
()
...
...
@@ -108,12 +108,12 @@ void mmu_disable_icache()
register
rt_uint32_t
i
;
/* read control register */
asm
(
"mrc p15, 0, %0, c1, c0, 0"
:
"=r"
(
i
));
asm
volatile
(
"mrc p15, 0, %0, c1, c0, 0"
:
"=r"
(
i
));
i
&=
~
(
1
<<
12
);
/* write back to control register */
asm
(
"mcr p15, 0, %0, c1, c0, 0"
:
:
"r"
(
i
));
asm
volatile
(
"mcr p15, 0, %0, c1, c0, 0"
:
:
"r"
(
i
));
}
void
mmu_disable_dcache
()
...
...
@@ -121,12 +121,12 @@ void mmu_disable_dcache()
register
rt_uint32_t
i
;
/* read control register */
asm
(
"mrc p15, 0, %0, c1, c0, 0"
:
"=r"
(
i
));
asm
volatile
(
"mrc p15, 0, %0, c1, c0, 0"
:
"=r"
(
i
));
i
&=
~
(
1
<<
2
);
/* write back to control register */
asm
(
"mcr p15, 0, %0, c1, c0, 0"
:
:
"r"
(
i
));
asm
volatile
(
"mcr p15, 0, %0, c1, c0, 0"
:
:
"r"
(
i
));
}
void
mmu_enable_alignfault
()
...
...
@@ -134,12 +134,12 @@ void mmu_enable_alignfault()
register
rt_uint32_t
i
;
/* read control register */
asm
(
"mrc p15, 0, %0, c1, c0, 0"
:
"=r"
(
i
));
asm
volatile
(
"mrc p15, 0, %0, c1, c0, 0"
:
"=r"
(
i
));
i
|=
(
1
<<
1
);
/* write back to control register */
asm
(
"mcr p15, 0, %0, c1, c0, 0"
:
:
"r"
(
i
));
asm
volatile
(
"mcr p15, 0, %0, c1, c0, 0"
:
:
"r"
(
i
));
}
void
mmu_disable_alignfault
()
...
...
@@ -147,34 +147,34 @@ void mmu_disable_alignfault()
register
rt_uint32_t
i
;
/* read control register */
asm
(
"mrc p15, 0, %0, c1, c0, 0"
:
"=r"
(
i
));
asm
volatile
(
"mrc p15, 0, %0, c1, c0, 0"
:
"=r"
(
i
));
i
&=
~
(
1
<<
1
);
/* write back to control register */
asm
(
"mcr p15, 0, %0, c1, c0, 0"
:
:
"r"
(
i
));
asm
volatile
(
"mcr p15, 0, %0, c1, c0, 0"
:
:
"r"
(
i
));
}
void
mmu_clean_invalidated_cache_index
(
int
index
)
{
asm
(
"mcr p15, 0, %0, c7, c14, 2"
:
:
"r"
(
index
));
asm
volatile
(
"mcr p15, 0, %0, c7, c14, 2"
:
:
"r"
(
index
));
}
void
mmu_invalidate_tlb
()
{
asm
(
"mcr p15, 0, %0, c8, c7, 0"
:
:
"r"
(
0
));
asm
volatile
(
"mcr p15, 0, %0, c8, c7, 0"
:
:
"r"
(
0
));
}
void
mmu_invalidate_icache
()
{
asm
(
"mcr p15, 0, %0, c7, c5, 0"
:
:
"r"
(
0
));
asm
volatile
(
"mcr p15, 0, %0, c7, c5, 0"
:
:
"r"
(
0
));
}
#endif
#ifdef __CC_ARM
void
mmu_setttbase
(
rt_uint32_t
i
)
{
__asm
__asm
volatile
{
mcr
p15
,
0
,
i
,
c2
,
c0
,
0
}
...
...
@@ -182,7 +182,7 @@ void mmu_setttbase(rt_uint32_t i)
void
mmu_set_domain
(
rt_uint32_t
i
)
{
__asm
__asm
volatile
{
mcr
p15
,
0
,
i
,
c3
,
c0
,
0
}
...
...
@@ -192,7 +192,7 @@ void mmu_enable()
{
register
rt_uint32_t
value
;
__asm
__asm
volatile
{
mrc
p15
,
0
,
value
,
c1
,
c0
,
0
orr
value
,
value
,
#
0x01
...
...
@@ -204,7 +204,7 @@ void mmu_disable()
{
register
rt_uint32_t
value
;
__asm
__asm
volatile
{
mrc
p15
,
0
,
value
,
c1
,
c0
,
0
bic
value
,
value
,
#
0x01
...
...
@@ -216,7 +216,7 @@ void mmu_enable_icache()
{
register
rt_uint32_t
value
;
__asm
__asm
volatile
{
mrc
p15
,
0
,
value
,
c1
,
c0
,
0
orr
value
,
value
,
#
0x1000
...
...
@@ -228,7 +228,7 @@ void mmu_enable_dcache()
{
register
rt_uint32_t
value
;
__asm
__asm
volatile
{
mrc
p15
,
0
,
value
,
c1
,
c0
,
0
orr
value
,
value
,
#
0x04
...
...
@@ -240,7 +240,7 @@ void mmu_disable_icache()
{
register
rt_uint32_t
value
;
__asm
__asm
volatile
{
mrc
p15
,
0
,
value
,
c1
,
c0
,
0
bic
value
,
value
,
#
0x1000
...
...
@@ -252,7 +252,7 @@ void mmu_disable_dcache()
{
register
rt_uint32_t
value
;
__asm
__asm
volatile
{
mrc
p15
,
0
,
value
,
c1
,
c0
,
0
bic
value
,
value
,
#
0x04
...
...
@@ -264,7 +264,7 @@ void mmu_enable_alignfault()
{
register
rt_uint32_t
value
;
__asm
__asm
volatile
{
mrc
p15
,
0
,
value
,
c1
,
c0
,
0
orr
value
,
value
,
#
0x02
...
...
@@ -276,7 +276,7 @@ void mmu_disable_alignfault()
{
register
rt_uint32_t
value
;
__asm
__asm
volatile
{
mrc
p15
,
0
,
value
,
c1
,
c0
,
0
bic
value
,
value
,
#
0x02
...
...
@@ -286,7 +286,7 @@ void mmu_disable_alignfault()
void
mmu_clean_invalidated_cache_index
(
int
index
)
{
__asm
__asm
volatile
{
mcr
p15
,
0
,
index
,
c7
,
c14
,
2
}
...
...
@@ -297,7 +297,7 @@ void mmu_invalidate_tlb()
register
rt_uint32_t
value
;
value
=
0
;
__asm
__asm
volatile
{
mcr
p15
,
0
,
value
,
c8
,
c7
,
0
}
...
...
@@ -309,7 +309,7 @@ void mmu_invalidate_icache()
value
=
0
;
__asm
__asm
volatile
{
mcr
p15
,
0
,
value
,
c7
,
c5
,
0
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录