Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
py_free-物联智能
rt-thread
提交
fa38e8d1
R
rt-thread
项目概览
py_free-物联智能
/
rt-thread
与 Fork 源项目一致
从无法访问的项目Fork
通知
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,发现更多精彩内容 >>
未验证
提交
fa38e8d1
编写于
12月 31, 2020
作者:
B
Bernard Xiong
提交者:
GitHub
12月 31, 2020
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #3240 from xlf605401969/c28x_fpu
[libcpu][c28x]add support for c28x mcu hardware fpu
上级
72bc0d8f
66d1510a
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
56 addition
and
1 deletion
+56
-1
libcpu/ti-dsp/c28x/context.s
libcpu/ti-dsp/c28x/context.s
+37
-1
libcpu/ti-dsp/c28x/cpuport.c
libcpu/ti-dsp/c28x/cpuport.c
+19
-0
未找到文件。
libcpu/ti-dsp/c28x/context.s
浏览文件 @
fa38e8d1
...
...
@@ -8,6 +8,7 @@
; 2018-09-01 xuzhuoyi the first version.
; 2019-06-17 zhaoxiaowei fix bugs of old c28x interrupt api.
; 2019-07-03 zhaoxiaowei add _rt_hw_calc_csb function to support __rt_ffs.
; 2019-12-05 xiaolifan add support for hardware fpu32
;
.
ref
_rt_interrupt_to_thread
...
...
@@ -24,6 +25,16 @@
.
def
_rt_hw_interrupt_thread_switch
.
def
_rt_hw_interrupt_disable
.
def
_rt_hw_interrupt_enable
;workaround for importing fpu settings from the compiler
.
cdecls
C
,
NOLIST
%{
#ifdef __TMS320C28XX_FPU32__
#define __FPU32__ 1
#else
#define __FPU32__ 0
#endif
%}
RT_CTX_SAVE
.
macro
...
...
@@ -38,12 +49,37 @@ RT_CTX_SAVE .macro
PUSH
XAR7
PUSH
XT
PUSH
RPC
.
if
__FPU32__
PUSH
RB
MOV32
*
SP
++,
STF
MOV32
*
SP
++,
R0H
MOV32
*
SP
++,
R1H
MOV32
*
SP
++,
R2H
MOV32
*
SP
++,
R3H
MOV32
*
SP
++,
R4H
MOV32
*
SP
++,
R5H
MOV32
*
SP
++,
R6H
MOV32
*
SP
++,
R7H
.
endif
.
endm
RT_CTX_RESTORE
.
macro
.
if
__FPU32__
MOV32
R7H
,
*--
SP
,
UNCF
MOV32
R6H
,
*--
SP
,
UNCF
MOV32
R5H
,
*--
SP
,
UNCF
MOV32
R4H
,
*--
SP
,
UNCF
MOV32
R3H
,
*--
SP
,
UNCF
MOV32
R2H
,
*--
SP
,
UNCF
MOV32
R1H
,
*--
SP
,
UNCF
MOV32
R0H
,
*--
SP
,
UNCF
MOV32
STF
,
*--
SP
POP
RB
.
endif
POP
RPC
POP
XT
...
...
libcpu/ti-dsp/c28x/cpuport.c
浏览文件 @
fa38e8d1
...
...
@@ -7,6 +7,7 @@
* Date Author Notes
* 2018-09-01 xuzhuoyi the first version.
* 2019-07-03 zhaoxiaowei add support for __rt_ffs.
* 2019-12-05 xiaolifan add support for hardware fpu32
*/
#include <rtthread.h>
...
...
@@ -22,6 +23,7 @@ extern rt_uint16_t rt_hw_get_st0(void);
extern
rt_uint16_t
rt_hw_get_st1
(
void
);
extern
int
rt_hw_calc_csb
(
int
value
);
struct
exception_stack_frame
{
rt_uint32_t
t_st0
;
...
...
@@ -49,6 +51,18 @@ struct stack_frame
rt_uint32_t
xt
;
rt_uint32_t
rpc
;
#ifdef __TMS320C28XX_FPU32__
rt_uint32_t
rb
;
rt_uint32_t
stf
;
rt_uint32_t
r0h
;
rt_uint32_t
r1h
;
rt_uint32_t
r2h
;
rt_uint32_t
r3h
;
rt_uint32_t
r4h
;
rt_uint32_t
r5h
;
rt_uint32_t
r6h
;
rt_uint32_t
r7h
;
#endif
};
...
...
@@ -83,6 +97,11 @@ rt_uint8_t *rt_hw_stack_init(void *tentry,
stack_frame
->
exception_stack_frame
.
return_address
=
(
unsigned
long
)
tentry
;
/* return_address */
stack_frame
->
rpc
=
(
unsigned
long
)
texit
;
#ifdef __TMS320C28XX_FPU32__
stack_frame
->
stf
=
0x00000200
;
stack_frame
->
rb
=
0
;
#endif
/* return task's current stack address */
return
stk
+
sizeof
(
struct
stack_frame
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录