[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: changes required for making modular driver -> a buitl-in one
On Tuesday 05 October 2004 13:34, Kiran Kumar Immidi wrote:
> The init / cleanup functions are called even in built-in case. Have a
> look at include/linux/init.h. The __init macro is what handles the job. In
> case a component is built as a module, these reduce to nothing. In case it
> is built in to the main kernel, the __init macro effectively puts that
> function into the text init portion
>
> #define __init __attribute__ ((__section__ (".init.text")))
>
> Now, when the kernel boots up, there is a call to do_initcalls() from
> do_basic_setup(). This function calls each of the functions in the
> .init.text section (the for loop) and thus initializes the components.
>
> The above is my understanding.. do correct me if anything is wrong.
Ok.. Thanks to Pavan, I have corrected myself and understood this better.
The __init macro is in charge of putting the code in the .init.text segment.
The __initcall macro is in charge of including the function in the list of
initcalls.
--
Regards,
Kiran Kumar Immidi
--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive: http://mail.nl.linux.org/kernelnewbies/
FAQ: http://kernelnewbies.org/faq/