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 18:32 Go to next message
Ramsey Harris is currently offline Ramsey HarrisFriend
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 17:26 Go to previous message
Bob Frankel is currently offline Bob FrankelFriend
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: Thu Nov 27 05:48:33 GMT 2014

Powered by FUDForum. Page generated in 0.01779 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software