Re: __initdata query

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

 



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);

Davide

--
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