Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
wwsmg1
rt-thread
提交
d781e564
R
rt-thread
项目概览
wwsmg1
/
rt-thread
与 Fork 源项目一致
Fork自
RT-Thread / rt-thread
通知
1
Star
1
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,发现更多精彩内容 >>
提交
d781e564
编写于
3月 31, 2013
作者:
B
Bernard Xiong
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #71 from BernardXiong/master
fix interrupt compiling issue for PPC.
上级
8c50d0f2
edef109d
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
18 addition
and
14 deletion
+18
-14
libcpu/ppc/ppc405/interrupt.c
libcpu/ppc/ppc405/interrupt.c
+15
-11
libcpu/ppc/ppc405/serial.c
libcpu/ppc/ppc405/serial.c
+3
-3
未找到文件。
libcpu/ppc/ppc405/interrupt.c
浏览文件 @
d781e564
...
...
@@ -12,7 +12,7 @@
* 2009-01-05 Bernard first version
*/
#include <rt
thread
.h>
#include <rt
hw
.h>
#include <asm/ppc4xx.h>
#include <asm/processor.h>
...
...
@@ -21,12 +21,12 @@ extern volatile rt_uint8_t rt_interrupt_nest;
/* exception and interrupt handler table */
#define MAX_HANDLERS 32
rt_isr_handler_t
isr_table
[
MAX_HANDLERS
];
struct
rt_irq_desc
isr_table
[
MAX_HANDLERS
];
rt_uint32_t
rt_interrupt_from_thread
,
rt_interrupt_to_thread
;
rt_uint32_t
rt_thread_switch_interrput_flag
;
rt_isr_handler_t
rt_hw_interrupt_handle
(
rt_uint32_t
vector
)
rt_isr_handler_t
rt_hw_interrupt_handle
r
(
rt_uint32_t
vector
,
void
*
param
)
{
rt_kprintf
(
"Unhandled interrupt %d occured!!!
\n
"
,
vector
);
return
RT_NULL
;
...
...
@@ -42,9 +42,9 @@ void uic_int_handler (unsigned int vec)
rt_interrupt_enter
();
/* Allow external interrupts to the CPU. */
if
(
isr_table
[
vec
]
!=
0
)
if
(
isr_table
[
vec
]
.
handler
!=
0
)
{
(
*
isr_table
[
vec
]
)(
vec
);
(
*
isr_table
[
vec
]
.
handler
)(
vec
,
isr_table
[
vec
].
param
);
}
uic_irq_ack
(
vec
);
...
...
@@ -78,21 +78,24 @@ void uic_interrupt(rt_uint32_t uic_base, int vec_base)
}
}
void
rt_hw_interrupt_install
(
int
vector
,
rt_isr_handler_t
new_handler
,
rt_isr_handler_t
*
old_handler
)
rt_isr_handler_t
rt_hw_interrupt_install
(
int
vector
,
rt_isr_handler_t
new_handler
,
void
*
param
,
char
*
name
)
{
int
intVal
;
rt_isr_handler_t
old_handler
;
if
(((
int
)
vector
<
0
)
||
((
int
)
vector
>=
MAX_HANDLERS
))
{
return
;
/* out of range */
return
RT_NULL
;
/* out of range */
}
/* install the handler in the system interrupt table */
intVal
=
rt_hw_interrupt_disable
();
/* lock interrupts to prevent races */
if
(
*
old_handler
!=
RT_NULL
)
*
old_handler
=
isr_table
[
vector
];
if
(
new_handler
!=
RT_NULL
)
isr_table
[
vector
]
=
new_handler
;
old_handler
=
isr_table
[
vector
].
handler
;
isr_table
[
vector
].
handler
=
new_handler
;
isr_table
[
vector
].
param
=
param
;
rt_hw_interrupt_enable
(
intVal
);
}
...
...
@@ -120,7 +123,8 @@ void rt_hw_interrupt_init()
/* set default interrupt handler */
for
(
vector
=
0
;
vector
<
MAX_HANDLERS
;
vector
++
)
{
isr_table
[
vector
]
=
(
rt_isr_handler_t
)
rt_hw_interrupt_handle
;
isr_table
[
vector
].
handler
=
(
rt_isr_handler_t
)
rt_hw_interrupt_handler
;
isr_table
[
vector
].
param
=
RT_NULL
;
}
/* initialize interrupt nest, and context in thread sp */
...
...
libcpu/ppc/ppc405/serial.c
浏览文件 @
d781e564
...
...
@@ -220,12 +220,12 @@ void rt_serial_set_baudrate(struct rt_ppc405_serial* device)
out_8
((
rt_uint8_t
*
)
device
->
hw_base
+
UART_DLM
,
bdiv
>>
8
);
/* set baudrate divisor */
}
void
rt_serial_isr
(
int
irqno
)
void
rt_serial_isr
(
int
irqno
,
void
*
param
)
{
unsigned
char
status
;
struct
rt_ppc405_serial
*
device
;
device
=
(
struct
rt_ppc405_serial
*
)
&
ppc405_serial
;
device
=
(
struct
rt_ppc405_serial
*
)
param
;
status
=
in_8
((
rt_uint8_t
*
)
device
->
hw_base
+
UART_LSR
);
if
(
status
&
0x01
)
...
...
@@ -289,7 +289,7 @@ void rt_hw_serial_init(void)
device
->
hw_base
=
UART0_BASE
;
device
->
baudrate
=
115200
;
device
->
irqno
=
VECNUM_U0
;
rt_hw_interrupt_install
(
device
->
irqno
,
rt_serial_isr
,
RT_NULL
);
/* install isr */
rt_hw_interrupt_install
(
device
->
irqno
,
rt_serial_isr
,
device
,
"serial"
);
/* install isr */
rt_memset
(
device
->
rx_buffer
,
0
,
sizeof
(
device
->
rx_buffer
));
device
->
read_index
=
device
->
save_index
=
0
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录