From: Blaisorblade <blaisorblade@yahoo.it>
To: user-mode-linux-devel@lists.sourceforge.net
Cc: tyler@agat.net
Subject: Re: [uml-devel] do_uml_initcalls
Date: Sun, 7 May 2006 21:50:18 +0200 [thread overview]
Message-ID: <200605072150.18891.blaisorblade@yahoo.it> (raw)
In-Reply-To: <20060507125412.GA16519@Starbuck>
On Sunday 07 May 2006 14:54, user-mode-linux-devel-admin@lists.sourceforge.net
wrote:
> Hi all,
>
> I was looking at the initialization code of UML and I found the function
> do_uml_initcalls :
>
> 1: static __init void do_uml_initcalls(void)
> 2: {
> 3: initcall_t *call;
> 4:
> 5: call = &__uml_initcall_start;
> 6: while (call < &__uml_initcall_end){;
> 7: (*call)();
> 8: call++;
> 9: }
>
> First, there's a ';' at the end of line 6 : typo error I guess.
Apart from this one, everything is like the general Linux kernel. See below.
> But my point is : this function is unreadable !
> It does simply call all the functions in the ".initcall"
> section.
Not exactly, that's .uml.initcall.init; see include/asm-um/common.lds.S:
__uml_initcall_start = .;
.uml.initcall.init : { *(.uml.initcall.init) }
__uml_initcall_end = .;
Also, in the section there is a list of pointers, not the functions
themselves.
> Wouldn't it be better to call all the functions explicitely ?
>
> Because I was thinking of another problem : the modules. If some modules
> are compiled and that the init_modules functions are put in the initcall
> section, then all the modules will be loaded.
Nothing from modules is linked inside the kernel.
The function set as module_init() function is put into the above section only
if the code is linked statically, not as module. When it's a module it's put
somewhere so when the module is loaded that function is called.
> That was just some thoughts :p
This idea is not new for UML - the linux kernel uses the same idea
for .initcall.init section (we do that separately because some functions must
be called at different moments). And that works.
--
Inform me of my mistakes, so I can keep imitating Homer Simpson's "Doh!".
Paolo Giarrusso, aka Blaisorblade (Skype ID "PaoloGiarrusso", ICQ 215621894)
http://www.user-mode-linux.org/~blaisorblade
___________________________________
Yahoo! Mail: gratis 1GB per i messaggi e allegati da 10MB
http://mail.yahoo.it
-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
prev parent reply other threads:[~2006-05-07 19:50 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20060507125412.GA16519@Starbuck>
2006-05-07 14:09 ` [uml-devel] do_uml_initcalls Jeff Dike
2006-05-07 19:50 ` Blaisorblade [this message]
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=200605072150.18891.blaisorblade@yahoo.it \
--to=blaisorblade@yahoo.it \
--cc=tyler@agat.net \
--cc=user-mode-linux-devel@lists.sourceforge.net \
/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