Re: __init and __exit vs module_init()

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

 



On Thu, Apr 11, 2002 at 11:57:33AM -0400, Dan Erickson wrote:
> 
> 	Howdy,
> 		
> 	 	What I am wondering is, is __init equal to module_init()?

No.

__init only marks a function so that it will be placed in a special
section in the image.  This section of code will be freed up at the end
of the kernel boot process, if the code is compiled into the kernel.

It has nothing to do with module_init().

module_init() is the function that is called when the module is loaded
(if build as a module), or it is called at the same time as all of the
init calls are made (during the kernel boot process.)

See the comments in include/init.h for much better explanation of the
whole process.

Hope this helps,

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