Re: too many initcall

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

 



On Thu, Sep 08, 2005 at 06:02:53PM +0900, NAHieu wrote:
> Hello,
> 
> In linux we have many macro to initialize the kernel module, like below:
> 
> #define core_initcall(fn)               __define_initcall("1",fn)
> #define postcore_initcall(fn)           __define_initcall("2",fn)
> #define arch_initcall(fn)               __define_initcall("3",fn)
> #define subsys_initcall(fn)             __define_initcall("4",fn)
> #define fs_initcall(fn)                 __define_initcall("5",fn)
> #define device_initcall(fn)             __define_initcall("6",fn)
> #define late_initcall(fn)               __define_initcall("7",fn)
> 
> 
> The problem is I am not sure which initcall should be used in which
> case.

It all depends on your code.  What are you trying to do?  Can it be
built as a module?  If so, you don't need to worry about any of the
above.

> I look at kernel code, some places they use postcore_initcall(),
> some places they use subsys_initcall(), but what is the correct
> semantics of each?

Again, it depends on the needs of the calling code.

Have a pointer to your code somewhere?

thanks,

greg k-h

--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/


[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