This commit is contained in:
刘可亮
2024-01-27 08:47:24 +08:00
parent d3bd993b5f
commit 9f7ba67007
2345 changed files with 74421 additions and 76616 deletions

View File

@@ -69,7 +69,7 @@ rt_err_t dlmodule_load_shared_object(struct rt_dlmodule* module, void *module_pt
if (phdr[index].p_vaddr > vend_addr + 16)
{
/* There should not be too much padding in the object files. */
LOG_W("warning: too much padding before segment %d", index);
LOG_D("warning: too much padding before segment %d", index);
}
vend_addr = phdr[index].p_vaddr + phdr[index].p_memsz;
@@ -94,6 +94,7 @@ rt_err_t dlmodule_load_shared_object(struct rt_dlmodule* module, void *module_pt
module->nref = 0;
/* allocate module space */
module_size = ALIGN_UP(module_size, CACHE_LINE_SIZE);
module->mem_space = rt_malloc_align(module_size, CACHE_LINE_SIZE);
if (module->mem_space == RT_NULL)
{
@@ -311,6 +312,7 @@ rt_err_t dlmodule_load_relocated_object(struct rt_dlmodule* module, void *module
module->vstart_addr = 0;
/* allocate module space */
module_size = ALIGN_UP(module_size, CACHE_LINE_SIZE);
module->mem_space = rt_malloc_align(module_size, CACHE_LINE_SIZE);
if (module->mem_space == RT_NULL)
{

View File

@@ -146,6 +146,7 @@ static void _dlmodule_thread_entry(void* parameter)
{
int argc = 0;
char *argv[RT_MODULE_ARG_MAX];
int ret = 0;
struct rt_dlmodule *module = (struct rt_dlmodule*)parameter;
@@ -168,10 +169,11 @@ static void _dlmodule_thread_entry(void* parameter)
module->cmd_line);
if (module->entry_addr)
module->entry_addr(argc, argv);
ret = module->entry_addr(argc, argv);
__exit:
_dlmodule_exit();
if (ret != RT_DLMODULE_DEAMON)
_dlmodule_exit();
return;
}
@@ -505,6 +507,8 @@ struct rt_dlmodule* dlmodule_load(const char* filename)
/* increase module reference count */
module->nref ++;
LOG_I("Module: load %s to 0x%lx succeed.", filename, module->mem_space);
/* deal with cache */
#ifdef RT_USING_CACHE
rt_hw_cpu_dcache_ops(RT_HW_CACHE_FLUSH, module->mem_space, module->mem_size);

View File

@@ -18,6 +18,8 @@
#define RT_DLMODULE_STAT_CLOSING 0x02
#define RT_DLMODULE_STAT_CLOSED 0x03
#define RT_DLMODULE_DEAMON 0xDEA305
struct rt_dlmodule;
typedef void* rt_addr_t;