mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2025-11-16 12:34:33 +00:00
module developing
git-svn-id: https://rt-thread.googlecode.com/svn/trunk@742 bbd45198-f89e-11dd-88c7-29a3b14d5316
This commit is contained in:
@@ -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];
|
||||
};
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user