Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » DSDP - Real-Time Software Components (RTSC) » Using sibling modules
Using sibling modules [message #1521] Tue, 24 February 2009 13:32 Go to next message
Ramsey Harris is currently offline Ramsey Harris
Messages: 22
Registered: July 2009
Junior Member
Champs,

I have a package with two modules, ModA and ModB. In ModB.c I include ModA.h. In the application config script, only ModB is included with xdc.useModule(). Should ModB.xs:module$use() include ModA with xdc.useModule() to ensure that ModA's module$meta$init() and module$use() functions are called? Or does this happen automatically?

Thank you
~ Ramsey
Re: Using sibling modules [message #1535 is a reply to message #1521] Wed, 25 February 2009 12:26 Go to previous message
Bob Frankel is currently offline Bob Frankel
Messages: 10
Registered: July 2009
Junior Member
Ramsey Harris wrote:
> Champs,
>
> I have a package with two modules, ModA and ModB. In ModB.c I include
> ModA.h. In the application config script, only ModB is included with
> xdc.useModule(). Should ModB.xs:module$use() include ModA with
> xdc.useModule() to ensure that ModA's module$meta$init() and
> module$use() functions are called? Or does this happen automatically?
>
> Thank you
> ~ Ramsey

as a rule, whenever ModB #include's ModA.h, there should be a
corresponding xdc.useModule for ModA in ModB.xs. without "using" ModB
in this manner, the module$use() function of ModB will *not* be called.
failure to "use" modules at config time that are "used" in your target
code can often result in linker errors.

as for module$meta$init(), this function is called when the package
containing the corresponding module is loaded -- independent of whether
the module is "used" or not.... the purpose of module$meta$init is to
essentially "finish" some initialization of config params that could not
be handled statically in the .xdc file. for example, the default value
of Task.stackSize might be a function of the current target/platform --
known only at config time.
Previous Topic:How to use @opts-file with xs command
Next Topic:serializing Log_write()/System_printf() calls across threads
Goto Forum:
  


Current Time: Fri Aug 01 22:34:37 EDT 2014

Powered by FUDForum. Page generated in 0.07328 seconds