linux-embedded.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Geert Uytterhoeven <Geert.Uytterhoeven@sonycom.com>
To: Fundu <fundu_1999@yahoo.com>
Cc: linux embedded <linux-embedded@vger.kernel.org>,
	Amol Lad <amol.lad@gmail.com>
Subject: Re: Module init for compiled in vs loaded modules
Date: Wed, 20 Aug 2008 11:06:32 +0200 (CEST)	[thread overview]
Message-ID: <Pine.LNX.4.64.0808201104131.4596@vixen.sonytel.be> (raw)
In-Reply-To: <487558.67644.qm@web63404.mail.re1.yahoo.com>

[-- Attachment #1: Type: TEXT/PLAIN, Size: 1547 bytes --]

On Tue, 19 Aug 2008, Fundu wrote:
> > linux/init.h:
> > 
> > #ifndef MODULE
> > ...
> > #define module_init(x)  __initcall(x);
> > #define __initcall(fn) device_initcall(fn)
> > #define device_initcall(fn)    
> > __define_initcall("6",fn)
> > #define __define_initcall(level,fn) \
> >     static initcall_t __initcall_##fn __attribute_used__
> > \
> >     __attribute__((__section__(".initcall" level
> > ".init"))) = fn
> > ...
> > #endif
> > 
> > initcalls are processed in do_initcalls function in
> > init/main.c
> > 
> > static void __init do_basic_setup(void)
> > {
> >     ....
> >     do_initcalls();
> > }
> > 
> > >
> > > thanks !
> > 
> > Amol
> thanks Rajat and Amol. 
> 
> One other question,
> 1) how does the kernel know which module to load first in order to satisfy dependencies issues ?

By looking at the needed symbols (cfr. depmod).

> 2) is there a way i could print the module init fn name from do_initcalls. to see in what order compiled in modules are called.

Add `initcall_debug' to the kernel command line (if you would have looked at
do_initcalls() and do_one_initcall(), you would have known).

With kind regards,

Geert Uytterhoeven
Software Architect

Sony Techsoft Centre Europe
The Corporate Village · Da Vincilaan 7-D1 · B-1935 Zaventem · Belgium

Phone:    +32 (0)2 700 8453
Fax:      +32 (0)2 700 8622
E-mail:   Geert.Uytterhoeven@sonycom.com
Internet: http://www.sony-europe.com/

A division of Sony Europe (Belgium) N.V.
VAT BE 0413.825.160 · RPR Brussels
Fortis · BIC GEBABEBB · IBAN BE41293037680010

  reply	other threads:[~2008-08-20  9:06 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-19 17:26 Module init for compiled in vs loaded modules Fundu
2008-08-20  9:06 ` Geert Uytterhoeven [this message]
  -- strict thread matches above, loose matches on Subject: below --
2008-08-18 16:00 embedded rootfs utility Grant Likely
2008-08-19  1:44 ` Module init for compiled in vs loaded modules Fundu
2008-08-19  4:29   ` Amol Lad
2008-08-19 16:11   ` T Ziomek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Pine.LNX.4.64.0808201104131.4596@vixen.sonytel.be \
    --to=geert.uytterhoeven@sonycom.com \
    --cc=amol.lad@gmail.com \
    --cc=fundu_1999@yahoo.com \
    --cc=linux-embedded@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).