Re: __initdata query

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

 



On Fri, 14 Mar 2008, Davide Madrisan wrote:

> 2008/3/14, Vijay Chauhan <kernel.vijay@xxxxxxxxx>:
> > Hi List,
> >
> >  I am a newbie and learning how to write a kernel module.
> >  I was reading about __init qualifier, in the init.h file it is mentioned that:
> >
> >  I did not understand the purpose of __initdata qualifier?
>
> The tag __initdata is for data used only during initialization (the
> data is put in a special ELF section that is discarded after
> initialization).
>
> >  1. Will the variable be free up after the initialization? Then it is
> >  of no use to write the code like:
> >  static int init_variable __initdata = 0;
> >  Why I will initialize a variable and then free it?
>
> For example to set variables while modprobing the kernel module:
>
> static __initdata char *prm = "userval";
> ...
> module_param(prm, charp, S_IRUGO);

are you sure about the above?  can you point at a sample source file
somewhere in the kernel tree that allows __initdata to be applied to
module parameters?  i've just never seen that.  maybe i haven't looked
hard enough.

rday
--

========================================================================
Robert P. J. Day
Linux Consulting, Training and Annoying Kernel Pedantry:
    Have classroom, will lecture.

http://crashcourse.ca                          Waterloo, Ontario, CANADA
========================================================================

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at 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