Re: What is __init?

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

 



> When I see a driver code, I found __init. For example,Âstatic int __init
> xxxx(struct platform_device *pdev)
> I understand "static" and "int", but what is __init?

__init places the symbol it qualifies into a special section of the
kernel that is discarded from memory once all initialization functions
are called. Since an initialization function is called only once
during system startup, it does not make sense to keep it once the
initialization phase is finished. __init allows to do that.

See also http://www.faqs.org/docs/kernel/x277.html

Alex.

_______________________________________________
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