Hello Michael,
The module_init call is defined as device_initcall, which is one of kernel inicalls.You can check this in your vmlinux:
ffffffff81765ed8 T __initcall_start
ffffffff81765ed8 T __setup_end
ffffffff81765ee0 t __initcall_trace_init_flags_sys_exitearly
ffffffff81765ee8 t __initcall_trace_init_flags_sys_enterearly
ffffffff81765ef0 t __initcall_init_hw_perf_eventsearly
ffffffff81765ef8 t __initcall_register_trigger_all_cpu_backtraceearly
ffffffff81765f00 t __initcall_spawn_ksoftirqdearly
ffffffff81765f08 t __initcall_init_workqueuesearly
ffffffff81765f10 t __initcall_check_cpu_stall_initearly
ffffffff81765f18 t __initcall_migration_initearly
...
783 static void __init do_basic_setup(void)
784 {
785 cpuset_init_smp();
786 usermodehelper_init();
787 shmem_init();
788 driver_init();
789 init_irq_proc();
790 do_ctors();
791 usermodehelper_enable();
792 do_initcalls();
793 random_int_secret_init();
794 }
Regards,
MH
MH
On Thu, Jan 9, 2014 at 10:25 AM, m silverstri <michael.j.silverstri@xxxxxxxxx> wrote:
Hi,
In a kernel driver code, I see it has 'module_init(jpeg_init)' and
'module_exit(jpeg_exit)'. I would like how know how will
jpeg_init(void) gets call during kernel bring up.
As an example:
static int __init jpeg_init(void)
{
printk(KERN_CRIT "Initialize JPEG driver\n");
platform_driver_register(&jpeg_driver);
return 0;
}
static void __exit jpeg_exit(void)
{
platform_driver_unregister(&jpeg_driver);
}
module_init(jpeg_init);
module_exit(jpeg_exit);
Thank you.
_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@xxxxxxxxxxxxxxxxx
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
_______________________________________________ Kernelnewbies mailing list Kernelnewbies@xxxxxxxxxxxxxxxxx http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies