Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
混口饭吃,
rt-thread
提交
9193acaf
R
rt-thread
项目概览
混口饭吃,
/
rt-thread
与 Fork 源项目一致
Fork自
Mr_Pangza / 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,发现更多精彩内容 >>
提交
9193acaf
编写于
10月 11, 2013
作者:
B
Bernard Xiong
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #170 from grissiom/rtt-next
kernel: add RT_DEBUG_IN_THREAD_CONTEXT
上级
4eaadb7a
6f71308e
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
27 addition
and
6 deletion
+27
-6
include/rtdebug.h
include/rtdebug.h
+21
-0
src/ipc.c
src/ipc.c
+6
-6
未找到文件。
include/rtdebug.h
浏览文件 @
9193acaf
...
...
@@ -103,8 +103,29 @@ do \
rt_hw_interrupt_enable(level); \
} \
while (0)
/* "In thread context" means:
* 1) the scheduler has been started
* 2) not in interrupt context.
*/
#define RT_DEBUG_IN_THREAD_CONTEXT \
do \
{ \
rt_base_t level; \
level = rt_hw_interrupt_disable(); \
if (rt_thread_self() == RT_NULL) \
{ \
rt_kprintf("Function[%s] shall not be used before scheduler start\n", \
__FUNCTION__); \
RT_ASSERT(0) \
} \
RT_DEBUG_NOT_IN_INTERRUPT; \
rt_hw_interrupt_enable(level); \
} \
while (0)
#else
#define RT_DEBUG_NOT_IN_INTERRUPT
#define RT_DEBUG_IN_THREAD_CONTEXT
#endif
#else
/* RT_DEBUG */
...
...
src/ipc.c
浏览文件 @
9193acaf
...
...
@@ -362,7 +362,7 @@ rt_err_t rt_sem_take(rt_sem_t sem, rt_int32_t time)
else
{
/* current context checking */
RT_DEBUG_
NOT_IN_INTERRUP
T
;
RT_DEBUG_
IN_THREAD_CONTEX
T
;
/* semaphore is unavailable, push to suspend list */
/* get current thread */
...
...
@@ -645,7 +645,7 @@ rt_err_t rt_mutex_take(rt_mutex_t mutex, rt_int32_t time)
struct
rt_thread
*
thread
;
/* this function must not be used in interrupt even if time = 0 */
RT_DEBUG_
NOT_IN_INTERRUP
T
;
RT_DEBUG_
IN_THREAD_CONTEX
T
;
RT_ASSERT
(
mutex
!=
RT_NULL
);
...
...
@@ -1097,7 +1097,7 @@ rt_err_t rt_event_recv(rt_event_t event,
register
rt_ubase_t
level
;
register
rt_base_t
status
;
RT_DEBUG_
NOT_IN_INTERRUP
T
;
RT_DEBUG_
IN_THREAD_CONTEX
T
;
/* parameter check */
RT_ASSERT
(
event
!=
RT_NULL
);
...
...
@@ -1442,7 +1442,7 @@ rt_err_t rt_mb_send_wait(rt_mailbox_t mb,
return
-
RT_EFULL
;
}
RT_DEBUG_
NOT_IN_INTERRUP
T
;
RT_DEBUG_
IN_THREAD_CONTEX
T
;
/* suspend current thread */
rt_ipc_list_suspend
(
&
(
mb
->
suspend_sender_thread
),
thread
,
...
...
@@ -1589,7 +1589,7 @@ rt_err_t rt_mb_recv(rt_mailbox_t mb, rt_uint32_t *value, rt_int32_t timeout)
return
-
RT_ETIMEOUT
;
}
RT_DEBUG_
NOT_IN_INTERRUP
T
;
RT_DEBUG_
IN_THREAD_CONTEX
T
;
/* suspend current thread */
rt_ipc_list_suspend
(
&
(
mb
->
parent
.
suspend_thread
),
thread
,
...
...
@@ -2123,7 +2123,7 @@ rt_err_t rt_mq_recv(rt_mq_t mq,
/* message queue is empty */
while
(
mq
->
entry
==
0
)
{
RT_DEBUG_
NOT_IN_INTERRUP
T
;
RT_DEBUG_
IN_THREAD_CONTEX
T
;
/* reset error number in thread */
thread
->
error
=
RT_EOK
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录