File tree Expand file tree Collapse file tree 1 file changed +34
-0
lines changed Expand file tree Collapse file tree 1 file changed +34
-0
lines changed Original file line number Diff line number Diff line change @@ -226,6 +226,40 @@ rt_err_t dlmodule_load_shared_object(struct rt_dlmodule* module, void *module_pt
226226 length );
227227 count ++ ;
228228 }
229+
230+ /* get priority & stack size params*/
231+ rt_uint32_t flag = 0 ;
232+ rt_uint16_t priority ;
233+ rt_uint32_t stacksize ;
234+ for (i = 0 ; i < shdr [index ].sh_size / sizeof (Elf32_Sym ); i ++ )
235+ {
236+ if (((flag & 0x01 ) == 0 ) &&
237+ (rt_strcmp ((const char * )(strtab + symtab [i ].st_name ), "dlmodule_thread_priority" ) == 0 ))
238+ {
239+ flag |= 0x01 ;
240+ priority = * (rt_uint16_t * )(module -> mem_space + symtab [i ].st_value - module -> vstart_addr );
241+ if (priority < RT_THREAD_PRIORITY_MAX )
242+ {
243+ module -> priority = priority ;
244+ }
245+ }
246+
247+ if (((flag & 0x02 ) == 0 ) &&
248+ (rt_strcmp ((const char * )(strtab + symtab [i ].st_name ), "dlmodule_thread_stacksize" ) == 0 ))
249+ {
250+ flag |= 0x02 ;
251+ stacksize = * (rt_uint32_t * )(module -> mem_space + symtab [i ].st_value - module -> vstart_addr );
252+ if ((stacksize < 2048 ) || (stacksize > 1024 * 32 ))
253+ {
254+ module -> stack_size = stacksize ;
255+ }
256+ }
257+
258+ if ((flag & 0x03 ) == 0x03 )
259+ {
260+ break ;
261+ }
262+ }
229263 }
230264
231265 return RT_EOK ;
You can’t perform that action at this time.
0 commit comments