Linux PARISC architecture development
 help / color / mirror / Atom feed
From: Matthew Wilcox <willy@thepuffingroup.com>
To: parisc-linux@thepuffingroup.com
Subject: [parisc-linux] initcall and setup
Date: Fri, 14 Jan 2000 17:48:31 -0500	[thread overview]
Message-ID: <20000114174831.W11300@thepuffingroup.com> (raw)


One of the things which has changed during 2.3 development is
initialisation.  We used to have files full of:

#ifdef CONFIG_FOO
	init_foo();
#endif

#ifdef CONFIG_BAR
	init_bar();
#endif

#ifdef CONFIG_QUUX
	init_quux();
#endif

which was pretty ugly stuff.

Instead, we have declarations like:

__setup("video=", video_setup);
__setup("wd33c93", wd33c93_setup);
__setup("es1370=", es1370_setup);

in each driver and then a loop in init/main.c which goes through and
calls all the __setup functions.  Much prettier, more modular, less
dependent on CONFIG_, etc.

Unfortunately, we can't take advantage of this, because we don't yet have
ELF tools.  This is implemented through an ELF section called __initcall
which contains the address of the function to call.  We could try to hack
something together with SOM, but I'd really rather not put the work in
that will just be dumped later.


This explains why we get some of the warnings on compilation;' eg:

init/main.c:170: warning: `__setup_profile_setup' defined but not used

and why if you diff our kernel against Linus', you will find that we have
reinserted some of the explicit calls to the setup routines that have
been eliminated from the mainline tree.  It also explains why sometimes
a driver may not be called even though you compiled it in.

             reply	other threads:[~2000-01-14 23:47 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-01-14 22:48 Matthew Wilcox [this message]
2000-01-15  1:13 ` [parisc-linux] initcall and setup Grant Grundler
2000-01-15  2:41   ` Alex deVries

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=20000114174831.W11300@thepuffingroup.com \
    --to=willy@thepuffingroup.com \
    --cc=parisc-linux@thepuffingroup.com \
    /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