This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

RedBoot initializers


Hi,

I have added some custom functionalities to RedBoot that make use of the
'RedBoot_init()' macro. However, I've got the following problem: if, for
instance, a module declares a RedBoot initialization routine 'read_config()'
with 'RedBoot_init(read_config, RedBoot_INIT_FIRST)', it will run *after*
'net_init()' (declared with 'RedBoot_init(net_init, RedBoot_INIT_LAST)')
because the 'RedBoot_init()' macro uses qualified entries. To solve this
problem, I have changed the 'RedBoot_init()' definition

from:

  #define _RedBoot_init(_f_,_p_)               \
  struct init_tab_entry _init_tab_##_p_##_f_   \
  CYG_HAL_TABLE_QUALIFIED_ENTRY(RedBoot_inits,_f_) = { _f_ }; 

to:

  #define _RedBoot_init(_f_,_p_)               \
  struct init_tab_entry _init_tab_##_p_##_f_   \
  CYG_HAL_TABLE_ENTRY(RedBoot_inits) = { _f_ }; 

The original version of the macro uses the function name as qualifier for the
generated section's name; but the qualifier precedes '_init_tab_##_p_##_f_' in
the section's name and thus the priority does not have any effect in name
ordering. It seems to me that either the '_RedBoot_init()' macro should take the
qualifier as a third argument or it should use the non-qualifying
'CYG_HAL_TABLE_ENTRY()' macro.

Did I miss something?

Robin


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]