This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
RE: RedBoot initializers
- To: Robin Farine <acnrf at dial dot eunet dot ch>
- Subject: RE: [ECOS] RedBoot initializers
- From: Gary Thomas <gthomas at cambridge dot redhat dot com>
- Date: Mon, 26 Feb 2001 06:37:13 -0700 (MST)
- Cc: ecos-discuss at sources dot redhat dot com
- Organization: Red Hat, Inc.
On 26-Feb-2001 Robin Farine wrote:
> 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?
Yes and no. The use of a qualified entry _is_ necessary in order to obtain
priorities. However, the priority needs to get in there somehow. I'm looking
at how to improve this - watch here for more details.