linux-mips-fnet
[Top] [All Lists]

RE: __initfunc(), kernel coding logic?

To: linux-mips@fnet.fr
Subject: RE: __initfunc(), kernel coding logic?
From: Harald Koerfgen <harald.koerfgen@netcologne.de>
Date: Thu, 02 Jul 1998 22:15:20 +0200 (MEST)
In-reply-to: <Pine.LNX.3.95.980702172623.159A-100000@schnecke.dutch.mountain>
Organization: none
Reply-to: "Harald Koerfgen" <harald.koerfgen@netcologne.de>
Sender: harry@franz.no.dom
Hi Richard,

On 02-Jul-98 Richard van den Berg wrote:
> Hi,
> 
> I am stuck with __initfunc(), trying to make the ethernet driver more
> talkative while booting I didn't succeed. So I replaced it with these
> lines of code:
> 
> ---------------
> 
>#include <linux/kernel.h>
> 
> __initfunc(void my_test(void))
> {
> 
>       printk("see if this shows up\n");
> 
>       return 0;
> }
> 
> ---------------
> 
> It compiles with "declance.c:4: warning: return-type defaults to `int'"
> and gets nicely archived and linked but doesn't show up when booting. My
> question is what likes __initfunc() to see to behave decently?
> 
> Regards,
> 
> Richard

Like Ralf already said: __initfunc(...) just puts the following code into a
special text section which gets freed after initialization. This has nothing to
do with the circumstances under which your code is beeing called.

If you want to do some experiments with a net driver you may want to edit
drivers/net/Space.c accordingly.  

Hope this helps.
---
Regards,
Harald

<Prev in Thread] Current Thread [Next in Thread>