Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
ihbai
rt-thread
提交
4a2ce8bc
R
rt-thread
项目概览
ihbai
/
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,发现更多精彩内容 >>
提交
4a2ce8bc
编写于
11月 18, 2021
作者:
H
Huang bo
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
修改格式
上级
341e52d9
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
45 addition
and
34 deletion
+45
-34
bsp/ti-tms320c6678/driver/drv_timer.c
bsp/ti-tms320c6678/driver/drv_timer.c
+4
-4
libcpu/ti-dsp/c6x/interrupt.c
libcpu/ti-dsp/c6x/interrupt.c
+6
-1
libcpu/ti-dsp/c6x/trap.c
libcpu/ti-dsp/c6x/trap.c
+17
-11
libcpu/ti-dsp/c6x/trap.h
libcpu/ti-dsp/c6x/trap.h
+18
-18
未找到文件。
bsp/ti-tms320c6678/driver/drv_timer.c
浏览文件 @
4a2ce8bc
...
...
@@ -35,7 +35,7 @@ void rt_hw_systick_isr(void)
void
rt_hw_system_timer_init
(
void
)
{
// initial system timer interrupt, map local timer interrupt to INT14
gpCGEM_regs
->
INTMUX3
=
(
CSL_GEM_TINTLN
<<
CSL_CGEM_INTMUX3_INTSEL14_SHIFT
);
gpCGEM_regs
->
INTMUX3
=
(
CSL_GEM_TINTLN
<<
CSL_CGEM_INTMUX3_INTSEL14_SHIFT
);
// enable CPU INT14
CPU_interrupt_enable
(
1
<<
14
);
...
...
@@ -55,10 +55,10 @@ void rt_hw_system_timer_start(void)
gpBootCfgRegs
->
TOUTSEL
=
(
DNUM
*
2
)
<<
CSL_BOOTCFG_TOUTSEL_TOUTSEL0_SHIFT
;
// configure the timer to generate clocks and interrupts
tmrCfg
.
timer_num
=
DNUM
;
tmrCfg
.
timerMode
=
TIMER_PERIODIC_CLOCK
;
tmrCfg
.
timer_num
=
DNUM
;
tmrCfg
.
timerMode
=
TIMER_PERIODIC_CLOCK
;
tmrCfg
.
period
=
(
unsigned
long
long
)
RT_TICK_PER_SECOND
*
gDSP_Core_Speed_Hz
/
6000
;
tmrCfg
.
reload_period
=
0
;
tmrCfg
.
reload_period
=
0
;
// initial timer
Timer64_Init
(
&
tmrCfg
);
...
...
libcpu/ti-dsp/c6x/interrupt.c
浏览文件 @
4a2ce8bc
...
...
@@ -8,7 +8,6 @@
* 2021-11-16 Dystopia the first version
*/
#include "interrupt.h"
#include "c66xx.h"
#include "trap.h"
...
...
@@ -46,7 +45,9 @@ void rt_hw_interrupt_init(void)
void
rt_hw_interrupt_mask
(
int
vector
)
{
if
(
vector
<
0
||
vector
>=
MAX_HANDLERS
)
{
return
;
}
}
/**
...
...
@@ -56,7 +57,9 @@ void rt_hw_interrupt_mask(int vector)
void
rt_hw_interrupt_umask
(
int
vector
)
{
if
(
vector
<
0
||
vector
>=
MAX_HANDLERS
)
{
return
;
}
}
/**
...
...
@@ -90,5 +93,7 @@ rt_isr_handler_t rt_hw_interrupt_install(int vector, rt_isr_handler_t handler,
void
rt_hw_interrupt_clear
(
int
vector
)
{
if
(
vector
<
0
||
vector
>=
MAX_HANDLERS
)
{
return
;
}
}
libcpu/ti-dsp/c6x/trap.c
浏览文件 @
4a2ce8bc
...
...
@@ -12,9 +12,8 @@
#include "c66xx.h"
#include <rthw.h>
#include <rtthread.h>
#include <rtdef.h>
#include <rtthread.h>
#define RT_SYS_STACK_SIZE 4096
...
...
@@ -136,16 +135,18 @@ static struct rt_exception_info iexcept_table[10] = {
static
int
process_iexcept
(
struct
rt_hw_exp_stack_register
*
regs
)
{
unsigned
int
iexcept_report
=
get_iexcept
();
unsigned
int
iexcept_num
;
unsigned
int
iexcept_num
=
0
;
ack_exception
(
EXCEPT_TYPE_IXF
);
while
(
iexcept_report
)
{
while
(
iexcept_report
)
{
iexcept_num
=
__ffs
(
iexcept_report
);
iexcept_report
&=
~
(
1
<<
iexcept_num
);
set_iexcept
(
iexcept_report
);
if
(
*
(
unsigned
int
*
)
regs
->
pc
==
BKPT_OPCODE
)
{
if
(
*
(
unsigned
int
*
)
regs
->
pc
==
BKPT_OPCODE
)
{
/* This is a breakpoint */
struct
rt_exception_info
bkpt_exception
=
{
" - undefined instruction"
,
ABORT_TYPE_UNDDEF
,
ABORT_BRKPT_ILL
};
do_trap
(
&
bkpt_exception
,
regs
);
...
...
@@ -300,10 +301,12 @@ static void process_except(struct rt_hw_exp_stack_register *regs)
{
int
except_num
;
int
bank
=
0
;
int
i
;
int
i
=
0
;
for
(
i
=
0
;
i
<=
3
;
i
++
)
{
while
(
INTC_MEXPMASK
[
i
])
{
for
(
i
=
0
;
i
<=
3
;
i
++
)
{
while
(
INTC_MEXPMASK
[
i
])
{
__dint
();
except_num
=
__ffs
(
INTC_MEXPMASK
[
i
]);
INTC_MEXPMASK
[
i
]
&=
~
(
1
<<
except_num
);
/* ack the external exception */
...
...
@@ -317,14 +320,13 @@ static void process_except(struct rt_hw_exp_stack_register *regs)
}
extern
void
hw_nmi_handler
(
struct
rt_hw_exp_stack_register
*
regs
);
/*
* Main exception processing
*/
int
rt_hw_process_exception
(
struct
rt_hw_exp_stack_register
*
regs
)
{
int
type
;
int
type_num
;
int
type
=
0
;
int
type_num
=
0
;
int
ie_num
=
9
;
/* default is unknown exception */
while
((
type
=
get_except_type
())
!=
0
)
{
...
...
@@ -334,12 +336,16 @@ int rt_hw_process_exception(struct rt_hw_exp_stack_register *regs)
case
EXCEPT_TYPE_NXF
:
/* NMI exception */
ack_exception
(
EXCEPT_TYPE_NXF
);
/* clear exception */
if
(
hw_nmi_handler
!=
RT_NULL
)
{
hw_nmi_handler
(
regs
);
}
break
;
case
EXCEPT_TYPE_IXF
:
/* internal exception */
if
(
process_iexcept
(
regs
))
{
return
1
;
}
break
;
case
EXCEPT_TYPE_EXC
:
/* external exception */
...
...
libcpu/ti-dsp/c6x/trap.h
浏览文件 @
4a2ce8bc
...
...
@@ -41,34 +41,34 @@
enum
SYSTEM_TRAP_CODE
{
ABORT_BUS_ADDRERR
=
0
,
// bus address error
ABORT_BUS_ACCERR
,
// bus access permission error
ABORT_OPCODE_ILL
,
// illegal opcode
ABORT_PRVREG_ILL
,
// privilege register
ABORT_PRVOPC_ILL
,
// privileged opcode
ABORT_ILLTRP_ILL
,
// illegal trap
ABORT_BRKPT_ILL
,
// handling breakpoints
ABORT_BUS_ADDRERR
=
0
,
// bus address error
ABORT_BUS_ACCERR
,
// bus access permission error
ABORT_OPCODE_ILL
,
// illegal opcode
ABORT_PRVREG_ILL
,
// privilege register
ABORT_PRVOPC_ILL
,
// privileged opcode
ABORT_ILLTRP_ILL
,
// illegal trap
ABORT_BRKPT_ILL
,
// handling breakpoints
};
/*
* abort types
*/
#define
ABORT_TYPE_BUS
0 // bus access abnormal
#define ABORT_TYPE_MAP
1 // page table mapping error
#define
ABORT_TYPE_UNDDEF
0xff // undefined exception
#define ABORT_TYPE_FATAL
0xffffffff // fatal error
#define
ABORT_TYPE_BUS
0 // bus access abnormal
#define ABORT_TYPE_MAP
1 // page table mapping error
#define
ABORT_TYPE_UNDDEF
0xff // undefined exception
#define ABORT_TYPE_FATAL
0xffffffff // fatal error
struct
rt_exception_info
{
char
*
kernel_str
;
int
type
;
int
code
;
char
*
kernel_str
;
int
type
;
int
code
;
};
#define BKPT_OPCODE
0x56454314
/* illegal opcode */
#define INTC_MEXPMASK
__SYSREGA(0x018000e0, unsigned int)
#define BKPT_OPCODE
0x56454314
/* illegal opcode */
#define INTC_MEXPMASK
__SYSREGA(0x018000e0, unsigned int)
#define __ffs(a)
(_lmbd(1, _bitr(a)))
#define __fls(a)
(!(a) ? 0 : (32 - _lmbd(1, (a))))
#define __ffs(a)
(_lmbd(1, _bitr(a)))
#define __fls(a)
(!(a) ? 0 : (32 - _lmbd(1, (a))))
extern
void
rt_trap_init
(
void
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录