Re: do_initcalls

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Mar 18, 2013 at 05:35:29PM +0100, Tobias Boege wrote:
> On Mon, 18 Mar 2013, ishare wrote:
> > On Sun, Mar 17, 2013 at 04:11:54PM +0100, Tobias Boege wrote:
> > > On Sun, 17 Mar 2013, ishare wrote:
> > > > 
> > > >  for (call = &__initcall_start; call < &__initcall_end; call++)
> > > >    (*call)();
> > > > 
> > > >  I want to know where are these  function point assigned by specified function ?
> > > > 
> > > >  thanks!
> > > 
> > > As per include/asm-generic/vmlinux.lds.h and your arch's vmlinux.lds.S (I
> > > actually only looked at x86's), the __initcall_{start,end} variables are the
> > > start and end of the __initcall ELF section which contains all the sub-level
> > > sections.
> > > 
> > > Functions can be put into these sections when they are given to one
> > > of the *_initcall macros from include/linux/init.h.
> > 
> >   I have configure kernel  supporting rom filesystem ,and register it  by module_init(init_romfs_fs) ,
> >   but why the function : init_romfs_fs not be called from (*call)() ?
> > 
> >   thanks!
> > 
> 
> This is strange - *unless* you build romfs as a module. Have again a look at
> the aforementioned include/linux/init.h. There's a fairly big comment on the
> procedure:
> 
> /**
>  * module_init() - driver initialization entry point
>  * @x: function to be run at kernel boot time or module insertion
>  *
>  * module_init() will either be called during do_initcalls() (if
>  * builtin) or at module insertion time (if a module).  There can only
>  * be one per module.
>  */

   Does this mean it chould not be called during do_initcalls if I config it as   a module ?

   If this ,how to change it to be builtin module?
   
   what is  called  module insertion time? Is that time I explicitely  call some insert function?

   thanks!

> 
> Regards,
> Tobi
> 
> 
> _______________________________________________
> Kernelnewbies mailing list
> Kernelnewbies@xxxxxxxxxxxxxxxxx
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@xxxxxxxxxxxxxxxxx
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux