Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
AdRainty
rt-thread
提交
175e357a
R
rt-thread
项目概览
AdRainty
/
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
175e357a
编写于
4月 16, 2015
作者:
A
ardafu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[libcpu][arm926] Remove unused SPSR register PUSH/POP when os switch thread.
上级
f4555bf7
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
30 addition
and
70 deletion
+30
-70
libcpu/arm/arm926/context_gcc.S
libcpu/arm/arm926/context_gcc.S
+0
-7
libcpu/arm/arm926/context_iar.S
libcpu/arm/arm926/context_iar.S
+0
-8
libcpu/arm/arm926/context_rvds.S
libcpu/arm/arm926/context_rvds.S
+0
-7
libcpu/arm/arm926/stack.c
libcpu/arm/arm926/stack.c
+5
-2
libcpu/arm/arm926/start_gcc.S
libcpu/arm/arm926/start_gcc.S
+9
-16
libcpu/arm/arm926/start_iar.S
libcpu/arm/arm926/start_iar.S
+8
-15
libcpu/arm/arm926/start_rvds.S
libcpu/arm/arm926/start_rvds.S
+8
-15
未找到文件。
libcpu/arm/arm926/context_gcc.S
浏览文件 @
175e357a
...
@@ -53,14 +53,10 @@ rt_hw_context_switch:
...
@@ -53,14 +53,10 @@ rt_hw_context_switch:
stmfd
sp
!,
{
r0
-
r12
,
lr
}
@
; push lr & register file
stmfd
sp
!,
{
r0
-
r12
,
lr
}
@
; push lr & register file
mrs
r4
,
cpsr
mrs
r4
,
cpsr
stmfd
sp
!,
{
r4
}
@
; push cpsr
stmfd
sp
!,
{
r4
}
@
; push cpsr
mrs
r4
,
spsr
stmfd
sp
!,
{
r4
}
@
; push spsr
str
sp
,
[
r0
]
@
; store sp in preempted tasks tcb
str
sp
,
[
r0
]
@
; store sp in preempted tasks tcb
ldr
sp
,
[
r1
]
@
; get new task stack pointer
ldr
sp
,
[
r1
]
@
; get new task stack pointer
ldmfd
sp
!,
{
r4
}
@
; pop new task spsr
ldmfd
sp
!,
{
r4
}
@
; pop new task spsr
msr
spsr_cxsf
,
r4
msr
spsr_cxsf
,
r4
ldmfd
sp
!,
{
r4
}
@
; pop new task cpsr
msr
spsr_cxsf
,
r4
ldmfd
sp
!,
{
r0
-
r12
,
lr
,
pc
}^
@
; pop new task r0-r12, lr & pc
ldmfd
sp
!,
{
r0
-
r12
,
lr
,
pc
}^
@
; pop new task r0-r12, lr & pc
/*
/*
...
@@ -70,9 +66,6 @@ rt_hw_context_switch:
...
@@ -70,9 +66,6 @@ rt_hw_context_switch:
.
globl
rt_hw_context_switch_to
.
globl
rt_hw_context_switch_to
rt_hw_context_switch_to
:
rt_hw_context_switch_to
:
ldr
sp
,
[
r0
]
@
; get new task stack pointer
ldr
sp
,
[
r0
]
@
; get new task stack pointer
ldmfd
sp
!,
{
r4
}
@
; pop new task spsr
msr
spsr_cxsf
,
r4
ldmfd
sp
!,
{
r4
}
@
; pop new task cpsr
ldmfd
sp
!,
{
r4
}
@
; pop new task cpsr
msr
spsr_cxsf
,
r4
msr
spsr_cxsf
,
r4
ldmfd
sp
!,
{
r0
-
r12
,
lr
,
pc
}^
@
; pop new task r0-r12, lr & pc
ldmfd
sp
!,
{
r0
-
r12
,
lr
,
pc
}^
@
; pop new task r0-r12, lr & pc
...
...
libcpu/arm/arm926/context_iar.S
浏览文件 @
175e357a
...
@@ -55,14 +55,10 @@ rt_hw_context_switch:
...
@@ -55,14 +55,10 @@ rt_hw_context_switch:
STMFD
SP
!,
{
R0
-
R12
,
LR
}
; push lr & register file
STMFD
SP
!,
{
R0
-
R12
,
LR
}
; push lr & register file
MRS
R4
,
CPSR
MRS
R4
,
CPSR
STMFD
SP
!,
{
R4
}
; push cpsr
STMFD
SP
!,
{
R4
}
; push cpsr
MRS
R4
,
SPSR
STMFD
SP
!,
{
R4
}
; push spsr
STR
SP
,
[
R0
]
; store sp in preempted tasks TCB
STR
SP
,
[
R0
]
; store sp in preempted tasks TCB
LDR
SP
,
[
R1
]
; get new task stack pointer
LDR
SP
,
[
R1
]
; get new task stack pointer
LDMFD
SP
!,
{
R4
}
; pop new task spsr
LDMFD
SP
!,
{
R4
}
; pop new task spsr
MSR
SPSR_cxsf
,
R4
MSR
SPSR_cxsf
,
R4
LDMFD
SP
!,
{
R4
}
; pop new task cpsr
MSR
SPSR_cxsf
,
R4
LDMFD
SP
!,
{
R0
-
R12
,
LR
,
PC
}^
; pop new task r0-r12, lr & pc
LDMFD
SP
!,
{
R0
-
R12
,
LR
,
PC
}^
; pop new task r0-r12, lr & pc
/*
/*
...
@@ -72,12 +68,8 @@ rt_hw_context_switch:
...
@@ -72,12 +68,8 @@ rt_hw_context_switch:
PUBLIC
rt_hw_context_switch_to
PUBLIC
rt_hw_context_switch_to
rt_hw_context_switch_to
:
rt_hw_context_switch_to
:
LDR
SP
,
[
R0
]
; get new task stack pointer
LDR
SP
,
[
R0
]
; get new task stack pointer
LDMFD
SP
!,
{
R4
}
; pop new task spsr
LDMFD
SP
!,
{
R4
}
; pop new task spsr
MSR
SPSR_cxsf
,
R4
MSR
SPSR_cxsf
,
R4
LDMFD
SP
!,
{
R4
}
; pop new task cpsr
MSR
SPSR_cxsf
,
R4
LDMFD
SP
!,
{
R0
-
R12
,
LR
,
PC
}^
; pop new task r0-r12, lr & pc
LDMFD
SP
!,
{
R0
-
R12
,
LR
,
PC
}^
; pop new task r0-r12, lr & pc
/*
/*
...
...
libcpu/arm/arm926/context_rvds.S
浏览文件 @
175e357a
...
@@ -60,14 +60,10 @@ rt_hw_context_switch proc
...
@@ -60,14 +60,10 @@ rt_hw_context_switch proc
stmfd
sp
!,
{
r0
-
r12
,
lr
}
; push lr & register file
stmfd
sp
!,
{
r0
-
r12
,
lr
}
; push lr & register file
mrs
r4
,
cpsr
mrs
r4
,
cpsr
stmfd
sp
!,
{
r4
}
; push cpsr
stmfd
sp
!,
{
r4
}
; push cpsr
mrs
r4
,
spsr
stmfd
sp
!,
{
r4
}
; push spsr
str
sp
,
[
r0
]
; store sp in preempted tasks tcb
str
sp
,
[
r0
]
; store sp in preempted tasks tcb
ldr
sp
,
[
r1
]
; get new task stack pointer
ldr
sp
,
[
r1
]
; get new task stack pointer
ldmfd
sp
!,
{
r4
}
; pop new task spsr
ldmfd
sp
!,
{
r4
}
; pop new task spsr
msr
spsr_cxsf
,
r4
msr
spsr_cxsf
,
r4
ldmfd
sp
!,
{
r4
}
; pop new task cpsr
msr
spsr_cxsf
,
r4
ldmfd
sp
!,
{
r0
-
r12
,
lr
,
pc
}^
; pop new task r0-r12, lr & pc
ldmfd
sp
!,
{
r0
-
r12
,
lr
,
pc
}^
; pop new task r0-r12, lr & pc
endp
endp
...
@@ -78,11 +74,8 @@ rt_hw_context_switch proc
...
@@ -78,11 +74,8 @@ rt_hw_context_switch proc
rt_hw_context_switch_to
proc
rt_hw_context_switch_to
proc
export
rt_hw_context_switch_to
export
rt_hw_context_switch_to
ldr
sp
,
[
r0
]
; get new task stack pointer
ldr
sp
,
[
r0
]
; get new task stack pointer
ldmfd
sp
!,
{
r4
}
; pop new task spsr
ldmfd
sp
!,
{
r4
}
; pop new task spsr
msr
spsr_cxsf
,
r4
msr
spsr_cxsf
,
r4
ldmfd
sp
!,
{
r4
}
; pop new task cpsr
msr
spsr_cxsf
,
r4
ldmfd
sp
!,
{
r0
-
r12
,
lr
,
pc
}^
; pop new task r0-r12, lr & pc
ldmfd
sp
!,
{
r0
-
r12
,
lr
,
pc
}^
; pop new task r0-r12, lr & pc
endp
endp
...
...
libcpu/arm/arm926/stack.c
浏览文件 @
175e357a
...
@@ -66,8 +66,11 @@ rt_uint8_t *rt_hw_stack_init(void *tentry, void *parameter,
...
@@ -66,8 +66,11 @@ rt_uint8_t *rt_hw_stack_init(void *tentry, void *parameter,
*
(
--
stk
)
=
0
;
/* r2 */
*
(
--
stk
)
=
0
;
/* r2 */
*
(
--
stk
)
=
0
;
/* r1 */
*
(
--
stk
)
=
0
;
/* r1 */
*
(
--
stk
)
=
(
rt_uint32_t
)
parameter
;
/* r0 : argument */
*
(
--
stk
)
=
(
rt_uint32_t
)
parameter
;
/* r0 : argument */
*
(
--
stk
)
=
SVCMODE
;
/* cpsr */
/* cpsr */
*
(
--
stk
)
=
SVCMODE
;
/* spsr */
if
((
rt_uint32_t
)
tentry
&
0x01
)
*
(
--
stk
)
=
SVCMODE
|
0x20
;
/* thumb mode */
else
*
(
--
stk
)
=
SVCMODE
;
/* arm mode */
/* return task's current stack address */
/* return task's current stack address */
return
(
rt_uint8_t
*
)
stk
;
return
(
rt_uint8_t
*
)
stk
;
...
...
libcpu/arm/arm926/start_gcc.S
浏览文件 @
175e357a
...
@@ -291,24 +291,19 @@ rt_hw_context_switch_interrupt_do:
...
@@ -291,24 +291,19 @@ rt_hw_context_switch_interrupt_do:
STR
R1
,
[
R0
]
@
; Save to flag variable
STR
R1
,
[
R0
]
@
; Save to flag variable
LDMFD
SP
!,
{
R0
-
R12
,
LR
}
@
; Reload saved registers
LDMFD
SP
!,
{
R0
-
R12
,
LR
}
@
; Reload saved registers
STMFD
SP
!,
{
R0
-
R3
}
@
; Save R0-R3
STMFD
SP
,
{
R0
-
R2
}
@
; Save R0-R2
MOV
R1
,
SP
@
; Save old task's SP to R1
SUB
R1
,
SP
,
#
4
*
3
@
; Save old task's SP to R1
ADD
SP
,
SP
,
#
16
@
; Restore SP
SUB
R2
,
LR
,
#
4
@
; Save old task's PC to R2
SUB
R2
,
LR
,
#
4
@
; Save old task's PC to R2
MRS
R
3
,
SPSR
@
; Get CPSR of interrupt thread
MRS
R
0
,
SPSR
@
; Get CPSR of interrupt thread
MSR
CPSR_c
,
#
MODE_SVC
|
NOINT
@
; Switch to SVC mode and no interrupt
MSR
CPSR_c
,
#
MODE_SVC
|
NOINT
@
; Switch to SVC mode and no interrupt
STMFD
SP
!,
{
R2
}
@
; Push old task's PC
STMFD
SP
!,
{
R2
}
@
; Push old task's PC
STMFD
SP
!,
{
R4
-
R12
,
LR
}
@
; Push old task's LR,R12-R4
STMFD
SP
!,
{
R3
-
R12
,
LR
}
@
; Push old task's LR,R12-R3
MOV
R4
,
R1
@
; Special optimised code below
LDMFD
R1
,
{
R1
-
R3
}
MOV
R5
,
R3
STMFD
SP
!,
{
R1
-
R3
}
@
; Push old task's R2-R0
LDMFD
R4
!,
{
R0
-
R3
}
STMFD
SP
!,
{
R0
}
@
; Push old task's CPSR
STMFD
SP
!,
{
R0
-
R3
}
@
; Push old task's R3-R0
STMFD
SP
!,
{
R5
}
@
; Push old task's CPSR
MRS
R4
,
SPSR
STMFD
SP
!,
{
R4
}
@
; Push old task's SPSR
LDR
R4
,
=
rt_interrupt_from_thread
LDR
R4
,
=
rt_interrupt_from_thread
LDR
R5
,
[
R4
]
@
; R5 = stack ptr in old tasks's TCB
LDR
R5
,
[
R4
]
@
; R5 = stack ptr in old tasks's TCB
...
@@ -320,7 +315,5 @@ rt_hw_context_switch_interrupt_do:
...
@@ -320,7 +315,5 @@ rt_hw_context_switch_interrupt_do:
LDMFD
SP
!,
{
R4
}
@
; Pop new task's SPSR
LDMFD
SP
!,
{
R4
}
@
; Pop new task's SPSR
MSR
SPSR_cxsf
,
R4
MSR
SPSR_cxsf
,
R4
LDMFD
SP
!,
{
R4
}
@
; Pop new task's CPSR
MSR
SPSR_cxsf
,
R4
LDMFD
SP
!,
{
R0
-
R12
,
LR
,
PC
}^
@
; pop new task's R0-R12,LR & PC
LDMFD
SP
!,
{
R0
-
R12
,
LR
,
PC
}^
@
; pop new task's R0-R12,LR & PC SPSR 2 CPSR
libcpu/arm/arm926/start_iar.S
浏览文件 @
175e357a
...
@@ -262,24 +262,19 @@ rt_hw_context_switch_interrupt_do:
...
@@ -262,24 +262,19 @@ rt_hw_context_switch_interrupt_do:
STR
R1
,
[
R0
]
; Save to flag variable
STR
R1
,
[
R0
]
; Save to flag variable
LDMFD
SP
!,
{
R0
-
R12
,
LR
}
; Reload saved registers
LDMFD
SP
!,
{
R0
-
R12
,
LR
}
; Reload saved registers
STMFD
SP
!,
{
R0
-
R3
}
; Save R0-R3
STMFD
SP
,
{
R0
-
R2
}
; Save R0-R2
MOV
R1
,
SP
; Save old task's SP to R1
SUB
R1
,
SP
,
#
4
*
3
; Save old task's SP to R1
ADD
SP
,
SP
,
#
16
; Restore SP
SUB
R2
,
LR
,
#
4
; Save old task's PC to R2
SUB
R2
,
LR
,
#
4
; Save old task's PC to R2
MRS
R
3
,
SPSR
; Get CPSR of interrupt thread
MRS
R
0
,
SPSR
; Get CPSR of interrupt thread
MSR
CPSR_c
,
#
MODE_SVC
|
NOINT
; Switch to SVC mode and no interrupt
MSR
CPSR_c
,
#
MODE_SVC
|
NOINT
; Switch to SVC mode and no interrupt
STMFD
SP
!,
{
R2
}
; Push old task's PC
STMFD
SP
!,
{
R2
}
; Push old task's PC
STMFD
SP
!,
{
R4
-
R12
,
LR
}
; Push old task's LR,R12-R4
STMFD
SP
!,
{
R3
-
R12
,
LR
}
; Push old task's LR,R12-R3
MOV
R4
,
R1
; Special optimised code below
LDMFD
R1
,
{
R1
-
R3
}
MOV
R5
,
R3
STMFD
SP
!,
{
R1
-
R3
}
; Push old task's R2-R0
LDMFD
R4
!,
{
R0
-
R3
}
STMFD
SP
!,
{
R0
}
; Push old task's CPSR
STMFD
SP
!,
{
R0
-
R3
}
; Push old task's R3-R0
STMFD
SP
!,
{
R5
}
; Push old task's CPSR
MRS
R4
,
SPSR
STMFD
SP
!,
{
R4
}
; Push old task's SPSR
LDR
R4
,
=
rt_interrupt_from_thread
LDR
R4
,
=
rt_interrupt_from_thread
LDR
R5
,
[
R4
]
; R5 = stack ptr in old tasks's TCB
LDR
R5
,
[
R4
]
; R5 = stack ptr in old tasks's TCB
...
@@ -291,8 +286,6 @@ rt_hw_context_switch_interrupt_do:
...
@@ -291,8 +286,6 @@ rt_hw_context_switch_interrupt_do:
LDMFD
SP
!,
{
R4
}
; Pop new task's SPSR
LDMFD
SP
!,
{
R4
}
; Pop new task's SPSR
MSR
SPSR_cxsf
,
R4
MSR
SPSR_cxsf
,
R4
LDMFD
SP
!,
{
R4
}
; Pop new task's CPSR
MSR
SPSR_cxsf
,
R4
LDMFD
SP
!,
{
R0
-
R12
,
LR
,
PC
}^
; pop new task's R0-R12,LR & PC
LDMFD
SP
!,
{
R0
-
R12
,
LR
,
PC
}^
; pop new task's R0-R12,LR & PC SPSR to CPSR
END
END
libcpu/arm/arm926/start_rvds.S
浏览文件 @
175e357a
...
@@ -274,24 +274,19 @@ rt_hw_context_switch_interrupt_do PROC
...
@@ -274,24 +274,19 @@ rt_hw_context_switch_interrupt_do PROC
STR
R1
,
[
R0
]
; Save to flag variable
STR
R1
,
[
R0
]
; Save to flag variable
LDMFD
SP
!,
{
R0
-
R12
,
LR
}
; Reload saved registers
LDMFD
SP
!,
{
R0
-
R12
,
LR
}
; Reload saved registers
STMFD
SP
!,
{
R0
-
R3
}
; Save R0-R3
STMFD
SP
,
{
R0
-
R2
}
; Save R0-R2
MOV
R1
,
SP
; Save old task's SP to R1
SUB
R1
,
SP
,
#
4
*
3
; Save old task's SP to R1
ADD
SP
,
SP
,
#
16
; Restore SP
SUB
R2
,
LR
,
#
4
; Save old task's PC to R2
SUB
R2
,
LR
,
#
4
; Save old task's PC to R2
MRS
R
3
,
SPSR
; Get CPSR of interrupt thread
MRS
R
0
,
SPSR
; Get CPSR of interrupt thread
MSR
CPSR_c
,
#
MODE_SVC
:OR:
NOINT
; Switch to SVC mode and no interrupt
MSR
CPSR_c
,
#
MODE_SVC
:OR:
NOINT
; Switch to SVC mode and no interrupt
STMFD
SP
!,
{
R2
}
; Push old task's PC
STMFD
SP
!,
{
R2
}
; Push old task's PC
STMFD
SP
!,
{
R4
-
R12
,
LR
}
; Push old task's LR,R12-R4
STMFD
SP
!,
{
R3
-
R12
,
LR
}
; Push old task's LR,R12-R3
MOV
R4
,
R1
; Special optimised code below
LDMFD
R1
,
{
R1
-
R3
}
MOV
R5
,
R3
STMFD
SP
!,
{
R1
-
R3
}
; Push old task's R2-R0
LDMFD
R4
!,
{
R0
-
R3
}
STMFD
SP
!,
{
R0
}
; Push old task's CPSR
STMFD
SP
!,
{
R0
-
R3
}
; Push old task's R3-R0
STMFD
SP
!,
{
R5
}
; Push old task's CPSR
MRS
R4
,
SPSR
STMFD
SP
!,
{
R4
}
; Push old task's SPSR
LDR
R4
,
=
rt_interrupt_from_thread
LDR
R4
,
=
rt_interrupt_from_thread
LDR
R5
,
[
R4
]
; R5 = stack ptr in old tasks's TCB
LDR
R5
,
[
R4
]
; R5 = stack ptr in old tasks's TCB
...
@@ -303,10 +298,8 @@ rt_hw_context_switch_interrupt_do PROC
...
@@ -303,10 +298,8 @@ rt_hw_context_switch_interrupt_do PROC
LDMFD
SP
!,
{
R4
}
; Pop new task's SPSR
LDMFD
SP
!,
{
R4
}
; Pop new task's SPSR
MSR
SPSR_cxsf
,
R4
MSR
SPSR_cxsf
,
R4
LDMFD
SP
!,
{
R4
}
; Pop new task's CPSR
MSR
SPSR_cxsf
,
R4
LDMFD
SP
!,
{
R0
-
R12
,
LR
,
PC
}^
; pop new task's R0-R12,LR & PC
LDMFD
SP
!,
{
R0
-
R12
,
LR
,
PC
}^
; pop new task's R0-R12,LR & PC SPSR to CPSR
ENDP
ENDP
IF
:DEF:
__MICROLIB
IF
:DEF:
__MICROLIB
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录