Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
yunqingabc
rt-thread
提交
bb72be94
R
rt-thread
项目概览
yunqingabc
/
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,发现更多精彩内容 >>
提交
bb72be94
编写于
3月 26, 2013
作者:
B
Bernard Xiong
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
code cleanup for interrupt description
上级
17ab3fcd
变更
5
显示空白变更内容
内联
并排
Showing
5 changed file
with
285 addition
and
270 deletion
+285
-270
bsp/at91sam9260/rtconfig.h
bsp/at91sam9260/rtconfig.h
+2
-0
include/rthw.h
include/rthw.h
+26
-2
include/rtthread.h
include/rtthread.h
+0
-9
libcpu/arm/at91sam926x/interrupt.c
libcpu/arm/at91sam926x/interrupt.c
+255
-257
libcpu/arm/at91sam926x/trap.c
libcpu/arm/at91sam926x/trap.c
+2
-2
未找到文件。
bsp/at91sam9260/rtconfig.h
浏览文件 @
bb72be94
...
...
@@ -22,6 +22,8 @@
#define RT_USING_OVERFLOW_CHECK
#define RT_USING_INTERRUPT_INFO
/* Using Hook */
#define RT_USING_HOOK
...
...
include/rthw.h
浏览文件 @
bb72be94
...
...
@@ -24,6 +24,9 @@
extern
"C"
{
#endif
/*
* CPU interfaces
*/
void
rt_hw_cpu_icache_enable
(
void
);
void
rt_hw_cpu_icache_disable
(
void
);
rt_base_t
rt_hw_cpu_icache_status
(
void
);
...
...
@@ -38,6 +41,24 @@ rt_uint8_t *rt_hw_stack_init(void *entry,
rt_uint8_t
*
stack_addr
,
void
*
exit
);
/*
* Interrupt handler definition
*/
typedef
void
(
*
rt_isr_handler_t
)(
int
vector
,
void
*
param
);
struct
rt_irq_desc
{
rt_isr_handler_t
handler
;
void
*
param
;
#ifdef RT_USING_INTERRUPT_INFO
char
name
[
RT_NAME_MAX
];
rt_uint32_t
counter
;
#endif
};
/*
* Interrupt interfaces
*/
void
rt_hw_interrupt_init
(
void
);
void
rt_hw_interrupt_mask
(
int
vector
);
void
rt_hw_interrupt_umask
(
int
vector
);
...
...
@@ -45,10 +66,13 @@ rt_isr_handler_t rt_hw_interrupt_install(int vector,
rt_isr_handler_t
handler
,
void
*
param
,
char
*
name
);
void
rt_hw_interrupt_handle
(
int
vector
);
rt_base_t
rt_hw_interrupt_disable
(
void
);
void
rt_hw_interrupt_enable
(
rt_base_t
level
);
/*
* Context interfaces
*/
void
rt_hw_context_switch
(
rt_uint32_t
from
,
rt_uint32_t
to
);
void
rt_hw_context_switch_to
(
rt_uint32_t
to
);
void
rt_hw_context_switch_interrupt
(
rt_uint32_t
from
,
rt_uint32_t
to
);
...
...
@@ -59,7 +83,7 @@ void rt_hw_backtrace(rt_uint32_t *fp, rt_uint32_t thread_entry);
void
rt_hw_show_memory
(
rt_uint32_t
addr
,
rt_uint32_t
size
);
/*
*
e
xception interfaces
*
E
xception interfaces
*/
void
rt_hw_exception_install
(
rt_err_t
(
*
exception_handle
)(
void
*
context
));
...
...
include/rtthread.h
浏览文件 @
bb72be94
...
...
@@ -425,15 +425,6 @@ void rt_module_unload_sethook(void (*hook)(rt_module_t module));
/*
* interrupt service
*/
typedef
void
(
*
rt_isr_handler_t
)(
int
vector
,
void
*
param
);
struct
rt_irq_desc
{
char
irq_name
[
RT_NAME_MAX
];
rt_isr_handler_t
isr_handle
;
void
*
param
;
rt_uint32_t
interrupt_cnt
;
};
/*
* rt_interrupt_enter and rt_interrupt_leave only can be called by BSP
...
...
libcpu/arm/at91sam926x/interrupt.c
浏览文件 @
bb72be94
...
...
@@ -12,7 +12,7 @@
* 2011-01-13 weety first version
*/
#include <rt
thread
.h>
#include <rt
hw
.h>
#include "at91sam926x.h"
#define MAX_HANDLERS (AIC_IRQS + PIN_IRQS)
...
...
@@ -114,7 +114,7 @@ rt_isr_handler_t at91_gpio_irq_handle(rt_uint32_t vector, void *param)
if
(
isr
&
1
)
{
parameter
=
irq_desc
[
irq_n
].
param
;
irq_desc
[
irq_n
].
isr_handle
(
irq_n
,
parameter
);
irq_desc
[
irq_n
].
handler
(
irq_n
,
parameter
);
}
isr
>>=
1
;
irq_n
++
;
...
...
@@ -173,10 +173,10 @@ static void at91_gpio_irq_init()
idx
=
AT91SAM9260_ID_PIOA
;
for
(
i
=
0
;
i
<
3
;
i
++
)
{
rt_snprintf
(
irq_desc
[
idx
].
irq_
name
,
RT_NAME_MAX
-
1
,
name
[
i
]);
irq_desc
[
idx
].
isr_handle
=
(
rt_isr_handler_t
)
at91_gpio_irq_handle
;
rt_snprintf
(
irq_desc
[
idx
].
name
,
RT_NAME_MAX
-
1
,
name
[
i
]);
irq_desc
[
idx
].
handler
=
(
rt_isr_handler_t
)
at91_gpio_irq_handle
;
irq_desc
[
idx
].
param
=
RT_NULL
;
irq_desc
[
idx
].
interrupt_cnt
=
0
;
irq_desc
[
idx
].
counter
=
0
;
idx
++
;
}
...
...
@@ -204,10 +204,9 @@ void rt_hw_interrupt_init(void)
/* init exceptions table */
for
(
idx
=
0
;
idx
<
MAX_HANDLERS
;
idx
++
)
{
rt_snprintf
(
irq_desc
[
idx
].
irq_
name
,
RT_NAME_MAX
-
1
,
"default"
);
irq_desc
[
idx
].
isr_handle
=
(
rt_isr_handler_t
)
rt_hw_interrupt_handle
;
rt_snprintf
(
irq_desc
[
idx
].
name
,
RT_NAME_MAX
-
1
,
"default"
);
irq_desc
[
idx
].
handler
=
(
rt_isr_handler_t
)
rt_hw_interrupt_handle
;
irq_desc
[
idx
].
param
=
RT_NULL
;
irq_desc
[
idx
].
interrupt_cnt
=
0
;
}
at91_gpio_irq_init
();
...
...
@@ -316,13 +315,12 @@ rt_isr_handler_t rt_hw_interrupt_install(int vector, rt_isr_handler_t handler,
if
(
vector
<
MAX_HANDLERS
)
{
old_handler
=
irq_desc
[
vector
].
isr_handle
;
old_handler
=
irq_desc
[
vector
].
handler
;
if
(
handler
!=
RT_NULL
)
{
rt_snprintf
(
irq_desc
[
vector
].
irq_
name
,
RT_NAME_MAX
-
1
,
"%s"
,
name
);
irq_desc
[
vector
].
isr_handle
=
(
rt_isr_handler_t
)
handler
;
rt_snprintf
(
irq_desc
[
vector
].
name
,
RT_NAME_MAX
-
1
,
"%s"
,
name
);
irq_desc
[
vector
].
handler
=
(
rt_isr_handler_t
)
handler
;
irq_desc
[
vector
].
param
=
param
;
irq_desc
[
vector
].
interrupt_cnt
=
0
;
}
}
...
...
@@ -372,9 +370,9 @@ void list_irq(void)
rt_kprintf
(
"number
\t
count
\t
name
\n
"
);
for
(
irq
=
0
;
irq
<
MAX_HANDLERS
;
irq
++
)
{
if
(
rt_strncmp
(
irq_desc
[
irq
].
irq_
name
,
"default"
,
sizeof
(
"default"
)))
if
(
rt_strncmp
(
irq_desc
[
irq
].
name
,
"default"
,
sizeof
(
"default"
)))
{
rt_kprintf
(
"%02ld: %10ld %s
\n
"
,
irq
,
irq_desc
[
irq
].
interrupt_cnt
,
irq_desc
[
irq
].
irq_
name
);
rt_kprintf
(
"%02ld: %10ld %s
\n
"
,
irq
,
irq_desc
[
irq
].
name
);
}
}
}
...
...
libcpu/arm/at91sam926x/trap.c
浏览文件 @
bb72be94
...
...
@@ -159,13 +159,13 @@ void rt_hw_trap_irq()
//at91_sys_write(AT91_AIC_EOICR, 0x55555555);
/* get interrupt service routine */
isr_func
=
irq_desc
[
irq
].
isr_handle
;
isr_func
=
irq_desc
[
irq
].
handler
;
param
=
irq_desc
[
irq
].
param
;
/* turn to interrupt service routine */
isr_func
(
irq
,
param
);
at91_sys_write
(
AT91_AIC_EOICR
,
0x55555555
);
//EIOCR must be write any value after interrupt, or else can't response next interrupt
irq_desc
[
irq
].
interrupt_cnt
++
;
irq_desc
[
irq
].
counter
++
;
}
void
rt_hw_trap_fiq
()
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录