All of lore.kernel.org
 help / color / mirror / Atom feed
From: nilesh.tayade@netscout.com (nilesh)
To: kernelnewbies@lists.kernelnewbies.org
Subject: xx_initcall ( ) in kernel
Date: Wed, 13 Jul 2011 16:39:11 +0530	[thread overview]
Message-ID: <4E1D7CD7.8000605@netscout.com> (raw)
In-Reply-To: <CAJ9orWQYoBonCUKhaK6b92XHikhWOswCfnW8e_g7JC6smYSPYg@mail.gmail.com>

Hi Sumeet,

On Wednesday 13 July 2011 04:12 PM, sumeet linux wrote:
> Dear friends,
>
> I want to know the basics xx_initcall ( ) in linux kernel. How this function
> works ?
> Observed in kernel code, many places late_initcall ( ), early_initcall ( ),
> arch_initcall ( ), core_initcall ( ) gets called.
> When did all these functions gets call during kernel initialization ?
> I am more interested in what is the sequence of these functions gets called
> one after another.
I could get a nice link explaining about *_initcall(). Refer:
http://book.opensourceproject.org.cn/embedded/embeddedprime/opensource/0136130550/ch05lev1sec4.html

*_initcall() are macros which set the function pointers for subsystem 
initialization (typedef int (*initcall_t)(void) : typedef of all such 
function pointers).
Also if we look at the source code, the functions are called in below 
sequence:
http://lxr.linux.no/#linux+v2.6.39/init/main.c#L695

do_basic_setup(void) -> do_initcalls(void) -> do_one_initcall(*fn);
do_one_initcall(*fn) - calls each function. And do_basic_setup() is 
called inside the initialization sequence (kernel_init()).

>
> Thank you.
>
> Regards,
> Sumeet
>

-- 
Thanks,
Nilesh

  reply	other threads:[~2011-07-13 11:09 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-13 10:42 xx_initcall ( ) in kernel sumeet linux
2011-07-13 11:09 ` nilesh [this message]
2011-08-08 16:09   ` subin gangadharan

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=4E1D7CD7.8000605@netscout.com \
    --to=nilesh.tayade@netscout.com \
    --cc=kernelnewbies@lists.kernelnewbies.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.