Merge pull request #3294 from tonyzheng-rockchip/fix-dlmodule

Fix dlmodule must depends on file system issue
This commit is contained in:
Bernard Xiong authored and GitHub committed 2019-12-27 15:42:28 +08:00
commit c2322353aa
3 files changed
+211 -1

No files matched your search

+10
View File
@@ -34,9 +34,19 @@ if RT_USING_LIBC && RT_USING_DFS
default n
endif
endif
if RT_USING_LIBC
config RT_USING_MODULE
bool "Enable dynamic module with dlopen/dlsym/dlclose feature"
default n
if RT_USING_MODULE
config RT_USING_CUSTOM_DLMODULE
bool "Enable load dynamic module by custom"
default n
endif
endif
if RT_USING_LIBC != y
File diff suppressed because it is too large. Load diff
+12
View File
@@ -59,6 +59,12 @@ struct rt_dlmodule
struct rt_module_symtab *symtab; /* module symbol table */
};
struct rt_dlmodule_ops
{
rt_uint8_t *(*load)(const char* filename); /* load dlmodule file data */
rt_err_t (*unload)(rt_uint8_t *param); /* unload dlmodule file data */
};
struct rt_dlmodule *dlmodule_create(void);
rt_err_t dlmodule_destroy(struct rt_dlmodule* module);
@@ -66,6 +72,12 @@ struct rt_dlmodule *dlmodule_self(void);
struct rt_dlmodule *dlmodule_load(const char* pgname);
struct rt_dlmodule *dlmodule_exec(const char* pgname, const char* cmd, int cmd_size);
#if defined(RT_USING_CUSTOM_DLMODULE)
struct rt_dlmodule* dlmodule_load_custom(const char* filename, struct rt_dlmodule_ops* ops);
struct rt_dlmodule* dlmodule_exec_custom(const char* pgname, const char* cmd, int cmd_size, struct rt_dlmodule_ops* ops);
#endif
void dlmodule_exit(int ret_code);
struct rt_dlmodule *dlmodule_find(const char *name);