kernelnewbies.kernelnewbies.org archive mirror
 help / color / mirror / Atom feed
* order of call to built-in modules
@ 2011-04-11 20:04 David Shwatrz
  2011-04-11 20:16 ` Greg KH
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: David Shwatrz @ 2011-04-11 20:04 UTC (permalink / raw)
  To: kernelnewbies

HI,
The macros module_init() and module_exit() are used both in case
a source is built-in (the code is called from the init stage) or as a
kernel module (implementing a init_module symbol).

In case 2 of /built-in/ modules  I am wondering if it is
possible to know by advance the order used to call the various
module_init() entry points. Is it possible to fix this order?
rgs,
DS

^ permalink raw reply	[flat|nested] 4+ messages in thread

* order of call to built-in modules
  2011-04-11 20:04 order of call to built-in modules David Shwatrz
@ 2011-04-11 20:16 ` Greg KH
  2011-04-11 20:19 ` Gasparini Andrea
  2011-04-11 21:04 ` Manish Katiyar
  2 siblings, 0 replies; 4+ messages in thread
From: Greg KH @ 2011-04-11 20:16 UTC (permalink / raw)
  To: kernelnewbies

On Mon, Apr 11, 2011 at 11:04:55PM +0300, David Shwatrz wrote:
> HI,
> The macros module_init() and module_exit() are used both in case
> a source is built-in (the code is called from the init stage) or as a
> kernel module (implementing a init_module symbol).
> 
> In case 2 of /built-in/ modules  I am wondering if it is
> possible to know by advance the order used to call the various
> module_init() entry points. Is it possible to fix this order?

Yes, the ordering is done by link order.  See the kernel Makefiles which
determine this order.

Hope this helps,

greg k-h

^ permalink raw reply	[flat|nested] 4+ messages in thread

* order of call to built-in modules
  2011-04-11 20:04 order of call to built-in modules David Shwatrz
  2011-04-11 20:16 ` Greg KH
@ 2011-04-11 20:19 ` Gasparini Andrea
  2011-04-11 21:04 ` Manish Katiyar
  2 siblings, 0 replies; 4+ messages in thread
From: Gasparini Andrea @ 2011-04-11 20:19 UTC (permalink / raw)
  To: kernelnewbies

Hi David

On Mon, Apr 11, 2011 at 10:04 PM, David Shwatrz <dshwatrz@gmail.com> wrote:
> HI,
> The macros module_init() and module_exit() are used both in case
> a source is built-in (the code is called from the init stage) or as a
> kernel module (implementing a init_module symbol).
>
> In case 2 of /built-in/ modules ?I am wondering if it is
> possible to know by advance the order used to call the various
> module_init() entry points. Is it possible to fix this order?
> rgs,

If I recall correctly, the order is given by the Makefile, so to have
a driver being initialized before another one, you have to remangle
your Makefile tree to match the order you want.

Hope it helps.
bye
--
-gaspa-

^ permalink raw reply	[flat|nested] 4+ messages in thread

* order of call to built-in modules
  2011-04-11 20:04 order of call to built-in modules David Shwatrz
  2011-04-11 20:16 ` Greg KH
  2011-04-11 20:19 ` Gasparini Andrea
@ 2011-04-11 21:04 ` Manish Katiyar
  2 siblings, 0 replies; 4+ messages in thread
From: Manish Katiyar @ 2011-04-11 21:04 UTC (permalink / raw)
  To: kernelnewbies

On Mon, Apr 11, 2011 at 1:04 PM, David Shwatrz <dshwatrz@gmail.com> wrote:
> HI,
> The macros module_init() and module_exit() are used both in case
> a source is built-in (the code is called from the init stage) or as a
> kernel module (implementing a init_module symbol).

Yes its possible to change. Have a look at the function do_initcalls()
where it traverses the table.


>
> In case 2 of /built-in/ modules ?I am wondering if it is
> possible to know by advance the order used to call the various
> module_init() entry points. Is it possible to fix this order?
> rgs,
> DS
>
> _______________________________________________
> Kernelnewbies mailing list
> Kernelnewbies at kernelnewbies.org
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>



-- 
Thanks -
Manish

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-04-11 21:04 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-04-11 20:04 order of call to built-in modules David Shwatrz
2011-04-11 20:16 ` Greg KH
2011-04-11 20:19 ` Gasparini Andrea
2011-04-11 21:04 ` Manish Katiyar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).