Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
BaiXuePrincess
rt-thread
提交
e2d88e43
R
rt-thread
项目概览
BaiXuePrincess
/
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看板
提交
e2d88e43
编写于
12月 25, 2017
作者:
B
Bernard Xiong
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[Kernel] fix the object container initialization issue
上级
c9a505be
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
18 addition
and
18 deletion
+18
-18
src/object.c
src/object.c
+18
-18
未找到文件。
src/object.c
浏览文件 @
e2d88e43
...
...
@@ -73,44 +73,44 @@ enum rt_object_info_type
static
struct
rt_object_information
rt_object_container
[
RT_Object_Info_Unknown
]
=
{
/* initialize object container - thread */
{
RT_Object_Class_Thread
,
_OBJ_CONTAINER_LIST_INIT
(
RT_Object_
Class
_Thread
),
sizeof
(
struct
rt_thread
)},
{
RT_Object_Class_Thread
,
_OBJ_CONTAINER_LIST_INIT
(
RT_Object_
Info
_Thread
),
sizeof
(
struct
rt_thread
)},
#ifdef RT_USING_SEMAPHORE
/* initialize object container - semaphore */
{
RT_Object_Class_Semaphore
,
_OBJ_CONTAINER_LIST_INIT
(
RT_Object_
Class
_Semaphore
),
sizeof
(
struct
rt_semaphore
)},
{
RT_Object_Class_Semaphore
,
_OBJ_CONTAINER_LIST_INIT
(
RT_Object_
Info
_Semaphore
),
sizeof
(
struct
rt_semaphore
)},
#endif
#ifdef RT_USING_MUTEX
/* initialize object container - mutex */
{
RT_Object_Class_Mutex
,
_OBJ_CONTAINER_LIST_INIT
(
RT_Object_
Class
_Mutex
),
sizeof
(
struct
rt_mutex
)},
{
RT_Object_Class_Mutex
,
_OBJ_CONTAINER_LIST_INIT
(
RT_Object_
Info
_Mutex
),
sizeof
(
struct
rt_mutex
)},
#endif
#ifdef RT_USING_EVENT
/* initialize object container - event */
{
RT_Object_Class_Event
,
_OBJ_CONTAINER_LIST_INIT
(
RT_Object_
Class
_Event
),
sizeof
(
struct
rt_event
)},
{
RT_Object_Class_Event
,
_OBJ_CONTAINER_LIST_INIT
(
RT_Object_
Info
_Event
),
sizeof
(
struct
rt_event
)},
#endif
#ifdef RT_USING_MAILBOX
/* initialize object container - mailbox */
{
RT_Object_Class_MailBox
,
_OBJ_CONTAINER_LIST_INIT
(
RT_Object_
Class
_MailBox
),
sizeof
(
struct
rt_mailbox
)},
{
RT_Object_Class_MailBox
,
_OBJ_CONTAINER_LIST_INIT
(
RT_Object_
Info
_MailBox
),
sizeof
(
struct
rt_mailbox
)},
#endif
#ifdef RT_USING_MESSAGEQUEUE
/* initialize object container - message queue */
{
RT_Object_Class_MessageQueue
,
_OBJ_CONTAINER_LIST_INIT
(
RT_Object_
Class
_MessageQueue
),
sizeof
(
struct
rt_messagequeue
)},
{
RT_Object_Class_MessageQueue
,
_OBJ_CONTAINER_LIST_INIT
(
RT_Object_
Info
_MessageQueue
),
sizeof
(
struct
rt_messagequeue
)},
#endif
#ifdef RT_USING_MEMHEAP
/* initialize object container - memory heap */
{
RT_Object_Class_MemHeap
,
_OBJ_CONTAINER_LIST_INIT
(
RT_Object_
Class
_MemHeap
),
sizeof
(
struct
rt_memheap
)},
{
RT_Object_Class_MemHeap
,
_OBJ_CONTAINER_LIST_INIT
(
RT_Object_
Info
_MemHeap
),
sizeof
(
struct
rt_memheap
)},
#endif
#ifdef RT_USING_MEMPOOL
/* initialize object container - memory pool */
{
RT_Object_Class_MemPool
,
_OBJ_CONTAINER_LIST_INIT
(
RT_Object_
Class
_MemPool
),
sizeof
(
struct
rt_mempool
)},
{
RT_Object_Class_MemPool
,
_OBJ_CONTAINER_LIST_INIT
(
RT_Object_
Info
_MemPool
),
sizeof
(
struct
rt_mempool
)},
#endif
#ifdef RT_USING_DEVICE
/* initialize object container - device */
{
RT_Object_Class_Device
,
_OBJ_CONTAINER_LIST_INIT
(
RT_Object_
Class
_Device
),
sizeof
(
struct
rt_device
)},
{
RT_Object_Class_Device
,
_OBJ_CONTAINER_LIST_INIT
(
RT_Object_
Info
_Device
),
sizeof
(
struct
rt_device
)},
#endif
/* initialize object container - timer */
{
RT_Object_Class_Timer
,
_OBJ_CONTAINER_LIST_INIT
(
RT_Object_
Class
_Timer
),
sizeof
(
struct
rt_timer
)},
{
RT_Object_Class_Timer
,
_OBJ_CONTAINER_LIST_INIT
(
RT_Object_
Info
_Timer
),
sizeof
(
struct
rt_timer
)},
#ifdef RT_USING_MODULE
/* initialize object container - module */
{
RT_Object_Class_Module
,
_OBJ_CONTAINER_LIST_INIT
(
RT_Object_
Class
_Module
),
sizeof
(
struct
rt_module
)},
{
RT_Object_Class_Module
,
_OBJ_CONTAINER_LIST_INIT
(
RT_Object_
Info
_Module
),
sizeof
(
struct
rt_module
)},
#endif
};
...
...
@@ -228,10 +228,10 @@ struct rt_object_information *
rt_object_get_information
(
enum
rt_object_class_type
type
)
{
int
index
;
for
(
index
=
0
;
index
<
RT_Object_Info_Unknown
;
index
++
)
if
(
rt_object_container
[
index
].
type
==
type
)
return
&
rt_object_container
[
index
];
return
RT_NULL
;
}
RTM_EXPORT
(
rt_object_get_information
);
...
...
@@ -482,12 +482,12 @@ rt_object_t rt_object_find(const char *name, rt_uint8_t type)
RT_ASSERT
(
information
!=
RT_NULL
);
for
(
node
=
information
->
object_list
.
next
;
node
!=
&
(
information
->
object_list
);
node
=
node
->
next
)
node
!=
&
(
information
->
object_list
);
node
=
node
->
next
)
{
object
=
rt_list_entry
(
node
,
struct
rt_object
,
list
);
if
((
rt_strncmp
(
object
->
name
,
name
,
module_name_length
)
==
0
)
&&
(
module_name_length
==
RT_NAME_MAX
||
object
->
name
[
module_name_length
]
==
'\0'
))
(
module_name_length
==
RT_NAME_MAX
||
object
->
name
[
module_name_length
]
==
'\0'
))
{
/* get module */
module
=
(
struct
rt_module
*
)
object
;
...
...
@@ -526,8 +526,8 @@ rt_object_t rt_object_find(const char *name, rt_uint8_t type)
RT_ASSERT
(
information
!=
RT_NULL
);
}
for
(
node
=
information
->
object_list
.
next
;
node
!=
&
(
information
->
object_list
);
node
=
node
->
next
)
node
!=
&
(
information
->
object_list
);
node
=
node
->
next
)
{
object
=
rt_list_entry
(
node
,
struct
rt_object
,
list
);
if
(
rt_strncmp
(
object
->
name
,
name
,
RT_NAME_MAX
)
==
0
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录