summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorbernard.xiong <[email protected]>2010-05-04 02:03:11 +0000
committerbernard.xiong <[email protected]>2010-05-04 02:03:11 +0000
commit157bc5f26325603008c30f8d37c29558cb9389b7 (patch)
tree45e3f19c44657d5cdd6a762b276e0a38bf8b6b3c /src
parent1cbde10e57ca856407bc93fb67e61c55885d407c (diff)
remove rt_object_find function.
git-svn-id: https://rt-thread.googlecode.com/svn/trunk@693 bbd45198-f89e-11dd-88c7-29a3b14d5316
Diffstat (limited to 'src')
-rw-r--r--src/module.c30
1 files changed, 27 insertions, 3 deletions
diff --git a/src/module.c b/src/module.c
index 6427122a4b..19fbd04fb2 100644
--- a/src/module.c
+++ b/src/module.c
@@ -390,10 +390,34 @@ void rt_module_unload(struct rt_module* module)
rt_module_t rt_module_find(char* name)
{
- struct rt_module* module;
- module = (struct rt_module*)rt_object_find(RT_Object_Class_Module, name);
+ struct rt_object_information *information;
+ struct rt_object* object;
+ struct rt_list_node* node;
- return module;
+ extern struct rt_object_information rt_object_container[];
+
+ /* enter critical */
+ rt_enter_critical();
+
+ /* try to find device object */
+ information = &rt_object_container[RT_Object_Class_Thread];
+ for (node = information->object_list.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)
+ {
+ /* leave critical */
+ rt_exit_critical();
+
+ return (rt_module_t)object;
+ }
+ }
+
+ /* leave critical */
+ rt_exit_critical();
+
+ /* not found */
+ return RT_NULL;
}
#endif