From: Ashlesha Shintre <ashlesha@kenati.com>
To: linux-mips@linux-mips.org
Subject: RE: early_initcall
Date: Wed, 06 Sep 2006 11:10:47 -0700 [thread overview]
Message-ID: <1157566247.6485.12.camel@sandbar.kenati.com> (raw)
In-Reply-To: <66910A579C9312469A7DF9ADB54A8B7D366028@exchange.ZeugmaSystems.local>
[-- Attachment #1: Type: text/plain, Size: 3518 bytes --]
I googled early_initcall and found a patch which basically adds this
line to the /include/init.h file:
#define early_initcall(fn) __define_initcall(".early1",fn)
I built a kernel image with this new line included and now if I try
executing it, the bootloader YAMON gives an exception error before it
can even begin! Here is the dump:
************************* User Exception
**********************************
Exception State 24 Machine check
(((((((((((((((((((( CPU Registers )))))))))))))))))))))))))))))
zr: 00000000 at: 10007c00 v0: 00000003 v1: 00000004
a0: 14000017 a1: 14080017 a2: 50000000 a3: 00000000
t0: 40000000 t1: 01ffe000 t2: 80400000 t3: 80410000
t4: 80400000 t5: fffffffe t6: ffffffff t7: 00000010
s0: 10007c00 s1: 80380000 s2: 80400000 s3: 80401c5c
s4: 80400000 s5: 803affc0 s6: 00000000 s7: 00000000
t8: 00000006 t9: 803afde6 k0: 00000000 k1: 00000000
gp: 803ae000 sp: 803aff10 s8: 800e8380 ra: 803f68c0
{{{{{{{{{{{{{{{{{{{{{ CP0 Registers }}}}}}}}}}}}}}}}}}}}}}}}}}}}}
Index: 00000003 Random: 00000019 EntryLo0: 14000017
EntryLo1: 14080017 Context: 007ffff0 Page Mask: 00000000
Wired NO: 00000004 Reg 7: 00000000 Reg 8: fffffff4
Reg 9: 4d691cb7 Entry Hi: 50000000 Reg 11: 00000000
Reg 12: 10007c02 Reg 13: 00808060 Reg 14: 803f0484
Proc ID: 01030200 ERROREPC: 00000000 Config: 80008083
Config 1: 00000000 WatchLo: 00000000 WatchHi: 80000000
Debug: 00008000 DEPC: 00000000
STATUS: 10007c02
CAUSE: 00808060
EPC: 803f0484
BADVADDR: fffffff4
LO: 04000000
HI: 00000000
A machine check means that an exception is generated due to duplicate
TLB entries. I dont understand why the kernel crashes so early.
Also, what does the ".early1" mean? Is that a definition of a different
segment in the init.h file?
I checked output of the "readelf -a vmlinux" and found that the address
for the early_initcall comes up about 5 times. I m not sure what each
of the fields mean, so I have attached the above part of the readelf in
a file called readelf.
Thank you!
Ashlesha.
On Fri, 2006-09-01 at 17:50 -0700, Kaz Kylheku wrote:
> > Ashlesha Shintre wrote:
> >
> > Hi,
> >
> > I m using the 2.6.14.6 tree and trying to get the kernel
> > running on the
> > Encore M3 board.
> >
> > The kernel crashes during the boot process at the
> > early_initcall.
>
> What is the exact output from the crash?
>
> > This function doesnt seem to be defined anywhere.
>
> It's not a function, but a macro. The macro is used to annotate a
> function as being among the list of functions that are called at startup
> by the "initcall" mechanism: a big loop that sweeps over a symbol table
> of registered initialization functions and calls them. E.g.
>
> #include <linux/init.h>
>
> /* ... */
>
> int __init my_initialization_function(void)
> {
> printk(KERN_INFO "Hello, world\n");
> }
>
> early_initcall(my_initialization_function);
>
> The __init tells the kernel build system that your function is not
> needed after initialization and its memory can be thrown away. The
> early_initcall arranges for the initialization call. Early means that
> it's in the first group of functions.
>
> If you suspect your kernel is dying during the calling of the initcall
> functions, you can turn on initcall debugging. Add these parameters to
> your kernel command line:
>
> debug debug_initcall
>
> Hope this helps.
>
>
[-- Attachment #2: readelf.doc --]
[-- Type: application/msword, Size: 70144 bytes --]
next prev parent reply other threads:[~2006-09-06 18:03 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-09-02 0:50 early_initcall Kaz Kylheku
2006-09-02 0:50 ` early_initcall Kaz Kylheku
2006-09-06 18:10 ` Ashlesha Shintre [this message]
2006-09-07 3:30 ` early_initcall Ralf Baechle
2006-09-14 22:05 ` early_initcall Ashlesha Shintre
-- strict thread matches above, loose matches on Subject: below --
2006-09-01 23:38 early_initcall Ashlesha Shintre
2004-12-08 14:06 early_initcall Yoichi Yuasa
2004-04-24 7:59 early_initcall Stanislaw Skowronek
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=1157566247.6485.12.camel@sandbar.kenati.com \
--to=ashlesha@kenati.com \
--cc=linux-mips@linux-mips.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