summaryrefslogtreecommitdiff
path: root/src/object.c
diff options
context:
space:
mode:
authorqiuyiuestc <[email protected]>2010-09-19 23:43:48 +0000
committerqiuyiuestc <[email protected]>2010-09-19 23:43:48 +0000
commit446799244a2b796dbcd83bf8e557aff4ebaadc7d (patch)
treebfff7779005797756a8815a38dcb6db15b043d65 /src/object.c
parent3c2c5df6e898ca10107a0c359d8d73e55222449a (diff)
module clean up
git-svn-id: https://rt-thread.googlecode.com/svn/trunk@915 bbd45198-f89e-11dd-88c7-29a3b14d5316
Diffstat (limited to 'src/object.c')
-rw-r--r--src/object.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/src/object.c b/src/object.c
index 559abf72e4..e8adc60cc2 100644
--- a/src/object.c
+++ b/src/object.c
@@ -21,10 +21,6 @@
#include "kservice.h"
-#ifdef RT_USING_MODULE
-extern struct rt_module* rt_current_module;
-#endif
-
#define _OBJ_CONTAINER_LIST_INIT(c) \
{&(rt_object_container[c].object_list), &(rt_object_container[c].object_list)}
struct rt_object_information rt_object_container[RT_Object_Class_Unknown] =
@@ -182,8 +178,8 @@ void rt_object_init(struct rt_object* object, enum rt_object_class_type type, co
#ifdef RT_USING_MODULE
/* get module object information */
- information = (rt_current_module != RT_NULL) ?
- &rt_current_module->module_object[type] : &rt_object_container[type];
+ information = (rt_module_self() != RT_NULL) ?
+ &rt_module_self()->module_object[type] : &rt_object_container[type];
#else
/* get object information */
information = &rt_object_container[type];
@@ -261,11 +257,11 @@ rt_object_t rt_object_allocate(enum rt_object_class_type type, const char* name)
#ifdef RT_USING_MODULE
/* get module object information */
- information = (rt_current_module != RT_NULL) ?
- &rt_current_module->module_object[type] : &rt_object_container[type];
+ information = (rt_module_self() != RT_NULL) ?
+ &rt_module_self()->module_object[type] : &rt_module_self()[type];
#else
/* get object information */
- information = &rt_object_container[type];
+ information = &rt_module_self()[type];
#endif
object = (struct rt_object*)rt_malloc(information->object_size);