mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2025-02-22 20:29:00 +08:00
[dlmodule] Add cache ops in dlmodule.
This commit is contained in:
parent
f0ab00621a
commit
ba5c1bea44
@ -376,25 +376,27 @@ int msh_exec(char *cmd, rt_size_t length)
|
|||||||
{
|
{
|
||||||
return cmd_ret;
|
return cmd_ret;
|
||||||
}
|
}
|
||||||
#if defined(RT_USING_MODULE) && defined(RT_USING_DFS)
|
#ifdef RT_USING_DFS
|
||||||
if (msh_exec_module(cmd, length) == 0)
|
#ifdef DFS_USING_WORKDIR
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(RT_USING_DFS) && defined(DFS_USING_WORKDIR)
|
|
||||||
if (msh_exec_script(cmd, length) == 0)
|
if (msh_exec_script(cmd, length) == 0)
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(RT_USING_LWP) && defined(RT_USING_DFS)
|
#ifdef RT_USING_MODULE
|
||||||
|
if (msh_exec_module(cmd, length) == 0)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef RT_USING_LWP
|
||||||
if (_msh_exec_lwp(cmd, length) == 0)
|
if (_msh_exec_lwp(cmd, length) == 0)
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* truncate the cmd at the first space. */
|
/* truncate the cmd at the first space. */
|
||||||
|
@ -277,6 +277,7 @@ rt_err_t dlmodule_load_relocated_object(struct rt_dlmodule* module, void *module
|
|||||||
rt_kprintf("Module: allocate space failed.\n");
|
rt_kprintf("Module: allocate space failed.\n");
|
||||||
return -RT_ERROR;
|
return -RT_ERROR;
|
||||||
}
|
}
|
||||||
|
module->mem_size = module_size;
|
||||||
|
|
||||||
/* zero all space */
|
/* zero all space */
|
||||||
ptr = module->mem_space;
|
ptr = module->mem_space;
|
||||||
|
@ -491,6 +491,12 @@ struct rt_dlmodule* dlmodule_load(const char* filename)
|
|||||||
/* increase module reference count */
|
/* increase module reference count */
|
||||||
module->nref ++;
|
module->nref ++;
|
||||||
|
|
||||||
|
/* deal with cache */
|
||||||
|
#ifdef RT_USING_CACHE
|
||||||
|
rt_hw_cpu_dcache_ops(RT_HW_CACHE_FLUSH, module->mem_space, module->mem_size);
|
||||||
|
rt_hw_cpu_icache_ops(RT_HW_CACHE_INVALIDATE, module->mem_space, module->mem_size);
|
||||||
|
#endif
|
||||||
|
|
||||||
/* set module initialization and cleanup function */
|
/* set module initialization and cleanup function */
|
||||||
module->init_func = dlsym(module, "module_init");
|
module->init_func = dlsym(module, "module_init");
|
||||||
module->cleanup_func = dlsym(module, "module_cleanup");
|
module->cleanup_func = dlsym(module, "module_cleanup");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user