Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Mozi
rt-thread
提交
697a4495
R
rt-thread
项目概览
Mozi
/
rt-thread
与 Fork 源项目一致
Fork自
RT-Thread / rt-thread
通知
0
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,发现更多精彩内容 >>
提交
697a4495
编写于
9月 03, 2018
作者:
xuzhuoyi96
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[bsp][tms320f28379d] Add support for upward-growing stack
上级
d85981a7
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
20 addition
and
26 deletion
+20
-26
bsp/tms320f28379d/drivers/board.c
bsp/tms320f28379d/drivers/board.c
+3
-0
bsp/tms320f28379d/rtconfig.h
bsp/tms320f28379d/rtconfig.h
+1
-3
libcpu/c28x/context.s
libcpu/c28x/context.s
+5
-18
libcpu/c28x/cpuport.c
libcpu/c28x/cpuport.c
+5
-5
src/thread.c
src/thread.c
+6
-0
未找到文件。
bsp/tms320f28379d/drivers/board.c
浏览文件 @
697a4495
...
...
@@ -16,6 +16,8 @@
#include "board.h"
#include "F28x_Project.h"
extern
interrupt
void
RTOSINT_Handler
();
/**
* This is the timer interrupt service routine.
...
...
@@ -51,6 +53,7 @@ void rt_hw_board_init()
EALLOW
;
// This is needed to write to EALLOW protected registers
PieVectTable
.
TIMER2_INT
=
&
cpu_timer2_isr
;
PieVectTable
.
RTOS_INT
=
&
RTOSINT_Handler
;
EDIS
;
InitCpuTimers
();
...
...
bsp/tms320f28379d/rtconfig.h
浏览文件 @
697a4495
...
...
@@ -15,6 +15,7 @@
#define RT_USING_HOOK
#define RT_IDEL_HOOK_LIST_SIZE 4
#define IDLE_THREAD_STACK_SIZE 1024
#define RT_STACK_UPWARD_GROW
#define RT_DEBUG
/* Inter-Thread communication */
...
...
@@ -37,9 +38,6 @@
//#define RT_USING_CONSOLE
#define RT_CONSOLEBUF_SIZE 128
#define RT_CONSOLE_DEVICE_NAME "uart2"
#define ARCH_ARM
#define ARCH_ARM_CORTEX_M
#define ARCH_ARM_CORTEX_M4
/* RT-Thread Components */
...
...
libcpu/c28x/context.s
浏览文件 @
697a4495
...
...
@@ -86,6 +86,7 @@ _rt_hw_interrupt_enable:
.
asmfunc
_rt_hw_context_switch_interrupt
:
_rt_hw_context_switch
:
MOV
AR0
,
AL
; set rt_thread_switch_interrupt_flag to 1
MOVL
XAR2
,
#
_rt_thread_switch_interrupt_flag
MOVL
XAR3
,
*
XAR2
...
...
@@ -96,7 +97,7 @@ _rt_hw_context_switch:
MOVL
*
XAR2
,
XAR3
MOVL
XAR2
,
#
_rt_interrupt_from_thread
; set rt_interrupt_from_thread
MOVL
*
XAR2
,
XAR0
MOVL
*
XAR2
,
XAR0
_reswitch
:
MOVL
XAR2
,
#
_rt_interrupt_to_thread
; set rt_interrupt_to_thread
...
...
@@ -162,21 +163,8 @@ switch_to_thread:
; LDMFD r1!, {r3} ; pop flag
;#endif
RT_CTX_RESTORE
; pop r4 - r11 register
;#if defined (__VFP_FP__) && !defined(__SOFTFP__)
; CMP r3, #0 ; if(flag_r3 != 0)
; VLDMIANE r1!, {d8 - d15} ; pop FPU register s16~s31
;#endif
MOV
@
SP
,
AR1
; update stack pointer
;#if defined (__VFP_FP__) && !defined(__SOFTFP__)
; ORR lr, lr, #0x10 ; lr |= (1 << 4), clean FPCA.
; CMP r3, #0 ; if(flag_r3 != 0)
; BICNE lr, lr, #0x10 ; lr &= ~(1 << 4), set FPCA.
;#endif
MOV
@
SP
,
AR1
RT_CTX_RESTORE
; pop r4 - r11 register
rtosint_exit
:
; restore interrupt
...
...
@@ -206,8 +194,7 @@ _rt_hw_get_st1:
.
asmfunc
_rt_hw_context_switch_to
:
MOV
AR1
,
#
_rt_interrupt_to_thread
MOV
AL
,
*
AR1
MOV
AR0
,
AL
MOV
*
AR1
,
AL
;#if defined (__VFP_FP__) && !defined(__SOFTFP__)
; CLEAR CONTROL.FPCA
...
...
libcpu/c28x/cpuport.c
浏览文件 @
697a4495
...
...
@@ -34,6 +34,7 @@ struct exception_stack_frame
struct
stack_frame
{
struct
exception_stack_frame
exception_stack_frame
;
/* r4 ~ r11 register */
rt_uint16_t
ar0h
;
...
...
@@ -48,7 +49,6 @@ struct stack_frame
rt_uint32_t
rpc
;
struct
exception_stack_frame
exception_stack_frame
;
};
rt_uint8_t
*
rt_hw_stack_init
(
void
*
tentry
,
...
...
@@ -60,9 +60,9 @@ rt_uint8_t *rt_hw_stack_init(void *tentry,
rt_uint8_t
*
stk
;
unsigned
long
i
;
stk
=
stack_addr
+
sizeof
(
rt_uint32_t
)
;
stk
=
(
rt_uint8_t
*
)
RT_ALIGN
_DOWN
((
rt_uint32_t
)
stk
,
8
);
stk
-=
sizeof
(
struct
stack_frame
);
stk
=
stack_addr
;
stk
=
(
rt_uint8_t
*
)
RT_ALIGN
((
rt_uint32_t
)
stk
,
8
);
//
stk -= sizeof(struct stack_frame);
stack_frame
=
(
struct
stack_frame
*
)
stk
;
...
...
@@ -81,7 +81,7 @@ rt_uint8_t *rt_hw_stack_init(void *tentry,
stack_frame
->
exception_stack_frame
.
return_address
=
(
unsigned
long
)
tentry
;
/* return_address */
/* return task's current stack address */
return
stk
;
return
stk
+
sizeof
(
struct
stack_frame
)
;
}
/**
...
...
src/thread.c
浏览文件 @
697a4495
...
...
@@ -150,9 +150,15 @@ static rt_err_t _rt_thread_init(struct rt_thread *thread,
/* init thread stack */
rt_memset
(
thread
->
stack_addr
,
'#'
,
thread
->
stack_size
);
#ifdef RT_STACK_UPWARD_GROW
thread
->
sp
=
(
void
*
)
rt_hw_stack_init
(
thread
->
entry
,
thread
->
parameter
,
(
void
*
)((
char
*
)
thread
->
stack_addr
),
(
void
*
)
rt_thread_exit
);
#else
thread
->
sp
=
(
void
*
)
rt_hw_stack_init
(
thread
->
entry
,
thread
->
parameter
,
(
void
*
)((
char
*
)
thread
->
stack_addr
+
thread
->
stack_size
-
4
),
(
void
*
)
rt_thread_exit
);
#endif
/* priority init */
RT_ASSERT
(
priority
<
RT_THREAD_PRIORITY_MAX
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录