Re: Module init for compiled in vs loaded modules

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

 



Code base of 2.6.18

>
> 1) But where do i look to find how the kernel loads(ie. calls the fn exported by module_init(XXXX)) for modules compiled into the kernel.

linux/init.h:

#ifndef MODULE
...
#define module_init(x)  __initcall(x);
#define __initcall(fn) device_initcall(fn)
#define device_initcall(fn)     __define_initcall("6",fn)
#define __define_initcall(level,fn) \
    static initcall_t __initcall_##fn __attribute_used__ \
    __attribute__((__section__(".initcall" level ".init"))) = fn
...
#endif


So as you can see call to module_init is actually an initcall.

initcalls are processed in do_initcalls function in init/main.c

static void __init do_basic_setup(void)
{
    ....
    do_initcalls();
}

>
> thanks !

Amol

>
>
>
>
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-embedded" in
> the body of a message to majordomo@xxxxxxxxxxxxxxx
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>
--
To unsubscribe from this list: send the line "unsubscribe linux-embedded" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Gstreamer Embedded]     [Linux MMC Devel]     [U-Boot V2]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux ARM Kernel]     [Linux OMAP]     [Linux SCSI]

  Powered by Linux