kernelnewbies.kernelnewbies.org archive mirror
 help / color / mirror / Atom feed
From: tobias@gambas-buch.de (Tobias Boege)
To: kernelnewbies@lists.kernelnewbies.org
Subject: Regarding module init function
Date: Thu, 10 Jan 2013 09:47:47 +0100	[thread overview]
Message-ID: <20130110084404.GB777@aurora> (raw)
In-Reply-To: <1357663456.1670.5.camel@anish-Inspiron-N5050>

On Tue, 08 Jan 2013, anish kumar wrote:
> On Tue, 2013-01-08 at 14:51 +0100, Tobias Boege wrote:
> > On Tue, 08 Jan 2013, Rahul Bedarkar wrote:
> > > Ok. in init/main.c we call do_basic_setup(). Where do_initcalls call each
> > > of init functions from __early_initcall_end to __initcall_end. But I don't
> > > know from where these values gets initialized.
> > > 
> > 
> > Take a look at include/linux/init.h. There you can find the macros for
> > declaring various init functions. They all go into special sections. The
> > rest is linker magic (e.g. arch/x86/kernel/vmlinux.lds{,.S}).
> > 
> > > I want to know when one of auxdriver (selected in from menuconfig) is built
> > > as built-in module. When and Who calls it's init function ?
> > 
> > It's, too, in the init.h. There are two definitions of module_init()
> > depending on whether MODULE is declared or not. The first definition is
> How does the individual driver define this MODULE?I think some macro
> magic works here.

I suppose that this is done through the invocation of the preprocessor,
using -DMODULE depending on whether the target is built-in or a module.

Regards,
Tobi

  reply	other threads:[~2013-01-10  8:47 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-04 11:18 Regarding module init function Rahul Bedarkar
2013-01-04 13:22 ` Tobias Boege
2013-01-08  8:40   ` Rahul Bedarkar
2013-01-08 10:08     ` Rahul Bedarkar
2013-01-08 13:31       ` Dave Hylands
2013-01-08 13:50         ` Rahul Bedarkar
2013-01-08 14:33           ` Dave Hylands
2013-01-08 13:51       ` Tobias Boege
2013-01-08 16:44         ` anish kumar
2013-01-10  8:47           ` Tobias Boege [this message]
2013-01-12  5:49             ` Dave Hylands

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=20130110084404.GB777@aurora \
    --to=tobias@gambas-buch.de \
    --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 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).