diff options
| author | qiuyiuestc <[email protected]> | 2010-05-29 14:19:56 +0000 |
|---|---|---|
| committer | qiuyiuestc <[email protected]> | 2010-05-29 14:19:56 +0000 |
| commit | 8b8dba661f5e29e1592cc9df92ef219099809330 (patch) | |
| tree | 31451ddff2d979d338cc0e9fc25b74bda5117632 /include | |
| parent | 1fb4d848370a33e176b2a3bf7fb532e7ed8e7823 (diff) | |
module developing
git-svn-id: https://rt-thread.googlecode.com/svn/trunk@742 bbd45198-f89e-11dd-88c7-29a3b14d5316
Diffstat (limited to 'include')
| -rw-r--r-- | include/rtdef.h | 32 | ||||
| -rw-r--r-- | include/rtm.h | 2 |
2 files changed, 29 insertions, 5 deletions
diff --git a/include/rtdef.h b/include/rtdef.h index 4e414d3041..b85f0b8b84 100644 --- a/include/rtdef.h +++ b/include/rtdef.h @@ -360,17 +360,37 @@ struct rt_thread }; /*@}*/ -/* module clean types */ -#define RT_MODULE_FLAG_AUTO_CLEAN 0x01 /* auto clean */ -#define RT_MODULE_FLAG_MANUAL_CLEAN 0x02 /* manual clean */ - #ifdef RT_USING_MODULE +/* + * module system + */ +enum rt_module_class_type +{ + RT_Module_Class_APP = 0, /* application module */ + RT_Module_Class_EXTENSION, + RT_Module_Class_SERVICE, /* service module */ + RT_Module_Class_Unknown /* unknown module */ +}; + +struct rt_module_info +{ + /* export interface */ + void *module_interface; + /* refence count */ + rt_uint32_t module_refs; + /* module type */ + enum rt_module_class_type module_type; + /* module guid */ + rt_uint32_t module_guid; + /* application entry */ + void* exec_entry; +}; + struct rt_module { /* inherit from object */ struct rt_object parent; - rt_uint32_t module_data; void* module_space; void* module_entry; @@ -382,6 +402,8 @@ struct rt_module rt_uint32_t mempool_size; void* module_mempool; + struct rt_module_info *module_info; + /* object in this module, module object is the last basic object type */ struct rt_object_information module_object[RT_Object_Class_Module]; }; diff --git a/include/rtm.h b/include/rtm.h index 596d5f7f07..653d94327f 100644 --- a/include/rtm.h +++ b/include/rtm.h @@ -2,6 +2,7 @@ #define __RTM_H__
#include <rtdef.h>
+#include <rtthread.h>
#ifdef RT_USING_MODULE
#define RTM_EXPORT(symbol) \
@@ -11,6 +12,7 @@ const struct rt_module_symtab __rtmsym_##symbol SECTION("RTMSymTab")= \ (rt_uint32_t)&symbol, \
__rtmsym_##symbol##_name, \
};
+
#else
#define RTM_EXPORT(symbol)
#endif
|
