Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
天中雨水
rt-thread
提交
377c6e6c
R
rt-thread
项目概览
天中雨水
/
rt-thread
该项目与 Fork 源项目分叉
Fork自
RT-Thread / rt-thread
通知
2
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
rt-thread
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
377c6e6c
编写于
10月 20, 2013
作者:
G
Grissiom
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
cortex-r4: dump register on traps
We could not handle any traps except IRQ/FIQ.
上级
e1e563e8
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
121 addition
and
51 deletion
+121
-51
libcpu/arm/cortex-r4/armv7.h
libcpu/arm/cortex-r4/armv7.h
+4
-3
libcpu/arm/cortex-r4/start_ccs.asm
libcpu/arm/cortex-r4/start_ccs.asm
+45
-8
libcpu/arm/cortex-r4/start_gcc.S
libcpu/arm/cortex-r4/start_gcc.S
+35
-5
libcpu/arm/cortex-r4/trap.c
libcpu/arm/cortex-r4/trap.c
+20
-16
libcpu/arm/cortex-r4/vector_ccs.asm
libcpu/arm/cortex-r4/vector_ccs.asm
+9
-11
libcpu/arm/cortex-r4/vector_gcc.S
libcpu/arm/cortex-r4/vector_gcc.S
+8
-8
未找到文件。
libcpu/arm/cortex-r4/armv7.h
浏览文件 @
377c6e6c
...
...
@@ -5,10 +5,9 @@
#define VFP_DATA_NR 32
#endif
/* the stack without VFP registers */
struct
rt_hw_
base
_stack
/* the
exception
stack without VFP registers */
struct
rt_hw_
exp
_stack
{
unsigned
long
cpsr
;
unsigned
long
r0
;
unsigned
long
r1
;
unsigned
long
r2
;
...
...
@@ -22,8 +21,10 @@ struct rt_hw_base_stack
unsigned
long
r10
;
unsigned
long
fp
;
unsigned
long
ip
;
unsigned
long
sp
;
unsigned
long
lr
;
unsigned
long
pc
;
unsigned
long
cpsr
;
};
#define USERMODE 0x10
...
...
libcpu/arm/cortex-r4/start_ccs.asm
浏览文件 @
377c6e6c
...
...
@@ -492,14 +492,54 @@ turnon_VFP
subs
pc
,
lr
,
#
4
.endasmfunc
.def
_dabort
_push_svc_reg
.macro
sub
sp
,
sp
,
#
17
*
4
;/* Sizeof(struct rt_hw_exp_stack) */
stmia
sp
,
{
r0
-
r12
}
;/* Calling r0-r12 */
mov
r0
,
sp
mrs
r6
,
sp
sr
;/* Save CPSR */
str
lr
,
[
r0
,
#
15
*
4
]
;/* Push PC */
str
r6
,
[
r0
,
#
16
*
4
]
;/* Push CPSR */
cps
#
0x13
str
sp
,
[
r0
,
#
13
*
4
]
;/* Save calling SP */
str
lr
,
[
r0
,
#
14
*
4
]
;/* Save calling PC */
.endm
.ref
rt_hw_trap_svc
.def
vector_svc
.asmfunc
vector_svc:
_push_svc_reg
bl
rt_hw_trap_svc
sub
pc
,
pc
,
#
-
4
.endasmfunc
.ref
rt_hw_trap_pabt
.def
vector_pabort
.asmfunc
vector_pabort:
_push_svc_reg
bl
rt_hw_trap_pabt
sub
pc
,
pc
,
#
-
4
.endasmfunc
.ref
rt_hw_trap_dabt
.def
vector_dabort
.asmfunc
vector_dabort:
_push_svc_reg
bl
rt_hw_trap_dabt
sub
pc
,
pc
,
#
-
4
.endasmfunc
_dabort
stmfd
r13
!
,
{
r0
-
r12
,
lr
}
ldmfd
r13
!
,
{
r0
-
r12
,
lr
}
subs
pc
,
lr
,
#
8
.ref
rt_hw_trap_resv
.def
vector_resv
.asmfunc
vector_resv:
_push_svc_reg
bl
rt_hw_trap_resv
sub
pc
,
pc
,
#
-
4
.endasmfunc
;-------------------------------------------------------------------------------
; C++ construct table pointers
...
...
@@ -509,7 +549,4 @@ _dabort
__TI_PINIT_Base
.long
SHT$$INIT_ARRAY$$Base
__TI_PINIT_Limit
.long
SHT$$INIT_ARRAY$$Limit
;-------------------------------------------------------------------------------
libcpu/arm/cortex-r4/start_gcc.S
浏览文件 @
377c6e6c
...
...
@@ -445,8 +445,38 @@ turnon_VFP:
LDMIA
sp
!,
{
r0
}
subs
pc
,
lr
,
#
4
.
globl
_dabort
_dabort
:
stmfd
r13
!,
{
r0
-
r12
,
lr
}
ldmfd
r13
!,
{
r0
-
r12
,
lr
}
subs
pc
,
lr
,
#
8
.
macro
push_svc_reg
sub
sp
,
sp
,
#
17
*
4
@
/*
Sizeof
(
struct
rt_hw_exp_stack
)
*/
stmia
sp
,
{
r0
-
r12
}
@
/*
Calling
r0
-
r12
*/
mov
r0
,
sp
mrs
r6
,
spsr
@
/*
Save
CPSR
*/
str
lr
,
[
r0
,
#
15
*
4
]
@
/*
Push
PC
*/
str
r6
,
[
r0
,
#
16
*
4
]
@
/*
Push
CPSR
*/
cps
#
Mode_SVC
str
sp
,
[
r0
,
#
13
*
4
]
@
/*
Save
calling
SP
*/
str
lr
,
[
r0
,
#
14
*
4
]
@
/*
Save
calling
PC
*/
.
endm
.
globl
vector_svc
vector_svc
:
push_svc_reg
bl
rt_hw_trap_svc
b
.
.
globl
vector_pabort
vector_pabort
:
push_svc_reg
bl
rt_hw_trap_pabt
b
.
.
globl
vector_dabort
vector_dabort
:
push_svc_reg
bl
rt_hw_trap_dabt
b
.
.
globl
vector_resv
vector_resv
:
push_svc_reg
bl
rt_hw_trap_resv
b
.
libcpu/arm/cortex-r4/trap.c
浏览文件 @
377c6e6c
...
...
@@ -30,14 +30,14 @@
*
* @param regs the registers point
*/
void
rt_hw_show_register
(
struct
rt_hw_
base
_stack
*
regs
)
void
rt_hw_show_register
(
struct
rt_hw_
exp
_stack
*
regs
)
{
rt_kprintf
(
"Execption:
\n
"
);
rt_kprintf
(
"r00:0x%08x r01:0x%08x r02:0x%08x r03:0x%08x
\n
"
,
regs
->
r0
,
regs
->
r1
,
regs
->
r2
,
regs
->
r3
);
rt_kprintf
(
"r04:0x%08x r05:0x%08x r06:0x%08x r07:0x%08x
\n
"
,
regs
->
r4
,
regs
->
r5
,
regs
->
r6
,
regs
->
r7
);
rt_kprintf
(
"r08:0x%08x r09:0x%08x r10:0x%08x
\n
"
,
regs
->
r8
,
regs
->
r9
,
regs
->
r10
);
rt_kprintf
(
"fp :0x%08x ip :0x%08x
\n
"
,
regs
->
fp
,
regs
->
ip
);
rt_kprintf
(
"sp :0x%08x lr :0x%08x pc :0x%08x
\n
"
,
regs
+
1
,
regs
->
lr
,
regs
->
pc
);
rt_kprintf
(
"sp :0x%08x lr :0x%08x pc :0x%08x
\n
"
,
regs
->
sp
,
regs
->
lr
,
regs
->
pc
);
rt_kprintf
(
"cpsr:0x%08x
\n
"
,
regs
->
cpsr
);
}
...
...
@@ -49,7 +49,7 @@ void rt_hw_show_register (struct rt_hw_base_stack *regs)
*
* @note never invoke this function in application
*/
void
rt_hw_trap_udef
(
struct
rt_hw_
base
_stack
*
regs
)
void
rt_hw_trap_udef
(
struct
rt_hw_
exp
_stack
*
regs
)
{
rt_kprintf
(
"undefined instruction
\n
"
);
rt_hw_show_register
(
regs
);
...
...
@@ -67,12 +67,13 @@ void rt_hw_trap_udef(struct rt_hw_base_stack *regs)
*
* @note never invoke this function in application
*/
void
rt_hw_trap_s
wi
(
struct
rt_hw_base
_stack
*
regs
)
void
rt_hw_trap_s
vc
(
struct
rt_hw_exp
_stack
*
regs
)
{
rt_kprintf
(
"software interrupt
\n
"
);
rt_hw_show_register
(
regs
);
if
(
rt_thread_self
()
!=
RT_NULL
)
rt_kprintf
(
"Current Thread: %s
\n
"
,
rt_thread_self
()
->
name
);
#ifdef RT_USING_FINSH
list_thread
();
#endif
rt_hw_cpu_shutdown
();
}
...
...
@@ -84,12 +85,13 @@ void rt_hw_trap_swi(struct rt_hw_base_stack *regs)
*
* @note never invoke this function in application
*/
void
rt_hw_trap_pabt
(
struct
rt_hw_
base
_stack
*
regs
)
void
rt_hw_trap_pabt
(
struct
rt_hw_
exp
_stack
*
regs
)
{
rt_kprintf
(
"prefetch abort
\n
"
);
rt_hw_show_register
(
regs
);
if
(
rt_thread_self
()
!=
RT_NULL
)
rt_kprintf
(
"Current Thread: %s
\n
"
,
rt_thread_self
()
->
name
);
#ifdef RT_USING_FINSH
list_thread
();
#endif
rt_hw_cpu_shutdown
();
}
...
...
@@ -101,12 +103,13 @@ void rt_hw_trap_pabt(struct rt_hw_base_stack *regs)
*
* @note never invoke this function in application
*/
void
rt_hw_trap_dabt
(
struct
rt_hw_
base
_stack
*
regs
)
void
rt_hw_trap_dabt
(
struct
rt_hw_
exp
_stack
*
regs
)
{
rt_kprintf
(
"Data Abort "
);
rt_hw_show_register
(
regs
);
if
(
rt_thread_self
()
!=
RT_NULL
)
rt_kprintf
(
"Current Thread: %s
\n
"
,
rt_thread_self
()
->
name
);
#ifdef RT_USING_FINSH
list_thread
();
#endif
rt_hw_cpu_shutdown
();
}
...
...
@@ -117,12 +120,13 @@ void rt_hw_trap_dabt(struct rt_hw_base_stack *regs)
*
* @note never invoke this function in application
*/
void
rt_hw_trap_resv
(
struct
rt_hw_
base
_stack
*
regs
)
void
rt_hw_trap_resv
(
struct
rt_hw_
exp
_stack
*
regs
)
{
rt_kprintf
(
"
not used
\n
"
);
rt_kprintf
(
"
Reserved trap
\n
"
);
rt_hw_show_register
(
regs
);
if
(
rt_thread_self
()
!=
RT_NULL
)
rt_kprintf
(
"Current Thread: %s
\n
"
,
rt_thread_self
()
->
name
);
#ifdef RT_USING_FINSH
list_thread
();
#endif
rt_hw_cpu_shutdown
();
}
...
...
libcpu/arm/cortex-r4/vector_ccs.asm
浏览文件 @
377c6e6c
...
...
@@ -11,25 +11,23 @@
; import reference for interrupt routines
.ref
_reset
.ref
_dabort
.ref
turnon_VFP
.ref
vector_svc
.ref
vector_pabort
.ref
vector_dabort
.ref
vector_resv
.ref
IRQ_Handler
.def
resetEntry
;-------------------------------------------------------------------------------
; interrupt vectors
.def
resetEntry
resetEntry
b
_reset
b
turnon_VFP
svcEntry
b
svcEntry
prefetchEntry
b
prefetchEntry
b
_dabort
reservedEntry
b
reservedEntry
b
vector_svc
b
vector_pabort
b
vector_dabort
b
vector_resv
b
IRQ_Handler
ldr
pc
,[
pc
,
#
-
0x1b0
]
...
...
libcpu/arm/cortex-r4/vector_gcc.S
浏览文件 @
377c6e6c
...
...
@@ -11,8 +11,11 @@
@
import
reference
for
interrupt
routines
.
globl
_reset
.
globl
_dabort
.
globl
turnon_VFP
.
globl
vector_svc
.
globl
vector_pabort
.
globl
vector_dabort
.
globl
vector_resv
.
globl
IRQ_Handler
...
...
@@ -20,12 +23,9 @@
system_vectors
:
b
_reset
b
turnon_VFP
svcEntry
:
b
svcEntry
prefetchEntry
:
b
prefetchEntry
b
_dabort
reservedEntry
:
b
reservedEntry
b
vector_svc
b
vector_pabort
b
vector_dabort
b
vector_resv
b
IRQ_Handler
ldr
pc
,[
pc
,#-
0x1b0
]
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录