[Xenomai] [PATCH] boilerplate: do not call xenomai_init 2 times
rpm at xenomai.org
Thu Dec 15 18:25:23 CET 2016
On 12/15/2016 05:16 PM, Ronny Meeus wrote:
> On Thu, Dec 15, 2016 at 3:47 PM, Philippe Gerum <rpm at xenomai.org> wrote:
>> On 12/15/2016 12:47 PM, Ronny Meeus wrote:
>>> bootstrap.o is linked to the application code.
>>> In case the execution of the static constructors is postponed
>>> in the applicaion and the auto-init feature is used, the
>>> xenomai_init is called 2 times:
>>> - once in the path of the wrap_main
>>> - later in the context of the static constructor
>> Why do you keep the auto-init feature on, given that you already control
>> the early init code by postponing the execution of the C++ ctors? I
>> would rather expect something like:
>> - build with no-auto-init
>> - call xenomai_init() manually from your entry point to activate the
>> Xenomai services when you see fit.
>> - call the ctor init chain.
> We have a lot of applications, some of them postpone the execution of
> the constructors while others dont.
> We were calling the init function ourselves before, but we would like to
> remove this code to keep the application code cleaner and to have less
> explicit dependencies.
It may be cleaner for your app, but this is pushing the specifics of
your application to the Xenomai core, making it clumsier. I mean that
the intent, purpose and function of the bootstrap code is to init the
system when present. Adding a hack to nullify it instead of not adding
it to the app basically turns the logic upside down, for no obvious gain.
> Using the auto-init has advantages as well, one of them being that the
> init code of xenomai can change completely transparant for the
> application code.
I genuinely don't get your point. xenomai_init() does all the inits for
Xenomai, there is nothing in the bootstrap module beyond calling this
routine. I still don't understand what could be the additional advantage
of having the bootstrap module in, which calling xenomai_init() would
More information about the Xenomai